Changes in Node-Red - my old flow not working anymore

I have a flow that sets temperature for each radiator thermostat. The idea is to lower the temperature on all radiators at bedtime and bring the temp back up again in the morning. I double it, so it also lowers the temp when we are out of the house, but back up again before we come home. So, 2 times down+up at given intervals. I built it like this (flow below):

  • a timer node that sends a “start night-lowering”, “end night-lowering”, “start day-lowering” and “end day-lowering” strings.
  • for each device (thermostat), I then have a change node, that translates each of the above 4 strings to a value such as { data: { “entity_id”: “climate.kaeldervaerelse”, “temperature”: 21.5 } }
  • this value is then passed on to a call service node that identifies the DOMAIN as “Climate” and SERVICE as “set_temperature” - and should then append the above {…} data part and form a succesful call to lower or increase the temperature accordingly.

this has worked flawlessly for years, but now I get the error message:
Call-service error. must contain at least one of temperature, target_temp_high, target_temp_low.

and only this part is the output from the call service node (the Domain and Service parts):
{"domain":"climate","service":"set_temperature"}
so, the data part with the info on what device and what temp, is omitted.

I am really lost. I think it stopped working when I upgraded Node-Red some weeks ago. It appears to me, that the formatting of the data part I am trying to pass from change node to call service node is malformed somehow.

I am not a developer - and am lost, admitted

