I am currently using GarHAge for controlling two garage doors. Everything is working well from HA and using Google Assistant voice commands.
The only issue is, if the door is open and I ask google to open the door, it sends the command and closes the door. I would like to prevent the door from closing if the open command is issued. Below is the code I currently have setup in the configuration.yaml.
Any help would be greatly appreciated to solve this issue.
Thanks.
I think that it’s because you have your MQTT covers exposed to Google (via Nabu Casa I assume?) and so you never go near those templates. I would create some template covers that trigger the doors only under the correct conditions, and hide the MQTT covers from Google / Nabu Casa, while exposing template covers with appropriate names.
This is the part that I am unsure of ,to create separate template cover and properly configure it. I have been looking around and not really finding a solution.
Have a look a template sensors (which you probably have).
Your best bet is to use the first example in that page, and then look at the script page to understand how to test the state of the door and issue actions according to the current state. Your script would only execute the close_cover or open_cover service if appropriate.
I have gone through and revised my config and added the script. It still works the same as before and will tell me the state for the door if asked.
When issuing door open or closed commands it still doesn’t taking into account the position of the door determined by location of reed switch. I would like it to prevent the following from happening :
eg. Door open + Door open command = door closing , door closed + door close command = door opening.
I would like google to tell me that the door is already open and not do a thing and vice vera if the door is closed.
garage_door_open:
alias: Garage Door Open
sequence:
- service: cover.open_cover
entity_id: cover.garage_door_1
- condition: state
entity_id: binary_sensor.garage_door_1
state: open
mode: single
garage_door_close:
alias: Garage Door Close
sequence:
- service: cover.close_cover
entity_id: cover.garage_door_1
- condition: state
entity_id: binary_sensor.garage_door_1
state: closed
mode: single
garage_door_do_nothing:
alias: Garage Door Do Nothing
sequence:
- condition: state
entity_id: cover.garage_door_1
state: 'off'
mode: single
You need to rename your MQTT cover to something obscure, also hide it from Google Assistant using “Configuration | Home Assistant | Google Assistant | Manage Entities”. Otherwise when you are trying to close the door or open it with Google it’s just going to use the matching cover i.e. “Hey Google, Close Garage Door 1” will trigger the MQTT cover and not your templates.
Now rename the template covers “Garage Door 1” and “Garage Door 2” and make sure the entities are exposed to Google.
Once you have done that you can start debugging your template and scripts if necessary.