Opengarage automation at sunset not working

Anyone spot an error here? Doesn’t seem to work.

automation:
  - alias: "Close Garage Door if open after sunset"
    trigger:
      - platform: sun
        event: 'sunset'
        offset: '00:30:00'
    condition:
      - condition: state
        entity_id: cover.garage
        state: 'Open'
    action:
      - service: cover.close_cover
        entity_id: cover.garage
      - service: tts.google_say
        entity_id:
          - media_player.kitchen_home
          - media_player.gaming_room_home
        data_template:
          message: "Buggar. The garage door was left open so I just closed it four you"

My cover.garage states are ‘closed’ and ‘open’.
Change the uppercase ‘O’ to lowercase.

I always refer to the states page <> under developer tools if I’m not sure

Thanks, I’ll try that. I used the template editor and put {{states('sensor.garage_status')}} and it reported Closed so thought it was capitalised. But your right, it shows as open/closed in the states panel!

sensor.garage_status and cover.garage are two separate entities that might return different states.

Yes, you are correct @jivesinger and that has caught me out! Thanks for your help.

@jivesinger
You had any issues with the state reguraly reporting as unknown even though the WiFi is good?

image

image

Is that only after a reboot of HA or randomly ?

Randomly. Doing a ping test reveals how unreliable it it. Going to downgrade to 1.0.7 to see what happens.

image

FYI, I’ve changed the power supply from 5.1V/1A to 5.1V/2.5A and it seems to be more reliable. 1A should be plenty but the ping results are far more reliable on a dedicated Raspberry Pi power supply.