Add to existing automation to speak room temperature value

Hi All
Its probably trivial but I cant figure it out. Ive some tapo temperature sensors and Id like the automation I run as a night time routine to speak the value of the associated bedroom,. Regards Pete

Hi Pete, I guess something like this should work with any of the TTS services

  message: >-
    The temperature of bedroom 1 is {{ states('sensor.your_sensor_here') | round(0) }} ° celcius/fahrenheit.

Hi Nick Probably dong something wrong here, I`m getting Error: Error rendering data template: UndefinedError: ‘sensor’ is undefined
My sensor is sensor.front_Bedroom_t-h-temperature giving states(sensor.front_bedroom_t_h_temperature)

You need to add the quotes.
Best way to see if it’s correct is to test it in Developer tools → TEMPLATE

Open your Home Assistant instance and show your template developer tools.

Completely functional now! . I’ve ended up with the following: states(‘sensor.front_bedroom_t_h_temperature’) | round(1) }} degrees centigrade
Many thanks

1 Like