Hi All,
I’m controlling my automatic driveway gates from HA via an RPi Zero W running a custom Python script.
The script (and a bit of custom hardware) uses RPi.GPIO to sense gate state information from and to initiate gate movement commands to the (dumb) gate controller hardware.
It uses paho-mqtt to publish gate status information and subscribes to gate control commands to my MQTT broker. My HA installation connects to the same MQTT broker.
This all works well via my HA front end (on PC, tablet and phone) and with Alexa (currently via Nabu Casa) so I can command my gates via my home Alexa smart speakers.
My car (Volvo) has support for Google Assistant, I was hoping to be able to control the gates via
this voice assistant too. Howwever I’ve run into a bit of a problem.
As far as I can tell, to interface HA to Google Asistant I need to present my gates in a ‘Cover Domain’.
The gate behavior is quite similar to expected behavious of a ‘cover’ but there are a couple of wrinkles I cant seem to see how to overcome.
-
Cover states vs my Gate states. Covers can be in one of 6 states “Unknown”, “Unavailable”, “Open”, “Closed”, “Opening” and “Closing”. My gates have an extra state “Ajar” (see below) caused by the way my gates can be commanded to move, which is the second problem. I dont know how to map this extra state - yes “Ajar” is technically “Open” just not fully open! I have contact switches on the fully open and fully closed positions of my gates so I know when they are truly open (or closed).
-
My gates are controlled by the action of a single button (on either the remote control or the physical switch by the gate - that’s the hardware I override with my RPi hardware to effect control). This button effectively cyles thru 4 actions. “Start Opening”->“Stop Opening”->“Start Closing”->“Stop Closing” on each key press. Thus I can start the gates opening with a key press and then stop them with the next press of the button - leaving them “Ajar” (neither fully open or fully closed). The next press of the button will start them clsing again.
I think the cover domain is designed for a device that has separate buttons for closing and opening. Thus you can always guarantee to intiate closing by pressing the closing button. I cant do that nor can I guarantee mimicing that IMO.
Advice on how I can create some entities in HA to allow control of my gates via HA and google assistant would be much appreciated.
BTW I am based in the UK and I’m not interested in replacing my ‘dumb’ gate controller with some more sophisticated ‘smart’ driveway gate controller.
Thx again!