Hi.
I’m working on automating my thermostat after succesfully connecting an Opentherm gateway.
I have also succesfully created a climate entity. When I set the temperature in this climate entity, it calls an mqtt publish command that sets the temperature. So far, so good.
I can confirm that this works by publishing the following code in the dev sections of HA:
service: mqtt.publish
data:
topic: opentherm-thermostat/setpoint-temperature/set
payload: "{{ states('input_number.set_to_temperature_1')}}"
input_numer.set_to_temperature_1 is a helper I created. Let’s say I set this to 10. When I publish this mqtt code, it succesfully set’s the climate entity to 10 degrees Celcius. The thermostat also responds to this correctly by turning on or off depending on the current temperature.
Now, here’s the problem:
When I add the following code to node-red, it results in the climate entity being set to 0 degrees. No matter what I set the temperature to. When I don’t use a template code for the payload, but just a simple value, it DOES work. Somehow, it doesn’t like my template. The template in the topic DOES work, just not the one at the payload.
[{"id":"be279730a0dc1b8d","type":"api-call-service","z":"d3e6bcc99a40c340","name":"","server":"314cec54.7a6264","version":5,"debugenabled":false,"domain":"mqtt","service":"publish","areaId":[],"deviceId":[],"entityId":[],"data":"{\"payload\":\"{{ states('input_number.set_to_temperature_1')}}\",\"topic\":\"opentherm-thermostat/setpoint-temperature/set\"}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":1010,"y":220,"wires":[[]]},{"id":"314cec54.7a6264","type":"server","name":"Home Assistant","version":5,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":"30","areaSelector":"friendlyName","deviceSelector":"friendlyName","entitySelector":"friendlyName","statusSeparator":"at: ","statusYear":"hidden","statusMonth":"short","statusDay":"numeric","statusHourCycle":"h23","statusTimeFormat":"h:m","enableGlobalContextStore":true}]
Any suggestions on how to proceed? I don’t see the difference in the template code that I ‘fire’ from the HA dev menu and the code in node-red… Why does it work in the dev menu, and not in node-red?