Notify if outside is cooler than inside if aircon is running. Templating issue

Hi,

I would like HA to notify me when the outside temperature is lower than indoor temperature only when the HVAC mode is set to "cooling’. However I cannot get the automation to run properly.

The trigger by itself runs fine, however when I add the condition, it does not work anymore. Is it because I have templates in both trigger and condition?

Thanks

  trigger:
    platform: template
    value_template: >
      {{ states('sensor.temperature_9')|float>state_attr('weather.home', 'temperature')|float }}
  condition:
    - condition: template
      value_template: >
        {{ state_attr('climate.bedroom_ac', 'hvac_action' == "cooling" }}
  action:
    - service: notify.mobile_app_pongnote9
      data:
        title: The weather is cooler outside
        message: Consider turning off the AC and opening the windows.

Closing ‘)’ missing after ‘hvac_action’.

1 Like

Thanks @m0wlheld !

1 Like