Automation - today it shouldn't work

Hi
I have the following automation to close a cover if it is sunny outside.
Today my the 2 weather conditions were

value_template: {{states('sensor.open_weather_weather')}}  = value_template: scattered clouds

value_template: {{states('sensor.open_weather_condition')}} = value_template: partlycloudy

openweather

However today although it was not sunny at all the cover closed.
Whats wrong with the conditions?

# Close Erker Cover 2  ******************************************************************
- id: Close Erker Cover 2
  alias: Close Erker Cover 2
  trigger:
    - platform: template
      value_template: "{{ state_attr('sun.sun', 'azimuth') > (states.sensor.my_azimuth_sensor.state | int) }}"
  condition:
    condition: and
    conditions:
      - condition: state
        entity_id: input_boolean.summer_close_covers
        state: 'off'
      - condition: or
        conditions:
        - condition: template
          value_template: "{{states('weather.home') != sunny}}"
        - condition: state
          entity_id: sensor.open_weather_weather
          state: 'few clouds'
        - condition: state
          entity_id: sensor.open_weather_weather
          state: 'clear sky'
  action:
    - service: cover.close_cover
      entity_id: cover.50758014840d8e91f036 # erker
    - service: input_boolean.turn_on
      entity_id: input_boolean.summer_close_covers
    - delay: 
         seconds: '7'
    - service: cover.stop_cover
      entity_id: cover.50758014840d8e91f036

I reckon It matched the first condition:

 - condition: template
   value_template: "{{states('weather.home') != sunny}}"

If your weather.home is not equal to ‘sunny’ (so any option other than ‘sunny’) then it will equal true and run the automation.

1 Like

I think you want

value_template: "{{states('weather.home') == 'sunny' }}"

That’s the problem. I understood wrong the true or false cases.
I need

value_template: "{{states('weather.home') == 'sunny' }}"

Or…

- condition: state
  entity_id: weather.home
  state: 'sunny'
2 Likes

@jivesinger

Hi
Is there a way to add to my card the weather home state? I tried the following but it isn’t working as I need.