Broadcasting a voice alert when MyQ garage is opened

Hello everyone,

I am pretty new to all of this. I’ve configured all of my light switches, IP cameras, Nest thermostat, and garage door opener working now with toggles and all, but I want to start some automation. Basically, I want my Google Home speakers (clumped together as an “All Speakers” group in the Google Home phone app) to say out loud a message when the garage door (https://www.home-assistant.io/components/cover.myq/) is opened. This is what I have written so far in my configuration.yaml file, but nothing gets broadcasted.

automation:
  - alias: Broadcast message garage door is opened
    trigger:
      - platform: state
        entity_id: cover.Garage_Door_Opener
        from: 'Closed'
        to: 'Open'
    action:
      service: tts.google_say
      entity_id: media_player.All_Speakers
      data:
        message: 'Garage door was opened.'

Has anyone done something similar before, or can spot what’s wrong here? Any help would be greatly appreciated!

The first thing I would check is the capitalization of your entities and states. They have to match the case that they display in the states page.

Which I’m pretty certain is lowercase

The entity_ids are for sure but it’s possible that the actual states might be either way depending on the platform.

The capitalized entities matches my other configurations so I knew that wasn’t the problem. However, I made the “open” and “closed” lowecase and it all works now. I never knew such a simple thing could throw this error. Anyway, thanks everyone for your help!

Will this trigger if there is a state in between? So with MyQ it has closed, then opening, then open. Didn’t look but guessing it’s the same in reverse, open, closing, closed. With the middle mode does closed to open trigger or does it need to be closed to opening or opening to open to trigger?

The automation will not trigger with a state in-between. With that said, you can exclude the from: statement and just have to: