Google Home ( assistant ) announce my Garage door is still open

Hi Guys

I have two types of door sensors running well on my HA but would like my Google home to announce that I have left my garage door open. May I see your examples, please.
I have Sonoff Bridge and some door sensors & I also have Wyse door sensor that connects to the wyse module plugged into my RPI.

Garage door uses the Wyze door sensor ( starter kit )

Thanks

Thanks

How I accomplished this

First create a sensor:

  - platform: template
    sensors:
      garage_door_currently_open:
        friendly_name: Garage Door State
        value_template: >-
          {% if is_state('binary_sensor.vision_zg8101_garage_door_detector_sensor', 'on') %}
            Open
          {% else %}
            Closed
          {% endif %} 

Then add the automation:

- id: garage_door_open_long
  alias: Garage Door Open For Long Time
  trigger:
  - entity_id: sensor.garage_door_currently_open
    platform: state
    to: Open
    for:
      minutes: 10
  action:
  - service: notify.to_sms
    data:
      message: Garage Door Open for Longer Than 10 Minutes
  - service: tts.picotts_remote_say
    entity_id: media_player.mpd
    data_template:
      message: Garage has been opened for a long time

Obviously modify the sensor used in the sensor template and point to your own tts.

1 Like

Awesome , thanks will try it, appreciate it

You could have put that binary sensor directly in the automation trigger. I don’t see the need for the seperate sensor at all. Especially as you could have applied a device class to it.

- id: garage_door_open_long
  alias: Garage Door Open For Long Time
  trigger:
  - entity_id: binary_sensor.vision_zg8101_garage_door_detector_sensor
    platform: state
    to: 'on'
    for:
      minutes: 10
  action:
  - service: notify.to_sms
    data:
      message: Garage Door Open for Longer Than 10 Minutes
  - service: tts.picotts_remote_say
    entity_id: media_player.mpd
    data_template:
      message: Garage has been opened for a long time
1 Like

You are right it is not necessary however my tilt sensor reports on/off instead of open/closed. I wanted open/closed in the GUI as it just makes things easier to understand at a glance when getting/using values.

1 Like

That’s why I mentioned device class.

Use customize to apply the garage door class to the binary sensor. You get nice icons and open / close states in the front end.

If the sensor is defined in yaml (rather than discovered, or created with the UI) you can add the device class directly to the binary sensor config instead of using customize.

1 Like

This is how i did it using just the automation

- id: '1622072457503'
  alias: Garage door is Open
  description: ''
  trigger:
  - platform: device
    device_id: 5c3e9fcfe2dbc64c77c385c403e0df86
    domain: cover
    entity_id: cover.garage_door
    type: opened
    for:
      hours: 0
      minutes: 20
      seconds: 0
      milliseconds: 0
  condition:
  - condition: device
    device_id: 5c3e9fcfe2dbc64c77c385c403e0df86
    domain: cover
    entity_id: cover.garage_door
    type: is_open
  action:
  - service: tts.google_say
    data:
      entity_id: media_player.announce
      message: Garage dor have been open for 20 minutes!!!
  mode: single
1 Like