-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathPethublocal.iuml
41 lines (40 loc) · 1.71 KB
/
Pethublocal.iuml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
plantuml
@startuml
Hub <-> NTP : Get the time
group DNS
Hub -> DNS : Lookup hub.api.surehub.io
DNS -> Hub : Altered DNS response to return local instance
end group
group Web Docker - Cloud Service Credentials API endpoint
Hub -> "Local Web" : HTTPS POST /api/credentials
note right: with Serial Number & MAC Address
"Local Web" -> "Cloud Web" : HTTPS POST /api/credentials
note right: with Serial Number & MAC Address
"Cloud Web" -> "Local Web" : Response
note right: Credentials response with MQTT topicAWS IoT\nendpoint and Client Certificate
"Local Web" -> "Local Web" : Save locally
note right: Alter credential file and save locally
"Local Web" -> Hub : Reponse:
note right: Altered credentials response with local MQTT topic,\nlocal MQTT endpoint to also be hub.api.surehub.io
end group
group MQTT Docker - Local MQTT TLS Endpoint
Hub -> "Local MQTT" : Connect to Local with Client Certificate
"Local MQTT" -> Hub : MQTT TLS Session established
"Local MQTT" -> HAMQTT : Proxy pethublocal to Home Assistant
note right: as per /docker/local/mqtt/default/mosquitto.conf\nMirror pethublocal/hub in both directions
HAMQTT -> "Local MQTT" : Response from Home assistant MQTT
end group
group PetHub Docker - Translate Hub Messages to Home Assistant
PetHub -> HAMQTT : PetHub Connect
note left: Connect to local MQTT and subscribes to pethublocal/# and homeassistant
HAMQTT -> PetHub : Message
note left: On pethublocal topic from Hub
PetHub -> HAMQTT : Response
note left: With config/state message on homeassistant/sensor/pethub/xx
HAMQTT -> PetHub : Response
end group
group MSGS Docker - Save all messages docker
"Local MQTT" <- MSGS : Connect to local MQTT
note left: Subscribes to pethublocal and save all messages to output/msgs
end group
@enduml