Heatbeat
1. Gateway heatbeat
Heatbeat is sent as multicast to (ip: 224.0.0.50, port: 9898). Gateway will send a heatbeat every 10 seconds to tell it is functioning well.
{"cmd":"heartbeat","model":"gateway","sid":"1022780","short_id":0,"token":"1234567890abcdef","data":"{\"ip\":\"172.22.4.130\"}" }
"token" is a random string generated by gateway for user to generate "key".
2. Sub-device heatbeat
Sub-device's heatbeat is sent as multicast to (ip: 224.0.0.50, port: 9898),format as:
{"cmd":"heartbeat","model":"magnet","sid":"158d000065a271","short_id":25719,"data":"{\"status\":\"open\"}"}
Sub-devices use heatbeat to report they are working well (heartbeat frequency, once per hour for sleep devices, every 10 minutes for plugin devices).
For example: in the window and HVAC auto scene, you can use heartbeat (the normal message maybe lost, but heartbeat message can be remedied)