Node Red - Climate - Set temperature while taking temperature value from a schedule helper

Hello,

I’ve been trying to set an action node up to set a climate control temperature, while taking the temperature value from a schedule helper temperature attribute.

I’ve tried so many different variations of JSON but it’s not working. This is the latest version

​"temperature": “{{msg.data.attributes.temperature}}”

How do I achieve this?

Thanks in advance!

Set the data field to JSONata (J: Expression), and use the $entities() function to access entity attributes directly:

"temperature": $entities("entity.id").attributes.temperature

More details: https://zachowj.github.io/node-red-contrib-home-assistant-websocket/guide/jsonata/#home-assistant-functions

Thanks for coming back to me. I must have set something up wrong. This is the debug results:

JSONataError: Syntax error: “:”

I’ve set the J: expression up as:

“temperature”: $entities(“schedule.oliver_and_eva_not_here_upstairs”).attributes.temperature

The way a schedule entity works is that it will only have a temperature value when it is on. If there is no entry, schedule state is off, set for the time when the automation triggers, there will be no temperature value.

Thanks for coming back to me @Mikefila. Turns out the issue was I didn’t add the {} to the J: expression.

It’s all working now.

1 Like