I’ve successfully done this to integrate WEMO MAKER, Magnetic Reed and GOOGLE HOME. This solution works well if your garage door using a ‘momentary’ switch configuration. I’m running Home Assistant using HASSBIAN on a Raspberry PI.
First, you need to expose the attributes of the Magnetic Reed that is attached to the Wemo Maker to be it’s own sensor. This way you can use this new sensor to track the state of the Garage Door. Having this sensor available makes it useful to trigger automations as well!
sensor:
- platform: template
sensors:
garage_door_reed:
value_template: '{{ states.switch.garage_door.attributes.sensor_state }}'
friendly_name: 'Garage Door Magnetic Reed'
entity_id: switch.garage_door ###this is the entity id of your wemo maker switch
The next step to to create a template switch that will allow you to turn the Garage Door ON or OFF (i.e. on = Open Garage, off = Close Garage). Use code below:
Note: I have put in conditions that rely on the magnetic reed sensor created above. These conditions aren’t strictly necessary, but they make things work much better when you are using the Google Home. For instance say you’re inside the house and you can’t see your garage door. You tell the Google Home “OK Google, turn off the garage door” to close your garage door. Without the conditions from the Magnetic Reed Sensor if your garage door were already closed this command would open the garage door (not what you want, so use the conditions)
switch:
- platform: template
switches:
garagedoortemplate:
value_template: '{{ states.switch.Garage_Door.attributes.sensor_state == "off" }}'
turn_on:
- condition: state
entity_id: sensor.garage_door_reed
state: 'on'
- service: switch.turn_on
entity_id: switch.garage_door
turn_off:
- condition: state
entity_id: sensor.garage_door_reed
state: 'off'
- service: switch.turn_on
entity_id: switch.garage_door
friendly_name: 'Garage Door'
Next expose your switches to the Google Home by using the emulated Hue component. If you have an Amazon Echo then use that version instead.
Note: Google Home does not work on different ports. Refer to site below to open port 80 on Raspberry Pi https://community.home-assistant.io/t/emulated-hue-and-google-home-stuck-on-pairing-process/7829/7
emulated_hue:
type: google_home
host_ip: 192.168.86.62 ###use your own Raspberry Pi IP address here
listen_port: 80
expose_by_default: true
With all of this done you should have the following:
- Sensor that tracks magnetic reed on your garage door
- A new Garage Door template switch that also knows whether or not the garage is open or not
- Ability to tell Google Home to turn ON (open) or OFF (close) the garage door
Finally you may want to hide your original Wemo switch in HA and also not expose it to the Google Home by adding the following into your “homeassistant:” customize section.
homeassistant:
name: Home
customize:
switch.garage_door: ###use your wemo switch's original entity id
hidden: true
emulated_hue: false