Where We Are Going, We Need Dog Mode
If you have read my post on My Three Laws of Home Automation or my two part series on How I Secured my Home Using Home Assistant it won’t be a surprise that I designed my Home Assistant security system around not having to physically interact with it. It simply arms when it needs to based on several different sensors and indirect inputs and disarms the same way. So I have no keypad to press. No secret code to remember and type in. It just does its job without me having to be involved. And if I am being honest there have only been two false positives that caused it to go off when it shouldn’t have.
Well it had been two false positives until recently. It’s now three, and thats why we are here.
<Cue the flashback sound effect…>
It was dark enough outside the rest of the world was at home chasing dreams. I would have been too if it hadn’t been for him. Cold nose, and a bark that could wake the dead. I knew I was in trouble when he woke me.
I glanced at the clock on the nightstand. 3.25am it said in red letters. I look back at the figure next to my bed..staring at me with those brown eyes and that weird toothy grin. It didn’t take me long to understand what he wanted. I was supposed to follow him.
I tossed off the covers and started to move, but before my feet hit the floor he took off like a prisoner given a last minute pardon. I followed like a drunk stumbling through a darken ally afraid one of us wasn’t going to make it in time.
I found him waiting for me in the kitchen. Like a junkie craving his next hit he was bouncing on his feet near the door. The excitement was infectious. Because I pulled open the door without another thought. And that’s when it happened. He pushed me against the open door and ran past out into the cold without another glance.
I stood in the dark kitchen alone with the security alarm going off.
<Dissolve back to the present>
Most people know what I am talking about. Heck I bet its happened to countless other people with home security alarms. Most people just run over, punch in their code, and crisis averted. Well, remember how I said at the beginning of this I don’t have a keypad? The system is built to not need input from me. And most of the time it doesn’t. This night it did. So I ran back to my bedroom, fumbled for my phone, open the Home Assistant app, and hit the alarm kill switch. And as the just awoken people asked what happened I up vowed to come up with a solution.
Sometime before I fell back asleep, I came up with Dog Mode.
It’s super simple in design. It’s just an input boolean that when set tells the security system to not execute a response to an opened door.
In my security package I added the input boolean:
dog_mode:
name: Dog Mode
icon: mdi:dog-side
Then I just added a condition to my security breach automation
- condition: state
entity_id: input_boolean.dog_mode
state: 'off'
This means that the security breach will only fire when dog mode is off.
To activate dog mode we simply need to remember to ask the google home to “activate dog mode” prior to opening the back door. Once I get a motion sensor in the kitchen I’ll eliminate this since it is a violation of the First Law of Home Automation and just activate dog mode when the security system is armed and there is motion near the back door.
Now, I just needed a way to re-arm the security system once the dog is back in. The voice command “Deactivate dog mode” works, but it like the first one is a violation of the First Law of Home Automation not to mention may be easy to forget to do if you are eager to get back to sleep. So I decided to handle this with a simple timer and an automation.
You will find this one in the security.yaml as well.
- id: dog_mode_deactivated
alias: Dog mode Deactivated
initial_state: true
trigger:
- platform: state
entity_id: input_boolean.dog_mode
to: 'on'
action:
- delay:
minutes: 20
- service: input_boolean.turn_off
entity_id: input_boolean.dog_mode
Once Dog mode is activated this automation is triggered. Then after a delay of 20 mins (more than enough time) dog mode is simply turned off without any other input required satisfying the First Law of Home Automation.
I may eventually refactor this to be based on the door opening and closing again, but I will need to do some testing around that. I may also break out the back door on to its own trigger for the security system to ensure that if on of the other doors is open the security system still goes off. That way, dog mode means a would be burglar would have to come in the back door with the dog while the mode is on. But that seems to be a lot of extra complexity for something that whoever is awake at the time will be able to handle.
So there you have it. A super simple way by temporarily bypass the security system to let the dog out to do his business. Of course if the dog would simply go to the bathroom prior to everyone going to bed like a normal person we wouldn’t have had to go through all of this. I’m not ready to tackle that refactor.
Until next time…Go Automate Something.