Device goes unavailable fix requested

HI all, My current setup is when the garage door controller states open, my google home says it is open, and visa versa when it closes.
However, on occasion, my automation jumps straight to the action after is was “unavailable”, so if it’s open, then becomes “unavailable”, google home will say “garage doo is opening”. This is becoming more and more annoying.
Is there something I can add to condition to stop this? such as “if device wasnt unavailable” then continue?

alias: If garage door close
description: if garage door close
trigger:
  - platform: device
    device_id: 5f20f9f57dd64a741a8b5cb9e6abab93
    domain: cover
    entity_id: cover.garage_door_door
    type: closed
condition: []
action:
  - service: tts.speak
    data:
      cache: true
      media_player_entity_id: media_player.kitchen_speaker
      message: closing garage door
    target:
      entity_id: tts.google_en_com_au
mode: single

Change the trigger to a state trigger and specify the from and to states. e.g. This will not trigger when the state changes from unavailable to closed, or closed to unavailable. Only open to closed.

alias: If garage door close
description: if garage door close
trigger:
  - platform: state
    entity_id: cover.garage_door_door
    from: 'open'
    to: 'closed'
condition: []
action:
  - service: tts.speak
    data:
      cache: true
      media_player_entity_id: media_player.kitchen_speaker
      message: closing garage door
    target:
      entity_id: tts.google_en_com_au
mode: single
2 Likes