

You can use whatever event you want to control the snooze. Important to note that I have used a Philips Hue palette to get notified of the press event. Any smart switch you have will do the trick. I can snooze the alarm from the Companion App on my iPhone or by long pressing a button on the Philips Hue Switch that controls the light I have associated with the alarm.Same thing for the “Increment Brightness” node.The “Increment Volume” will increase the media player volume one step at a time since you will have reached the value defined in the if condition of this node.I am a Spotify user, and I use a Spotify playlist. A node called “Play Spotify Playlist” will let you define what media the selected media player will play on wakeup.I have Sonos speakers and Philips Hue lights all around my house, and this is what I use. You have a node called “Set Flow Variables.” In this node, you can define which media player and light will be used for your alarm clock.Here is what you may want to change to adapt the flow to your needs: When the alarm triggers, it will start the media player with the media content you have defined and start the light procedure. The flow will wait for the alarm time by checking the value of input_datetime.alarm_clock_time each minute. The flow is not one of the most simple, but it is readable in terms of functionality.
#Red alarm music code
The flow code has been “scrubbed” and you should be able to import to your instance without any issue with Servers and so on. The flow code above is available on PasteBin: Alarm Clock Node-RED Flow This is a picture of my node as it is today: Please create a new flow and give it the name you prefer. You will have to have the Node-RED add-on installed on your system.

Ok, that’s all you need to do on your Home Assistant instance. The buttons “Snooze” and “Stop” have two scripts associated with them. There are a couple of Custom Cards in there: mushroom-title-card and button-card. Service: script.turn_on_alarm_clock_snooze entity: input_datetime.alarm_clock_time entity: input_boolean.alarm_clock_on_off You will now need to create a Lovelace card to control the alarm clock. The house_state variable will be “Sleeping” when the alarm is not active and will turn to “Waking Up” when the alarm Node-RED flow is running to wake me up. ( GitHub - snarky-snark/home-assistant-variables at v0.15.0) I have used the home-assistant-variables custom integration. You will also need a variable to control the status of the alarm clock. I set those up in my YAML files, but you can easily do the same thing from the UI (Settings → Devices & Services → Helpers → Create Helper) This is where you will set the time for your alarm clock. If true, the clock is armed and ready to be activated at the right time.Īlarm_clock_snooze: if this is true, we are snoozing. You need to have two input_boolean: alarm_clock_on_off:Īlarm_clock_on_off: this will control the alarm clock. The first thing you will have to do is to implement some helpers to expose on the Lovelace user interface. I started from his Node-RED flow and modified it to suit my needs. It was a great blog, but the author does not post anymore. I copied the idea I found on the DIY Futurism blog a couple of years ago. I have always loved Node-RED, and it is responsive on my system. I decide to take the Node-RED path instead. I found out that implementing those features with native Home Assistant was a little bit of a mess, at least for me. The alarm clock must be controlled with Alex (still to be implemented, actually.).The alarm clock will have a Snooze functionality.The alarm clock will have to play a playlist of gentle and instrumental songs.The alarm clock will have to simulate sunrise in ten minutes.The alarm clock will trigger ten minutes before I set for wake up.
-1-thumb.png)
This is the reason why I designed my alarm clock on Home Assistant. I need some soft music to drive me to the awake state. I also don’t need to listen to any voice in the early morning. I need to wake up gently with a slow process. I wonder why this is one of the most neglected applications on every phone out there, even if it is one of the most used.
