Extract data from climate entity

Hi, In an automation script i am trying to set a input number with the temperature from an climate entity (caller heater).

To take a number from an input number i would use: ‘{{states.sensor.heating_target_temperature.state}}’

So i would assume i would use ‘{{states.climate.heater.temperature}}’ to use the current temperature of the heater, but this does not work. I have tried many variation, but with no joy.

Any help would be great.

Cheers

It’ll be something like {{states.climate.heater.attributes.temperature}}

At least in my case (a Nest Thermostat), the temperature attribute is the target temperature, whereas current_temperature is, well, the current temperature. :slight_smile:

So, assuming you want current temperature, you can do as @bradyn12 suggested, and use '{{ states.climate.heater.attributes.current_temperature }}', or you could use '{{ state_attr("climate.heater", "current_temperature") }}'.

1 Like

Great, thanks for your help, Works perfectly!

1 Like

How to get the current State whether Heat, Cool or Off state?

First ignore all the above - they should be using states(device) or state_attr(device,attribute)

If you want the current state of a climate entity it is states('climate.my_climate_device') if you want to know if it is ACTUALLY heating or cooling rather than just what state it is in that’s state_attr('climate.my_climate_device','hvac_action')

1 Like