The flow (I included only one changenode/thermostat (but I have 9) - they all share the same one call service node:

[{"id":"9f1659e5.39bb9","type":"inject","z":"86416040.3b86f","name":"","repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"off","payloadType":"str","x":90,"y":31,"wires":[["e28bde86.5c4778"]]},{"id":"a385d5a3.8744f8","type":"inject","z":"86416040.3b86f","name":"","repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"auto","payloadType":"str","x":90,"y":71,"wires":[["e28bde86.5c4778"]]},{"id":"4a3ca2b2.4fd384","type":"inject","z":"86416040.3b86f","name":"","repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"on","payloadType":"str","x":90,"y":111,"wires":[["e28bde86.5c4778"]]},{"id":"e28bde86.5c4778","type":"bigtimer","z":"86416040.3b86f","outtopic":"radiator","outpayload1":"on","outpayload2":"off","name":"Nattesænk - øvrige","comment":"til at sænke om natten og hæve før vi står op","lat":"57.0281759","lon":"9.952779","starttime":"1320","endtime":"330","starttime2":"1320","endtime2":"330","startoff":0,"endoff":0,"startoff2":"","endoff2":"","offs":0,"outtext1":"natsaenk_start","outtext2":"natsaenk_slut","timeout":1440,"sun":true,"mon":true,"tue":true,"wed":true,"thu":true,"fri":true,"sat":true,"jan":true,"feb":true,"mar":true,"apr":true,"may":true,"jun":true,"jul":true,"aug":true,"sep":true,"oct":true,"nov":true,"dec":true,"day1":0,"month1":0,"day2":0,"month2":0,"day3":0,"month3":0,"day4":0,"month4":0,"day5":0,"month5":0,"day6":0,"month6":0,"day7":"","month7":"","day8":"","month8":"","day9":"","month9":"","day10":"","month10":"","day11":"","month11":"","day12":"","month12":"","d1":0,"w1":0,"d2":0,"w2":0,"d3":0,"w3":0,"d4":0,"w4":0,"d5":0,"w5":0,"d6":0,"w6":0,"xday1":0,"xmonth1":0,"xday2":0,"xmonth2":0,"xday3":0,"xmonth3":0,"xday4":0,"xmonth4":0,"xday5":0,"xmonth5":0,"xday6":0,"xmonth6":0,"xday7":"","xmonth7":"","xday8":"","xmonth8":"","xday9":"","xmonth9":"","xday10":"","xmonth10":"","xday11":"","xmonth11":"","xday12":"","xmonth12":"","xd1":0,"xw1":0,"xd2":0,"xw2":0,"xd3":0,"xw3":0,"xd4":0,"xw4":0,"xd5":0,"xw5":0,"xd6":0,"xw6":0,"suspend":false,"random":false,"randon1":false,"randoff1":false,"randon2":false,"randoff2":false,"repeat":false,"atstart":false,"odd":false,"even":false,"x":341,"y":197,"wires":[[],[],["4ce77012.b6c398","ff923432.d9bfb8","c63ac009.7e22","7ee9fb0e.862bac","d9e0bde7.91f1f8","8aa1ce24.a05668","4596463e.0254d8","c155e59a.e0a6b"]]},{"id":"4ce77012.b6c398","type":"change","z":"86416040.3b86f","name":"payload set_kælderværelse","rules":[{"t":"change","p":"payload","pt":"msg","from":"natsaenk_slut","fromt":"str","to":"{ data: { \"entity_id\": \"climate.kaeldervaerelse\", \"temperature\": 21.5 } }","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":"natsaenk_start","fromt":"str","to":"{ data: { \"entity_id\": \"climate.kaeldervaerelse\", \"temperature\": 18.5 } }","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":"dagsaenk_start","fromt":"str","to":"{ data: { \"entity_id\": \"climate.kaeldervaerelse\", \"temperature\": 18.5 } }","tot":"str"},{"t":"change","p":"payload","pt":"msg","from":"dagsaenk_slut","fromt":"str","to":"{ data: { \"entity_id\": \"climate.kaeldervaerelse\", \"temperature\": 21.5 } }","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":699,"y":43,"wires":[["7e4a9732.9aad1"]]},{"id":"7e4a9732.9aad1","type":"delay","z":"86416040.3b86f","name":"","pauseType":"delay","timeout":"1","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"outputs":1,"x":936,"y":42,"wires":[["de67e84f.d0074"]]},{"id":"de67e84f.d0074","type":"api-call-service","z":"86416040.3b86f","name":"reguler radiator","server":"35bd3768.bca1","version":5,"debugenabled":true,"domain":"climate","service":"set_temperature","areaId":[],"deviceId":[],"entityId":[],"data":"","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[{"property":"payload","propertyType":"msg","value":"","valueType":"data"}],"queue":"none","output_location":"payload","output_location_type":"msg","x":1177,"y":244,"wires":[[]]},{"id":"35bd3768.bca1","type":"server","name":"Home Assistant","version":2,"addon":false,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true,"cacheJson":true,"heartbeat":false,"heartbeatInterval":"30"}]

It looks like the service call might have change in your HA integration.
Try to make the call directly in HA as manual call from the developer tools.

Thanks, WallyR - but I don’t get anything out of that. I can call the service succesfully, but how does that give me the correct syntax (if that is the problem) to copy to Node-Red? I can also easily change the temp from the lovelace dashboard. But something has changed…

The data you provide in the call service tab in the developer tools should be the same that should be used in NodeRed.

I know. It is a not a question of what data, but how to format it, I suspect. Thanks for your help, but I don’t know how to carry out what your are suggesting.

Last time I answered I had no option to look at your code.
Now I have and it looks like your data field is populated with a dict called data.
Try to remove that dict and just send the data inside the dict into the data field.

And I just noticed that some of the nodes needs to be updated too, if you are running with a newer version of NodeRed. Look for the yellow text.

image

In your change node change the field type to JSON and add quotes around data

Thanks @WallyR will try that later today and report back

Thanks @Kermit - will try that later today and report back

@WallyR and @Kermit - thanks again. Good suggestions. Unfortunately, does not seem to have made a difference. I also updated the Node-Red palettes for HA. So far, no changes. I keep tinkering - I’ll report when any progress - or lack of same.

I know I can create a Call Service node for each device+temp variant (I got that working), but I’d really like to keep it as clean as is and pass temp and device from the timer output + change node for each device.

Again, thanks so far. Much appreciated.

This is working on my end with the latest release.

[{"id":"9f1659e5.39bb9","type":"inject","z":"c89d915bdff0f798","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"natsaenk_slut","payloadType":"str","x":250,"y":2288,"wires":[["4ce77012.b6c398"]]},{"id":"4ce77012.b6c398","type":"change","z":"c89d915bdff0f798","name":"payload set_kælderværelse","rules":[{"t":"change","p":"payload","pt":"msg","from":"natsaenk_slut","fromt":"str","to":"{ \"data\": { \"entity_id\": \"climate.kaeldervaerelse\", \"temperature\": 21.5 } }","tot":"json"},{"t":"change","p":"payload","pt":"msg","from":"natsaenk_start","fromt":"str","to":"{ \"data\": { \"entity_id\": \"climate.kaeldervaerelse\", \"temperature\": 18.5 } }","tot":"json"},{"t":"change","p":"payload","pt":"msg","from":"dagsaenk_start","fromt":"str","to":"{ \"data\": { \"entity_id\": \"climate.kaeldervaerelse\", \"temperature\": 18.5 } }","tot":"json"},{"t":"change","p":"payload","pt":"msg","from":"dagsaenk_slut","fromt":"str","to":"{ \"data\": { \"entity_id\": \"climate.kaeldervaerelse\", \"temperature\": 21.5 } }","tot":"json"}],"action":"","property":"","from":"","to":"","reg":false,"x":504,"y":2288,"wires":[["8f0ba1e6b36ef07d"]]},{"id":"a86c713af356bd7b","type":"debug","z":"c89d915bdff0f798","name":"debug 81","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":996,"y":2288,"wires":[]},{"id":"3d0692b68c2600d4","type":"inject","z":"c89d915bdff0f798","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"natsaenk_start","payloadType":"str","x":260,"y":2336,"wires":[["4ce77012.b6c398"]]},{"id":"e23c272bb4520dfd","type":"inject","z":"c89d915bdff0f798","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"dagsaenk_start","payloadType":"str","x":260,"y":2384,"wires":[["4ce77012.b6c398"]]},{"id":"45b0856f2a730313","type":"inject","z":"c89d915bdff0f798","name":"","props":[{"p":"payload"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"dagsaenk_slut","payloadType":"str","x":250,"y":2432,"wires":[["4ce77012.b6c398"]]},{"id":"8f0ba1e6b36ef07d","type":"api-call-service","z":"c89d915bdff0f798","name":"","server":"","version":5,"debugenabled":true,"domain":"climate","service":"set_temperature","areaId":[],"deviceId":[],"entityId":[],"data":"","dataType":"jsonata","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":770,"y":2288,"wires":[["a86c713af356bd7b"]]}]

Thanks @Kermit. Promising. When you say “latest release” - do you mean for node-red or HA? - I am bit behind on HA-side… maybe that is the culprit.