Hi all,
I’m just starting out with home assistant and automation and got myself a few sonoff switches and thanks to AlexxIT’s amazing work with no modding/flashing it’s working great.
My current use case is: I’d like my coffee machine to turn on (simple switch on the relevant sonoff plug) between 06h30 and 08h00 if I’m awake.
I got the conditions in and the reset so it does not trigger more than once per day etc BUT I’m relying on my phone’s Detected Activity
status to trigger the automation’s execution. Basically the phone is usually still and charging until I wake up. When I do I’ll usually have to fiddle with it to turn off the alarm etc. (Btw it’s a Samsung S7 Edge)
Currently I’ve noticed the following possible statuses ‘still’, ‘unknown’, ‘tilting’, ‘walking’ and ‘in_vehicle’ I tried to have the automation trigger when the phone went from ‘still’ -> ‘tilting’. No luck. doing it from ‘still’ -> ‘unknown’ sometimes works sometimes not and quite often is far from instant. For example I tried taking the phone, shaking it while in the home assistant app and looking at the status and it stayed on still…
So barring some PIR motion detector configured to watch my feet touch the ground I’m unsure what the best way is. Also if there is a way to make this work flawlessly using the phone as a trigger.
I also wonder about presence such as detecting that I’m outside the door to open the gate for example. How is that done usually?
Thanks!
Reliable phone updates seem to work against low battery use. So this trade-off usually means you can’t rely on phone sensors for timely updates.
As an alternative, there are many fast acting and reliable “bed sensors” on the forum.
I wonder if these updates can be ‘whitelisted’ while charging
I use Tasker and a webhook to tell HA when a phone is connected or disconnected from power. That covers waking up perfectly since folks usually unplug their phone.
Depends, arriving or leaving? Motion sensors and/or door sensors and/or Bluetooth detection. Motion sensors either side of a door can tell if you’re leaving or arriving based on which tripped first, a door sensor and one motion sensor can do the same.
The truth is that “usually” doesn’t exist. Everybody’s situation is different enough that what works for one (proximity
under 200 meters) doesn’t work for another (main road goes past the house and they’re still 5 minutes away at that point).
May I ask why you don’t use the charging sensor created by the Home Assistant App?
You mean, other than not using the app
Ah I see, this makes sense
I think it also comes down to the power savings feature limiting communication thus delaying significantly any reporting of same.
I wish I knew how to fix that… maybe whitelist the app. Will try that.
@Tinkerer I’m too much of a newb to use webhooks haha. Any guideline? I also need to purchase tasker… wish I did years ago when it was cheaper
Webhook triggers are documented there, and you can use them through the NabuCasa service too.
My Tasker hook automation is here, and fires events with the incoming JSON data so I can use the same hook for multiple things.