Sunrise Simulated Wakeup Alarm

I created an automation that simulates a sunrise for the dark mornings we are having. I used an input boolean to enable the mode for each person. I then start with a dim red light, transition to orange, then yellow and back to soft white. Takes over 5 minutes of transition.

  • input boolean to enable
  • input datetime to set the time for wakeup
  • color light bulb lamp

HA Automation - https://github.com/mcaminiti/homeassistant/blob/ed65e8c789b08cc8061dbb4e36642333e61aeff9/automation/wakeup.yaml

7 Likes

Thank you for sharing!!

I’m going to use it as well!! :slight_smile:

1 Like

Can you say what kind of bulb you used for this? I have a lampUX bulb from Amazon, with the Tuya integration, but it does not take transition.

I used a Phillips Hue bulb. You will want to view the developer state and see all the supported modes for your bulb. You may have to do more changes to simulate the transitions.

Hi, complete HA beginner here. If i want to implement this automation with my Yeelight, do i just copy and paste your code into my config.yaml and change the entity ID of the lights? Or is there more to it? Sorry for the stupid question, i’m only just getting started with this

Rama,

I have my code split into separate files. If you go to my GitHub you can see I use includes at the bottom for things like input_booleans and automations I have it include a folder and I place automations in that folder.

So for you to have this work in a new setup you can place it in your configuration file but you need a few sections:

  1. You need to have an input_boolean created to allow the toggle for turning on and off the alarm.
input_boolean:
  USER2_wakeup:
    name: USER2 Wakeup
    icon: mdi:weather-sunset-up
  1. You need to create an input_datetime so you have a way to set the time of the alarm from Lovelace.
input_datetime:
  USER2_wakeup_time:
    name: USER2 Wakeup Time
    has_date: false
    has_time: true
  1. You will need the automation for one of the users.
    Then you would need to create an automation using the link above as an example and referencing the input boolean you created. The input_boolean is just a fake on / off script in home assistant. You will then need to copy one automation from the example.

Warning, I don’t know what your light supports. Hue lights support color names and transition properties. Other lights may not support this. If not, you may need to add more timing and static percentages of brightness. You can see what your light supports in developer_tools area and looking at the STATE of that light. It will show you available commands I believe.

Looks like Yeelight does support transition, so this should work then for you to do. If you use the GUI for creating automations, you may need to copy and paste the whole thing in as YAML. Not sure if all the settings can be built in the automation builder. I have not used it enough to know.

Ok thanks, i didn’t know i was able to access your other YAML files on github but once i added the input boolean and input datetime, the automation seems to work now. Last question, how did you get the lovelace interface to show the cards on the front page. I can’t seem to find your code for this (in my config it’s set up in a seperate YAML file called ui-interface.yaml)

Here is an example card. I just used the Lovelace editor to make the cards.

entities:
  - entity: input_boolean.user1_wakeup
  - entity: input_datetime.user1_wakeup_time
  - entity: light.user1_bedroom_1
    name: User1 Lamp
show_header_toggle: false
title: User1 Sunrise Alarm
type: entities```
1 Like

Thanks for sharing this!! Just what I was looking for, I’m using 2 of my 4 Lohas RGBW bulbs in my ceiling fan to create the effect.
Just to make a small contribution possibly helping another user. Be sure to add the time sensor to your config.yaml:

sensor:

  - platform: time_date
    display_options:
      - 'time' 
1 Like

Happy this helped someone. I have my full config on my github but agree I should note all the configuration besides the automation. With more integrations and items becoming UI based it will make it harder to share the “setup” aspect.

HI everyone,
I guess I need some explanation from someone smarter ;-):
I run Novostella bulbs (13W) over Tuya.
I have implementer the code - and it works, well… sort of
I starts on the right time, but has problems with finding right color/brightness values.
It either starts with the last color in the evening (instead of ‘blue’, as coded), then the transition is panicky, like it wants to use the white color, but then it finds the right one, but the brightness is off…
Is this a common problem, or just me doing something wrong.
ALSO, what the heck is that transition value, what does it do?
I’d like it to change color/brightness slowly and seamlessly, or am I expecting to much?
Please help,
thank you

The transition is supported by certain bulbs. So for a Phillips hue bulb, which I’m using, it will use that time set to slowly fade and change to the next stage. So if the light was white and you transitioned for 120 seconds to red, it would slowly fade from white to pink to red over that 120 seconds.

I know the tuya bulb integration may not support all the same features. It’s best to go to the developer state area and click on the entity for one of the bulbs and see what supported features you have. You may have to code more manual changes.

Also I’m guessing with some of the features on 115 on automation, this automation might be better optimized for a sequence automation.

As for the odd color changes, that could also be the conversion of color name to color on the bulb. Some bulbs prefer different values to set color.