We’ve got a basement door that we sometimes forget to lock up. I’ve searched far and wide and the consensus seems to be that there is no sensor (except some homebrewed magnetic strips or smart door locks which I don’t want) that can easily detect if a door is actually locked instead of simple closed shut.
So I want to create the following simple automation:
IF the basement door sensor has changed state from closed to open at any time in on that day, send mobile notification at 21:00 to mobile phones saying “Basement door has been opened today. Check if it has been actually locked!”
The “if sensor changed from closed->open, send notification” part is easy, I’m trying to figure out how to delay the message to a certain time and check for this state change in certain periods (so not just in the last 24 hours, but from 00:00 to 24:00 of any given day)
Did you ever find a solution for this? I have a very similar situation - I want a notification at a certain time if any of a few doors opened throughout the day.
I can think of a few clunky solutions for this - possibly a helper that gets turned on whenever the door opens, and then the notification automation turns it back off at the end of the day. Or maybe a counter so I know how many times it was opened. Or maybe a SQL query to check state history. But I’ve not found a simple clean solution so far.
I’ve asked around and that’s essentially exactly how I solved it: created a boolean helper “BasementDoorOpenedToday” and 3 automations: first one sets this helper to ON when the sensor’s state changes to open, second one reset this helper to OFF in the night, and third sends checks in the evening if the boolean helper is ON, if yes then sends a reminder notification to mobile phones to check the basement door as it has been opened today
I ended up building the following automation, which is very similar to your approach and I’m reasonably happy with it. The notification template could be improved a bit, but it gets the message across. I created an input counter for each of the 3 doors I’m tracking. By using choose: in combination with trigger ids I was able to do everything in a single automation.