When I had problem with my energy dashboard (more of this in a future post) I struggled to find the configuration for the Energy Dashboard configuration.
NOWHERE TO BE FOUND!
Drove my crazy, but I eventually found it!
Configuration -> Dashboards -> Energy (or what ever your panel is called).
How to control a Home Assistant Light-entity via MQTT using Node-RED. Been a bit of a struggle, but this is how I did it. If you have any comments, please leave these below.
Prerequisites
Home Assistant (installed on Raspberry PI)
Node-RED installed on Hassio
MQTT-broker: Mosquitto installed on Hassio
Light-entity: a IKEA-light connected via Zigbee using deCONZ with a Conbee II-USB-stick
This is how my light-entity was configured in Home Assistant. Screen dump from Developer Tools in HA.
I choose to use MQTT to control the light because I wanted to control the light with an Arudrino with a LCD-display. This will be a future blogpost of how I did this…
With MQTT-box I published a MQTT-message to control the light
The Node-RED-flow to capture the MQTT-message and to respond to this looks like this:
The Switch-node. How to make Node-RED switch between ”turn_on” and ”turn_off” depending on the ”service”-information in the JSON-object. How I did it – screen shot below:
I was having trouble with Node-RED beeing disconnected to the Mosquitto-broker. I solved this by creating a separate MQTT-server-configuration for each Node-RED-flow using with a different Client-ID.
This is how my msg-object looked like after the JSON-node (converting the MQTT-string to a JSON-object).