Earlier today I discovered my garage door was open. I went to bed about 1:30 am and it was opened (by ???) at 3:02 am and remained that way until I happened to notice in HA it was open (working from home all day) so I closed it. A little while ago, I took the garbage out and tapped the garage door opener to open the door, then tapped it to close the door and returned to my desk. I then looked up a contact on my phone to complete an online form and heard the garage door open. I went to HA and closed it then looked at logbook…
I have an automation to announce on Alexa all devices if I am home and if the garage door has been open for 20 minutes but I did not hear that at 3:20 am last night. I modified it to wait another 2 minutes and if the door is still open to toggle the mimolite but that automation was not triggered just now as it was less than 20 minutes since opening/closing it to take out the garbage…
No idea what triggered the mimolite switch…
Short of the MIMOlite malfunctioning and causing the door to open and close on its own I would suggest opening that entity and see what all is related to it - you may find there is a script or automation that is getting triggered and causing it to open on you.
For example, looking here I can see I have two automations for my door, if I was having problems I could drill into those and debug:
If you’re on an up to date home assistant, then you’d see who did it with a ‘by XYZ’ in the logbook. Seeing that the context is missing from the logbook, you either have an older version of HA or the signal came from the device itself.
You said you’re running OpenZwave (standalone), how is it connected to HA?
It might also be that the door is being opened by a garage door opener remote control, perhaps another person in your neighborhood has a door with the same code, or your opener remote is malfunctioning or needs new batteries. You could try clearing all codes from your garage door opener and re-pair your remotes to re-code them.
That’s a possibility too, thanks.
My ex had trouble with one of her doors spontaneously opening. Tried everything…in the end she just left it unplugged. Recently she got a new opener…
The option instructs Home Assistant to publish payloads to command_topic as retained messages. It means when Home Assistant sends a command to open the door, that command is stored on the MQTT Broker.
Let’s say the OpenZwave integration disconnects from the MQTT Broker. When it reconnects, it re-subscribes to all topics. If any of those topics contain a stored payload, and they will if they were published as retained messages, that payload is passed to the device. In other words, the last command Home Assistant published to command_topic is immediately received by the device. If the last command was to open the door, that’s what the device will do.
If you search this forum, you’ll find other examples of ‘spooky behavior’ where lights, switches, and garage doors activated themselves in the wee hours of the night. Most often it’s because the command was published as a retained message and the device disconnected/re-connected.
As a rule of thumb, it’s best to avoid publishing a command as a retained message. Conversely, it’s useful if a device publishes its status as a retained message.
To fix the problem, you need to:
Set retain: false
Restart Home Assistant
Purge the retained message
An easy way to purge a retained message is directly from Home Assistant as described here:
The impetus for creating the cover entity was Alexa. It needed to be cover.garage_door_opener so that device_class: could be garage.
Is yours defined under cover: or sensor: ?
I originally tried code like that in my covers.yaml but HA complained about something…
I retried my code and the message was about toggle. I don’t know why I had it there…likely a copy/paste from somewhere.
This code works:
You’re welcome. After making the change and restarting Home Assistant, don’t overlook to purge the existing retained message as described in the link. That’s an important step to erase whatever is already there.
I’ve changed config from MQTT cover to a templated cover, HA restarted, old MQTT entity deleted from HA, topic purged via HA service (although I likely could have just deleted the topic via MQTT Explorer as that seems to have been the result of the HA servcie call) and deleted the old entity from Alexa. Hopefully no more ghosts at 3am checking out my precious garage junk!
I first configured he Alexa Smart Home Skill. I’ve since enabled NabuCasa and I rather like it’s UI to immediately expose/hide entities/domains rather than having to edit yaml and restart HA when there were changes to be made. I’ve got 9 days left on the 30-day trial…
Make a user/person named Alexa. When you sign into home assistant via the alexa app, use that log in. Then your logbook will let you know that Alexa performed actions.
Well that’s certainly another way to circumvent the whole retain: true issue.
I didn’t realize you had MQTT Explorer, otherwise I would have suggested it because it makes purging a retained message a trivial task. Anyway, now you know the mechanics of it and that it can be done from any MQTT client.
Let us know if you get any more unsolicited openings of the garage door.