A couple have asked about using the MonoPrice Garage Door Tilt Sensors in HA. This is my current setup. If you have any questions let me know.
I added these Monoprice Garage Door Tilt Sensor to my garage doors -> https://www.monoprice.com/product?p_id=11987 I use them for triggering lights within the garage when returning home at night and then also run a script that has a delay built in to turn them off after a specific time and lock the door once the Garage Door has been closed. The delay allows time for exiting the car and getting into the house before shutting down the lights and locking the door. The config setup for the template,notification, lights and script is below as well as how the card looks in the UI.
sensor 8:
platform: template
sensors:
gd1:
friendly_name: "Garage 1"
value_template: "{% if states.sensor.vision_zg8101_garage_door_detector_alarm_level_10.state == '255' %}opened{% elif states.sensor.vision_zg8101_garage_door_detector_alarm_level_10.state == '0' %}closed{% endif %}"
garagedoor_delay:
alias: Garage Door Light Off Delay
sequence:
- delay:
minutes: 3
- service: homeassistant.turn_off
data:
entity_id:
- switch.ge_45609_onoff_relay_switch_switch_12
- alias: Turn Off Garage Lights After Delay
trigger:
- platform: state
entity_id: sensor.vision_zg8101_garage_door_detector_alarm_level_10
from: '255'
to: '0'
- platform: state
entity_id: sensor.vision_zg8101_garage_door_detector_alarm_level_11
from: '255'
to: '0'
condition:
- condition: state
entity_id: sensor.vision_zg8101_garage_door_detector_alarm_level_10
state: '0'
- condition: state
entity_id: sensor.vision_zg8101_garage_door_detector_alarm_level_11
state: '0'
action:
service: script.turn_on
entity_id: script.garagedoor_delay
- alias: Turn on Garage Light When Garage Doors Open
condition:
condition: or
conditions:
- condition: time
before: "07:00"
- condition: time
after: "18:00"
trigger:
- platform: state
entity_id: sensor.vision_zg8101_garage_door_detector_alarm_level_10
from: '0'
to: '255'
- platform: state
entity_id: sensor.vision_zg8101_garage_door_detector_alarm_level_11
from: '0'
to: '255'
action:
service: homeassistant.turn_on
entity_id: switch.ge_45609_onoff_relay_switch_switch_12
- alias: Garage Door 1 Open
condition:
condition: or
conditions:
- condition: time
before: "05:00"
- condition: time
after: "20:00"
trigger:
- platform: state
entity_id: sensor.vision_zg8101_garage_door_detector_alarm_level_10
from: '0'
to: '255'
for:
minutes: 15
action:
service: notify.mypushbullet
data:
title: "Garage Door 1 Open"
message: Garage Door 1 is Open - Verify if this is correct and it needs to be closed