Kroonpeter
(Peter van Kroonenburg)
1
Hallo all,
I have : input_number.climate_temperature_away
When I run this in Node Red msg.payload gives the correct result : 19
I want to use this value in a call service node.
domain.climate
service: set_temperature
entry id: climate.living_room
data:{"temperature":"{{payload} | float "}}
I get this error: “Call-service error. expected float for dictionary value @ data[‘temperature’]”
How can I solve this error.
set data to expression
and try this in the data field:
{“temperature”: $number(payload)}
You can’t use jinja filters in the data field. Check out Jsonata for that purpose.
1 Like
Kroonpeter
(Peter van Kroonenburg)
3
Thankx for the replay. I replaced as in you advice.
Now i get: “Key in object structure must evaluate to a string; got: undefined”
HansOHG
(Hans Ohg)
4
Hello
Did you solve this?
I am trying to send float-1 to my thermostat but I get the same error message as you do.
Mikefila
(Mike Fila)
5
If you are trying to subtract 1 from the payload, remove the float filter and use J expression instead of json
HansOHG
(Hans Ohg)
6
Yes that is exactly what I want to do. I am still a novice in node red so could you please show me how the code would look?
Mikefila
(Mike Fila)
7
In the data field there is a drop down, change it to J;expression
{
"entity_id": "climate.floor_thermostat_2",
"temperature": payload - 1
}
HansOHG
(Hans Ohg)
8
Thank you for the help, but there must be more fundamentally wrong here. Maybe you could help.
My flow is like this:
The current state node does not send out the attribute.temperature only the state.
The call service node gives an error like this now:
msg : string[59]
“The left side of the “-” operator must evaluate to a number”
What am I doing wrong now?
Mikefila
(Mike Fila)
9
With jsonata you need to tell it where to look. You also would drop data
$entity().attributes.temperature
HansOHG
(Hans Ohg)
10
Thank you. That solved my problems