I would love to use this. But I set my alarm using a google home speaker at bedside rather than my phone. Is there a way to expose your next alarm on Google to this?
Unfortunately not. I used to have a few triggers based on Google Home alarms and timers but Google removed the ability to expose those features a while back. Too bad, it was very useful.
That’s too bad. It would be nice if I could at least set this up manually at a fixed time 4 days a week. I don’t want to wake up early on weekends/days off of work! Is there a way I could set up an persistent android mobile notification with a button or something to toggle this on/off?
@duckflame I don’t see anything obvisouly wrong in your config. Just check please your timezone is correct if you haven’t already and note that while you have set a timestamp_sensor the manual_time is ignored. Also this automation cannot be triggered using the “Trigger” button on the UI it always needs the timer to be set in order to work.
@nima@jazzyisj
Actually there is a way since I am using this every day but it takes some effort and Linux skills to set this up once (since it is not very well documented) and needs some kind of cronjob to work so with just a HassOS installation it will not work. There is some outline on how to do this here:
This will basically retrieve API tokens for talking to your local Google home from time to time and writes them into a helper variable in HA.
In HA itself you can then define a command-line sensor to poll the next alarm time from the Nest Mini or similar.
sensor:
- platform: command_line
command: 'curl --silent --insecure --header "cast-local-authorization-token: {{ state_attr(''input_text.google_tokens'', ''token_Mini im Schlafzimmer'') }}" https://192.168.x.y:8443/setup/assistant/alarms'
name: Schlafzimmer Wecker
value_template: >
{% set alarms = value_json.alarm|sort(attribute='fire_time') %}
{% if alarms[0] is defined %}
{{ (alarms[0].fire_time / 1000) | timestamp_local }}
{% else %}
Unknown
{% endif %}
I really like your blueprint. The only thing I’m missing is to set target color temperature for light, because now the light is blue after automation is done. I think I am not the only one who would love to see this improvement.
Thank you
First of all, thank you so much for this Blueprint. As a new user to HA, this really helped achieve what I wanted with much ease. I don’t have it trigged via an alarm, just a set time to reach desired max brightness level.
Could you help me clarify one thing though, regarding your comment of this:
{{ 1 <= now().isoweekday() <= 5 }}
I would like to set it to only run between Monday and Friday [work days for me].
Have I done this correctly? Screenshot below
Latest update now brings a minimum brightness and minimum color temperature input.
I have noticed that with my Hue Go since switching from percentage to absolute brightness values it doesn’t react to a brightness of 1 and turns the light on with last known brightness instead (which could be full) which is suboptimal. Also as someone liked to see minimum color temperature you can set this now too (in mired). This setting is 0 by default and practically ignored if you set anything lower than what your light advertises as minimum supported value.
Is it possible to add a home/away option to his automation? So when you’re not at home (sleeping in a hotel or something like that) it doesn’t trigger this automation.
The most recent version of this blueprint gives me the following issue:
Logger: homeassistant.components.automation.wake_up_light_alarm_with_sunrise_effect
Source: components/automation/__init__.py:373
Integration: Automation ([documentation](https://www.home-assistant.io/integrations/automation), [issues](https://github.com/home-assistant/home-assistant/issues?q=is%3Aissue+is%3Aopen+label%3A%22integration%3A+automation%22))
First occurred: 4:54:00 PM (1 occurrences)
Last logged: 4:54:00 PM
Error rendering variables: TypeError: '>' not supported between instances of 'int' and 'NoneType'
edit
I found a reason for the NoneType, but not yet the solution, this was in the next log-entry:
Logger: homeassistant.helpers.event
Source: helpers/template.py:355
First occurred: 8:39:59 AM (3 occurrences)
Last logged: 4:40:48 PM
Error while processing template: {{0 < as_timestamp(states(sensor) if sensor != 'none' else states('sensor.date') ~ ' ' ~ manual_time) - as_timestamp(states('sensor.date_time_iso')) < float(seconds)}}
Error while processing template: Template("{{0 < as_timestamp(states(sensor) if sensor != 'none' else states('sensor.date') ~ ' ' ~ manual_time) - as_timestamp(states('sensor.date_time_iso')) < float(seconds)}}")
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 353, in async_render
render_result = compiled.render(kwargs)
File "/usr/local/lib/python3.8/site-packages/jinja2/environment.py", line 1090, in render
self.environment.handle_exception()
File "/usr/local/lib/python3.8/site-packages/jinja2/environment.py", line 832, in handle_exception
reraise(*rewrite_traceback_stack(source=source))
File "/usr/local/lib/python3.8/site-packages/jinja2/_compat.py", line 28, in reraise
raise value.with_traceback(tb)
File "<template>", line 1, in top-level template code
TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/event.py", line 885, in _render_template_if_ready
result: Union[str, TemplateError] = info.result()
File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 230, in result
raise self.exception
File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 462, in async_render_to_info
render_info._result = self.async_render(variables, **kwargs)
File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 355, in async_render
raise TemplateError(err) from err
homeassistant.exceptions.TemplateError: TypeError: unsupported operand type(s) for -: 'NoneType' and 'float'
I have this already in the configuration.yaml:
And this is the yaml-code of the automation that I have created: