Skip to content

Commit d731a74

Browse files
authored
Merge pull request #357 from dvd-dev/postman_doc
Postman doc
2 parents 1b210b0 + 34f6379 commit d731a74

10 files changed

+105
-0
lines changed

doc/EventCHConsumptionUpdatedValuesReceived renamed to doc/Challenge(Event) Replies/EventCHConsumptionUpdatedValuesReceived

File renamed without changes.

doc/EventCHDetailsUpdatedValuesReceived.json renamed to doc/Challenge(Event) Replies/EventCHDetailsUpdatedValuesReceived.json

File renamed without changes.

doc/EventFlexDetailsUpdatedValuesReceived.json renamed to doc/Challenge(Event) Replies/EventFlexDetailsUpdatedValuesReceived.json

File renamed without changes.

doc/Device Replies/DeviceListInitialValuesReceived.json

Whitespace-only changes.

doc/ChallengeAdded.json renamed to doc/Old JSONs (pre 2025-26 season)/ChallengeAdded.json

File renamed without changes.

doc/ChallengeConsumptionUpdatedValuesReceived.json renamed to doc/Old JSONs (pre 2025-26 season)/ChallengeConsumptionUpdatedValuesReceived.json

File renamed without changes.

doc/ChallengeDetailsInitialValuesReceived.json renamed to doc/Old JSONs (pre 2025-26 season)/ChallengeDetailsInitialValuesReceived.json

File renamed without changes.

doc/ChallengeListInitialValuesReceived.json renamed to doc/Old JSONs (pre 2025-26 season)/ChallengeListInitialValuesReceived.json

File renamed without changes.

doc/ChallengeListUpdatedValuesReceived.json renamed to doc/Old JSONs (pre 2025-26 season)/ChallengeListUpdatedValuesReceived.json

File renamed without changes.

doc/Readme.md

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
# Using get_tokens.py
2+
This python script will let you use it to log in to your Hilo account.
3+
4+
From there, you will be asked to copy the full HA redirect(callback) URL and go back to your python script and press enter.
5+
6+
Negotiation will take place and you will receive three distinct tokens:
7+
- Your access token
8+
- Your devicehub token
9+
- Your challengehub token
10+
11+
Take care not to share your tokens as they are not encrypted and contain personally identifiable information.
12+
13+
1. Run get_tokens.py, you will be provided with a link. Either click it or copy it in your favourite browser.
14+
<img width="1393" height="186" alt="image" src="https://github.com/user-attachments/assets/0b9559b1-1d9a-41ae-b4bf-185a5a5c588b" />
15+
16+
2. Login using your Hilo Credentials
17+
18+
<img width="631" height="569" alt="image" src="https://github.com/user-attachments/assets/ad7c79a7-2402-44e8-9a0b-962406b89527" />
19+
20+
3. Once you get to this page, select the URL and copy it to clipboard
21+
<img width="694" height="274" alt="image" src="https://github.com/user-attachments/assets/85989069-31a3-418d-b305-1f2378432d84" />
22+
<img width="567" height="46" alt="image" src="https://github.com/user-attachments/assets/1d979626-6d93-46cb-aae0-50ef061a0d61" />
23+
24+
4. Go back to get_tokens.py and press enter, you'll get all 3 tokens:
25+
26+
<img width="1208" height="805" alt="image" src="https://github.com/user-attachments/assets/10258890-e935-4b16-8d16-12bdd340c001" />
27+
28+
29+
# Using Postman to send payloads to devicehub or challengehub
30+
## Prerequisite: you need to have your tokens on hand, they are relatively short lived so once you have them, get to connecting!
31+
32+
### DeviceHub
33+
34+
1. Open up a new websocket connection and paste the DeviceHub URL
35+
2. In Headers, add "Authorization".
36+
3. In the Authorization field, type in "Bearer" then a space, and paste your DeviceHub token.
37+
<img width="856" height="479" alt="image" src="https://github.com/user-attachments/assets/6ff6540d-066b-4ea2-a640-5bcaada9ea09" />
38+
4. Go to the "Messages" tab and type in. Notice the control character at the end chr(30). It is required.
39+
40+
```
41+
{
42+
"protocol": "json",
43+
"version": 1
44+
}
45+
```
46+
5. You can then invoke "SubscribeToLocation" to get your device informations.
47+
```
48+
{
49+
"arguments": [
50+
69420
51+
],
52+
"invocationId": "0",
53+
"target": "SubscribeToLocation",
54+
"type": 1
55+
}
56+
```
57+
6. You should received the DeviceListInitialValuesReceived message back.
58+
59+
### ChallengeHub
60+
61+
1. Open up a new websocket connection and paste the DeviceHub URL
62+
2. In Headers, add "Authorization".
63+
3. In the Authorization field, type in "Bearer" then a space, and paste your DeviceHub token.
64+
<img width="856" height="479" alt="image" src="https://github.com/user-attachments/assets/6ff6540d-066b-4ea2-a640-5bcaada9ea09" />
65+
4. Go to the "Messages" tab and type in. Notice the control character at the end chr(30). It is required.
66+
67+
```
68+
{
69+
"protocol": "json",
70+
"version": 1
71+
}
72+
```
73+
5. You can send various messages to the ChallengeHub to request different information. For the 2025-2026 season with the addition of Flex D, the messages were split between Winter Credit (Crédit Hivernal) and Flex D. Winter Credit messages will contain CH in their target, and Flex D event will contain Flex in their target. Each of rates has its own event id, for example, event 337 was for Winter Credits, and event 338 was for Flex D, both occured at the same time. You will have access to one, or the other, depending on your rate.
74+
75+
76+
### Examples of various invokesto the ChallengeHub
77+
78+
#### SubscribeToEventCH or SubscribeToEventFlex
79+
80+
This invoke is used:
81+
```
82+
{
83+
"arguments": [
84+
{
85+
"locationHiloId": "urn:YOUR-URN",
86+
"eventId": ID(numberic)
87+
}
88+
],
89+
"invocationId": "1",
90+
"target": "SubscribeToEventCH",
91+
"type": 1
92+
}
93+
```
94+
95+
And should return
96+
```
97+
EventCHDetailsInitialValuesReceived
98+
````
99+
Or
100+
```
101+
EventFlexDetailsInitialValuesReceived
102+
```
103+
104+
105+

0 commit comments

Comments
 (0)