#Automation triggered by alarm going off on android phone. How?

1 messages · Page 1 of 1 (latest)

molten dagger
#

Use case:

  1. Two users have android phones, which they use as their alarm clocks.
  2. The alarm is set to differnt hours on different days, there is no ahead-of-time-pattern.
  3. When either android alarm rings, it should trigger an automation. Roll up the shutters, turn on the light, play doom music at 100% volume
  4. No specific requirements as to the alarm app used
    How do I achieve the effect where the android alarm triggering, also triggers the automation? Note that the Android device is the master, HA is a slave and receives the signal. There is no guarantee the signal comes.
dreamy cipher
#

Rather than alarm time, what about charging status? You might be able to do something with Tasker on the phone itself, but charging status happens in the companion app itself.

molten dagger
#

Risky. Loose charging cable and it's playing Rip&Tear at 3AM. Also precludes the use of the charger as a non-alarm charger.

dreamy cipher
#

The only thing I can think of then would be something like Tasker that triggers a webhook in HA.

#

Or maybe some clever conditions in the automation for times when the alarms should never trigger maybe.

molten dagger
#

that code would be too clever. As a fallback I can always fork some existing OS alarm app and add some sort of inter-task-message to HA companion. Failing that, shove an API key into it and have it explicitly REST into HA on alarm trigger

dreamy cipher
#

Yup. Rest or webhook (I’d go with a webhook myself as it’s easy to trigger an automation on).

#

Or, get yourself some bed presence sensors ;). That’s currently what I use. When I get out of bed after being in bed for x hours, trigger an automation.

molten dagger
#

inversion of control. I don't get out of bed to trigger the automation. The automation makes me leave the bed. 🙂

dreamy cipher
#

Ahhhhh, ok. I see what you mean now. Yeah, you’ll probably have to go the custom route.

molten dagger
#

thx, I'll see what's the cheapest way to add a webhook to an android alarm

dreamy cipher
molten dagger
#

or this, has webhooks

#

both apps are paid though

floral bough
#

we have a next alarm sensor that updates as soon as the alarm changes

#

you can set up the automations to trigger when the date is reached

#

sleep as android is also excellent...it allows you to differentiate between snooze and dismiss events if thats important

#

for ths particular use case i thnk the android apps next alarm sensor should give you what you need fo the automatoin trigger

molten dagger
#

I did try that, though getting some funky alarm values not lining up with what alarms the device has actually enabled or configured&disabled

#

sleep as android seems to be the best option as it exposes webhooks along with tracking individual alarms

floral bough
#

samsung for example will use the alarm api for teh calendar app

molten dagger
#

good point, I was wondering what the whitelist was for

floral bough
#

but sleep as android is far more granular in some aspects

#

the next alarm sensor only tells yu the time of hte alarm, sleep as android will tell you when the notification posts, when the alarm is physically going off etc...

molten dagger
#

yep, it offers the exact functionality I'm looking for. I don't want "give dog pill" alarm to start strobing the bedroom to the tne of Doom Hunted.

floral bough
#

yea thats another issue the standard android API the sensor uses doesnt get the label the user sets 😦

#

personally i use sleep as android since i like certain things to happen when i dismiss the alarm specifically

molten dagger
#

on the other hand, there's something I find offensive in paying for an alarm clock, feature rich as it may be. Not sure if it's the kind of app you do after or before calculator, but there ought to be an OS alternative

#

You are right though, it appears right now the solution is either Wake As Android or something extremely obscure

floral bough
#

well they do much more than an alarm clock, the app can detect REM sleep and snoring etc....its really more a sleep monitor app that includes an alarm if you ask me lol

#

but yea nothing else integrates with everything or comes close in terms of features....at the time i paid $5 and used my google opinino rewards credit i have accumulated to pay for it lol

#

i get surveys all th etime so i never pay for apps 😛

misty patrol
molten dagger
#

I'll give it a shot with the whitelist