I am new to Home Assistant (previously used HomeSeer). I have a ZEN17 relay that I’m trying to use to as a garage door opener. I can toggle it without issue and have it configured for a momentary contact. How would a card be set up for this through the configuration.yml?
Switch: switch.garage_door_1
Binary sensor 1 (closed when door fully open): binary.sensor.garage_door_1_open
Binary sensor 2 (closed when door is fully closed): binary.sensor.garage_door_1_closed
When sensor 1 goes from closed to open, door is closing
When sensor 2 goes from closed to open, door is opening
When sensor 1 is closed, door is open
When sensor 2 is closed, door is closed
Any help would be greatly appreciated. I found plenty of threads on this topic for one sensor, but none for two.
Thanks for sharing your template. For folks seeing this thread in the future, below is the template I landed on as of May’24. I’m using relay 1 on the ZEN17, and a ZSE43 tilt sensor for open/close state detection.
My ZEN17 is configured as below:
Relay 1 wired as NC for normally closed operation. I want the circuit to be always closed so I still get the usability of the momentary switch that came with my garage door opener. It has a button to turn on the light which I use regularly. Needs to be powered (closed circuit) to work. soon, I’ll install NC magnetic reed switches as redundant close/open detection.
parameters 2 and 3: 11 “On/Off report (Dry contact switch/sensor)”
parameter 7: Relay 1 auto turn-on timer set to 1 second
with this configuration, the relay is on by default in my UI, and when turned off, the ZEN17 turns it back on in 1 second.
Once I add this to my configuration.yaml, how do I make use of it? My old garage door controller code from a couple years ago broke when I upgraded HA so I’m looking for some new code. Not sure how to make use of this. Any tips would be greatly appreciated! TY!
Thank you for this code been looking how to use my zen16 for a while and this was it! i got this all set up and noticed that even when its closed if i tell alexa to close it, it opens it. bypassing the 4 digit code used to open it with voice. is there a way to prevent this? or did i just do it all wrong?
I don’t think you did anything wrong. I don’t use alexa to control my garage door so I never noticed that bug, but it’s a bug. I only use the UI to control my garage. The UI greys out the close button if the garage is already closed.
The template is merely representing a relay + sensor as a cover. commands ‘open’, ‘close’, ‘stop’ are all converted to ‘turn_off’ under the hood.
I’m sure this is fixable in a number of different ways… just not sure how off the top of my head or which is the most elegant.
I did some back and forth with ChatGPT and it suggested adding conditions to the open_cover and close_cover target entity IDs. This way, Home assistant still sends the switch.turn_off service, but if the garage door is already in the desired state, it sends it to an entity_id that doesn’t exist, so nothing happens. That’s what we want.
I haven’t tested this yet in my home, can you try and post back if it works/doesn’t work?
Thank you so much this has been racking my brain for days! it does work with voice assistant and within automations. I need to start using chatgpt for sure. thank you again.
my next quest is using a shelly plus uni to read the differences in voltage that is put out by the obstruction sensors and send a notification that the door didnt go down. should be easy enough. waiting on the uni to get here on monday.
Be careful with this. It was trained on old HA info and may not even get you close to a real answer in many situations as shown by @2carlos needing to change service to action.