I can’t quite get the configuration working using the below config snippet inside an mqtt/switch: yaml node, hoping someone may be able to shed some light on what’s happening.
I don’t want to reduce these payloads, This is the JSON I actually want to send out to the controller. If I reduce the payloads to on and off then the controller won’t be able to do anything with it. Or am I missing something in my thinking.
For example, if I send the payload via node red, this also works as expected to control the output.
My understanding is that the value_template is used to parse the state value returned by the state_topic when in JSON format. As my state is nor returned as a JSON string it shouldn’t require the value_template. This seems to be correct as I can see what the state is when toggling it from another source.
I don’t think it has anything to do with the command payload that should be sent to the command_topic, this should just be a JSON payload entered directly into the config for the switch.
As an update and for completeness, I did get it working correctly, although I’m not sure how it really differs to what I originally had in the config. The working version is below: