Hi,
Just migrating a dashboard I had set up inside HA so that it becomes just an MQTT based version.
In the HA version, I'm connecting a dashboard slider to a call service node, and can manipulate the payload on the call service side like this:
{ "brightness_pct":msg.payload }
With the MQTT approach, apparently I cannot manipulate the payload on either side. On the slider side, payload is just hard wired to 'Current state', and on the MQTT side, there doesn't seem to be anywhere to set the payload that goes to the MQTT topic. I can see in MQTT Explorer, my light is showing
set = 49
When I need it to say
set = {"brightness_pct": 49}
I tried putting the payload in the topic field, but it's not substituting the variable msg.payload.
Here's where I'm being thick. I found this solution:
But I don't know how to implement it
I put a template node between my slider and MQTT out, and I put this value in the Template field:
brightness_pct:{{payload}}
But the debug shows the output of the template node is exactly the same as the output from the slider. No I don't understand template nodes yet, sorry being a noob. I'll get there.