Always wanted to have my alarm clock be an indicator to set of things in the house, during wakeup and when i start to sleep and set the alarm.
There are 2 options now.
Sleep Cycle
First you need to stop using your normal alarm clock (this can be a dealbreaker for some already) and start using Sleep Cycle once you got it you also need to buy the premium (This is your only cost part)
You also need to have a Philips Hue setup because this is hooked up to your HA system. Since i don’t have any Philips Hue i used the emulated version. It is important that you set it to port 80 otherwise it will NOT work. So do some magic if that port is already in use Also it might be wise just to expose only your lights. You end up with a simple setup like:
emulated_hue:
listen_port: 80
exposed_domains:
- light
Next up is that you want to have some dummy lights that you can trigger. Ofcourse you can choose a dimmer in your room to dim the lights when you go to sleep but i just want to be notified. We can use the template for it.
light:
- platform: template
lights:
erik_sleep_lights:
friendly_name: "Erik sensor slaap"
turn_on:
- service: input_select.select_option
data_template:
entity_id: input_select.erik_status_dropdown
option: 'Just Awake'
turn_off:
- service: input_select.select_option
data_template:
entity_id: input_select.erik_status_dropdown
option: 'Sleeping'
vio_sleep_lights:
friendly_name: "Vio sensor slaap"
turn_on:
- service: input_select.select_option
data_template:
entity_id: input_select.vio_status_dropdown
option: 'Just Awake'
turn_off:
- service: input_select.select_option
data_template:
entity_id: input_select.vio_status_dropdown
option: 'Sleeping'
In this example the Wife & me can use the app and if someone goes to bed and set the alarm it will place it to “Sleeping” and during wake up in the morning it will be “Just awake” i have multiple options in my input dropdown to keep it simple for myself.
Then in the Sleep Cycle app under premium you need to select that light. (Erik sensor slaap)
If you click on the light it will just give you a list of all devices, just select the one you need.
That should pretty much do it, so again. You don’t need a emulated if you have Philips Hue already in your system. (But i have not tested that kind of setup, since i don’t have it)
The reason this only works for iOS is that the Android does not support this function, i presume it is in the making. This is the only working option i have found in iOS to work. For Android there are other means to get the alarm i believe but i don’t have android.
iOS Shortcuts
This was brought under attention of SalkinDK, who mentioned another solution. iOS has an app called Shortcuts. You can download that for free from the appstore and if you have the Home Asistant app it will work to trigger alarms from your alarm clock.
Setup is a bit simpler but it cannot trigger when you set your alarm. It does however allow you to trigger when you snooze. See examples below.
I have both possible options now set, when i snooze and when i wakeup. The “wake-up” alarm works for my “bedtime” alarm, but you can also select a specific alarm.
For each of these items you have to add the triggers:
And those needs some actual data:
You can add a dictionary as pointed out on the forums and docs i believe, it must be the first item and you can then link that in your service data.
End result
-
Sleep cycle
Costs a few bucks but gets your also some nice features and ‘better’ wake up times accorindg to their promo’s. Can not trigger on snooze, but does on wakeup and when you sleep / set your phone away. -
Shortcuts
Costs nothing, easy to setup. No emulated Hue needed. Does not trigger when you set your alarm / set your phone away. But can trigger also on snooze when you wakeup.
So both have their pro’s and cons. Sadly you cannot combine them but the wakup was the most important one for me.