Node-RED relay actuator
Relays are the general term for devices you turn ON and OFF like you do with ordinary lights and power relays. My home automation environment is built on MQTT for communication and Node-RED for the brains. This post is about how I created a sub-flow as actuator for those relays in Node-RED which integrate all needed functionalities.
Both Tasmota and Zigbee: I operate Tasmota devices which are WiFi devices listening to MQTT directly. Secondly I operate Zigbee devices with a Zigbee2MQTT controller to relay messages between the mqtt and zigbee protocol. Their MQTT messages are in a slight different dialect, both for the messages sent to the relays as for the messages the relays send as response. I want the sub-flow to take care.
Send the command: Send the command to the device.
Log the command: Log the commands to a database for further analysis. That could be an influxdb database or a SQL database.
Return the response: Return the response of the device.
Persistent: Remember the status of the relay for functional use in other Node-RED flows.
Informative: Show the latest command to the relay as the status of the sub-flow.
<to be continued>