Report current temperature help

Hi,

This is probably a very simple answer but I cant seem to find the information I need. I have successfully linked my Nest Thermostat to HA. What I would like to do next is have HA upload the current Temperature to MQTT periodically. I am using the Automation page of HA, I have figured out how to set the time interval and can publish to MQTT, what I can’t figure out is how to format the Action Payload to output the temperature.
I have tried the following…

But this just publishes the string climate.hallway.current_temperature instead of the actual temperature.

I’d appreciate any advice on how to output the actual temperature

First tick the box that says Payload template, not Payload.
Then put this in it:

{{ state_attr('climate.hallway','current_temperature') }}

Use the developer tools > template editor page, to test how templates work and:

For more information.

Use Payload Template

ahh thank you so much - it works now

You need to put it in quotes

"{{ state_attr('climate.hallway','current_temperature') }}"

Or you need to do it like this:

payload_template: >
  {{ state_attr('climate.hallway','current_temperature') }}

(in the YAML code, rather than the GUI)

You don’t get a screen like this ?

I was missing the quotes - it’s working now, thank you everyone

1 Like