-
Notifications
You must be signed in to change notification settings - Fork 37
API between UI layer and OS layer
All communications between the UI layer and the OS layer happens through the Information Exchange Bus, where the messages are communicated to each other using defined topics.
General Topic Syntax for communicating between UI and OS layer:
/sender/receiver/<device_type>/<operation>/<building_name>/<zone_id>/<agent_id>
The following are the two available operations:
- update
- device_status
Example:
If the UI wants to request the status of a particular device, say, a thermostat, to the agent, the following message topic would be used:
/ui/agent/thermostat/device_status/bemoss/999/1THMASF2323ASD
If the agent is sending a response to the UI layer for this device status, the following message topic would be used for communication:
/agent/ui/thermostat/device_status_response/bemoss/999/1THMASF2323ASD
With these these, messages are transferred using the JSON format.
Example: Status message of a thermostat, or an update message to thermostat may contain similar message content:
{'temperature': 70, 'heat_setpoint': 75, 'cool_setpoint': 65, 'thermostat_mode': 'HEAT', 'fan_mode': 'AUTO'}