Code: Select all
TestUnit/SmartPlug/Set
TestUnit/SmartPlug/State
And created a new dedicated SmartPlug plugin that combines the Relay/Led/Pushbutton to make things more easy.
The plugin needed to configure the pins to use on the smartplug:
Simple Node Red flow for the dashboard:
Simple lean and mean dashboard:
The button on the dashboard uses the feedback, so it only flips when it has received the actual state back from the ESP.
And using the local button flips the switch on Node-red as well.
When the local button is used, it will control the relay/led locally, so it will still work when the network is down.
I'm used to Domoticz (HTTP controller) only, so most of this stuff (MQTT, Node-Red) is fairly new to me.
Maybe this approach is even more than required, so pls guide me if it can be improved.