Summary: I wanted to exploit the alarm time on my phone as a variable for automations. The key is being able to perform actions before the alarm. This is a carry over from an old lounge thread. Lots of approaches, but none was exactly what I wanted.
Tools Used:
- Tasker (I literally downloaded it yesterday for this specific purpose)
- webCore (other native HE tools should work similarly)
- SharpTools (entirely optional HMI; native dashboard should work similarly)
Step 0: In webCoRE, create a new piston to accept the time data. The External URL link will be needed later. Note that I created a Hub Variable to store the time. Another variable stores the time as a string, which just makes it easier to display for HMI.
Step 1: In Tasker, create a new Profile that triggers when the Alarm Changed and sends the next alarm time to webCore.
Step 1 screenshots
I used a variable to store the next alarm time ("%alarmNextTime"), but most people can skip that extra step and just send "%na_time". I used the variable for troubleshooting and may have some future uses.
Step 2: Do stuff. I already had a piston that gently ramped up a bedside lamp before my alarm, but the time had to be manually adjusted. Now, the Hub Variable updates each time the phone alarm changes.
Step 3+: Streamline and improve
Future Musings
- Consider other rules that are better when based on pre-alarm timing (thermostat?).
- Add logic that checks for the day of the next alarm ("%na_day"), so my piston doesn't automatically assume that I am getting up early on weekdays.
- Possibly add bi-directional capabilities in my SharpTools dashboard. It currently displays my next alarm, but I may add the ability to set or change alarms from the dashboard. Not sure.