I wanted to trigger the wake up based on a schedule. For now I dont need any fancy UI.
What I did is make use of the Schedule helper integration:
This helper has an attribute next_event which can be used to trigger the wake up automation. However, next_event is an attribute and not of device_class: timestamp. With a template sensor you can convert the timestamp:
I have also strange problem with Ikea gateway and bulbs. This blueprint turns light on and then immediately off. So if automation based on this runs, end result is light turning off even if light is on before.
And for some reason it also turns light off if I try to start the light with automation bit after the wake-up automation has started.
History from the light:
07.05.00 - Turned on (wake up light automation)
07.05.00 - Turned off (wake up light automation)
07.05.10 - Turned on (automation to turn on the bulb after wake up light is running)
07.05.12 - Turned off (wake up light automation)
Edit: and I’ve searched the code and there should be only turn on -stuff in there so this is pretty mysterious…
I’ll reply to myself. It seems to be the blueprint sending mireds to the light that causes Ikea lamp to turn off. Any color_temp below 2200 will shut the lamp down.
I’ll try to modify updated version that fixes this one for IKEA lights today, no promises etc. Will edit this post if I succeed.
Thank you for the reply.
I was middeling a bit with this code already but I was setting up a new server so did’t figure it out yet.
I tried the code you posted earlier but I still cannot get it to work.
I saw that you where stil editing the code.
When I copy past the code I get Message malformed: required key not provided @ data[‘action’].
i will look into I a bit more (iam still a newbie when it comes to coding), maybe you can point me in the right direction
Sorry about that, I am currently trying to figure out also fix for Ikea lights and this is why my gist is currently not functional. Running tests currently and I can let you know when I get it at least somewhat working.
Or you can start by creating a github account if you don’t already have one, fork the original gist and edit your own version in browser and use your own version of the blueprint
I think I got my version working and sending Kelvins instead of mireds. But no luck, still same behaviour. Needs further investigation at some point.
Something that caught my eye, translated so it will not be fully accurate in english:
Turned off by automation “Wake-up light alarm with sunrise effect” executed because of time pattern
Sorry, you should not use my gist for time being, it will not help and might cause further issues.
This is bit embarassing, but I found something potentially useful when staring again the code:
description: ‘The brightness to start with. Some lights ignore very low values
and may turn on with full brightness instead!’
But actually this was the thing causing issues with light not turning on at all. So the description should be “may turn on with full brightness or turn on and immediately off again” or something similar.
Changed settings to 3 or similar value and now it works! Please forget my gist I linked previously because that is in fully broken state and completely useless.
It will not work… i created the Helper “input_datetime.weckzeit” and the Template-Sensor: “set-wake-up-time”.
The Template-Sensor always says “unavailable”… i tried exactly your code.
Which of the entitys do you use in the Wake-Up-Light-Automation?
Could you show how it lookslike in your Dashboard?
So I’m not using the Template-sensor on the dashboard but the helpers directly. I have also modified the blueprint a bit. I have added a new parameter:
enabled:
name: Boolean for controlling the sunrise
description: If set, checks if entity is 'on' before triggering. Use a boolean.
default: none
selector:
entity:
multiple: false
And modified the second wait-template:
- wait_template: '{{0 < as_timestamp(states(sensor) if sensor != ''none'' else states(''sensor.date'')
~ '' '' ~ manual_time) - as_timestamp(states(''sensor.date_time_iso'')) <= float(seconds)
and states(check_entity) in [''unknown'', ''on'', ''home''] and states(enabled) in [''unknown'', ''on'']}}'
Ok now it works for me. My mistake was that I used an input_datetime with date AND time and not just a Time-Helper. But the problem is now that the sensor will not update the Date until I restart the server…
Hi, I have been using this for 1+ years now, and the concept is great.
But… during the last few months the automation is sometimes not triggered. I had switched to a datetime helper to ease my alarm configuration, and I do not know if that is the cause.
E.g.: I had the automation set to 6h45, it worked. Then changed it to 7h20 last couple of nights, and it did not run. wake up duration is always set to 20 minutes.
I will probably try to go back to manual time, but if it persists I believe I will (sadly) stop using it.
I am using this for some time now, but suddenly this morning it stopped working. I didn’t change anything to the automation. In the trace it says: Stopped because only a single execution is allowed at 16 december 2022 om 09:39:00 (runtime: 0.00 seconds).
I restarted HA and tried again several time but no change