Files

29 lines
897 B
Markdown

System of monitoring and controlling heating.
Modules (called units) send their data via UDP.
Each datagram contains JSON object of following form:
{
"id": "<ID>",
"ip": "<IP>",
"v1": "123",
...
}
Where ID is unit's identifier (MAC address usually),
IP is unit's current IP address (for server to be able
to contact it).
Other values in object are names and values of sensors
available on the unit.
Server could send datagram with some commands to unit.
For simplicity datagram is simple string with command and
optional arguments, everything separated with character 0x01.
Possible commands are:
1. ping - no arguments. Informs unit that server is still alive
and able to communicate
2. r_write - one argument either '0' or '1'. Sets relay state
for unit (only for relay modules). Note that relay on relay modules
is normally opened, so '0' means turned on and '1' means turned off.