Smarter automations with dummy switches
The Home app has some frustrating limitations around creating automations or triggering events that don’t require auth from the user.
Apps like Eve allow you to hook into more HomeKit APIs and create automations that can react to more sensors.
What’s missing though is awareness of the automation suite as a whole e.g. overrides, priorities, and general awareness of how a bunch of automations could be modelled as a whole system.
In the mean time we can add some smarts with “Dummy Switches”.
Get smarter with dummy switches
The homebridge “Dummy Switches” plugin is a great tool for bypassing some annoying limitations within the Home App as well as connecting and prioritising automations, scenes, and other sensors.
On their own they’re a virtual switch that exists in your Home app that gives you some useful features.
Bypassing HomeKit Auth
An easy thing to do is setup a stateful dummy switch that can turn off and on based on if people are home or not.
Once that is setup you can do useful automations based on the state of the switch and bypass annoying auth prompts e.g. arming your alarm system can now be automatic.
Since the virtual switch exists within your home network it no longer asks for permission to trigger the automation!
The most useful dummy switches I have are around smoothing out on/off triggering of certain electrical loads such as charging the car, if it’s a cloudy day it could trigger a lot of automations due to the fluctuating energy coming from the solar.
While that isn’t a problem for a smart plug it could be detrimental to a pool pump or some other mechanical device where that could damage it by turning it on and off in short time periods.
To solve this we can use a timed switch, in my case a 30 minute one, to smooth out these automation triggers.
When my solar hits more than 3kW export I turn on my car charger and also trigger a timed dummy switch of 30 minutes. You can read more about how my solar is represented by lightbulbs.
If within that 30 minute window the automation that would normally turn it off fires it first checks if the timed switch is on and bails.
Once the timer is done another automation runs to check if we’re still pulling power from the grid and if so turns off.
Here I’ve used the statelyai visualiser which is a tool for visualising application state but I found it a nice fit to also model my automations too.
Another example is having bypass switches where I don’t want the automation to interfere and I need my car charged regardless of solar availability.
In this case I have another switch that forces the smart plug to on and all the automations around that will check the state of that switch and if it’s on those automation won’t trigger.
Let’s hope with the consolidation onto the matter protocol that we’ll start to see statecharts and smarter modelling of home automation systems so we don’t have to resort to hacks like this.
I’d love to hear how others have utilised dummy switches to make their automation that bit smarter. Let me know on twitter.