I’m trying to create an automation which sends the current outdoor temperature to a thermostat. I receive an error saying expected float for dictionary value @ data['value']
I’ve tested a few templates in the developer tools template editor: {{ states('sensor.openweathermap_temperature') }} returns number {{ states('sensor.openweathermap_temperature') | float }} returns number {{ float(states('sensor.openweathermap_temperature')) }} returns number
According to the error message value needs to be a float but it is getting a number. I’m not sure how to fix this.
That is how you template a float.
Since you didn’t give us more than that then we can’t possibly know what is the issue.
We don’t even know what the device is or what value you are trying to set
Edit… You can’t template a device action make it a normal action
Because, by design, a sensor entity’s value is read-only. It’s value is controlled exclusively by its integration.
For example, your phone battery’s charge level would be represent by a sensor entity. It would be unusual to allow manually forcing the sensor’s value to be anything other than the battery’s true value. That’s why there’s no dedicated sensor.set_value action.
Zigbee2MQTT acts as a translator, converting a physical device’s parameters into MQTT topics and payloads. Those payloads can be used any number of different ways (not just by Home Assistant) so it allows you to change them.