What kind of notification? It should be.
pushover i utilize for anywhere
Well then add the action that sends it.
but reminder not timer⌠is possibile?
Thanks for the blueprint, works fine! Is it possible to only start an action, if the timer wasnât stopped after a specific time?
Iâm wondering if it is possible to retrieve the âtimerLabelâ value of a timer and use it as condition, as this would make some interesting automation possible. For instante, one could ask âalexa, set timer tv 10 minutesâ, and the automation would turn off the tv, but only the for the âtvâ timer.
Replying to myself: the timer name could be retrieved with something like this:
{% set foo = state_attr("sensor.echo_dot_next_timer", "sorted_active") %}
{% set bar = foo|from_json %}
{{ bar[0][1].timerLabel|lower }}
I ended writing a appdaemon app to do the same (and a few more things), but I leave this as someone might be interested.
Hello, I donât know if it has to do with the template or with the integration, but the sensor_next_timer gives errors.
Home Assistant 2023.1.7
Supervisor 2023.01.1
Operating System 9.5
Frontend 20230110.0 - latest
Logger: homeassistant.helpers.event
Source: helpers/template.py:425
First occurred: 15:03:30 (1 occurrences)
Last logged: 15:03:30
Error while processing template: Template("{% if states(âsensor.echo_dot_de_edu_negro_next_timerâ) != âunavailableâ %} {{ ((as_timestamp(states(âsensor.echo_dot_de_edu_negro_next_timerâ)) - as_timestamp(now()))/60) | int + 1 }} {% else %} 0 {% endif %}")
Traceback (most recent call last):
File â/usr/src/homeassistant/homeassistant/helpers/template.pyâ, line 1606, in forgiving_as_timestamp
return dt_util.as_timestamp(value)
File â/usr/src/homeassistant/homeassistant/util/dt.pyâ, line 132, in as_timestamp
raise ValueError(ânot a valid date/time.â)
ValueError: not a valid date/time.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File â/usr/src/homeassistant/homeassistant/helpers/template.pyâ, line 423, in async_render
render_result = _render_with_context(self.template, compiled, **kwargs)
File â/usr/src/homeassistant/homeassistant/helpers/template.pyâ, line 1950, in _render_with_context
return template.render(**kwargs)
File â/usr/local/lib/python3.10/site-packages/jinja2/environment.pyâ, line 1301, in render
self.environment.handle_exception()
File â/usr/local/lib/python3.10/site-packages/jinja2/environment.pyâ, line 936, in handle_exception
raise rewrite_traceback_stack(source=source)
File ââ, line 2, in top-level template code
File â/usr/local/lib/python3.10/site-packages/jinja2/sandbox.pyâ, line 393, in call
return __context.call(__obj, *args, **kwargs)
File â/usr/src/homeassistant/homeassistant/helpers/template.pyâ, line 1609, in forgiving_as_timestamp
raise_no_default(âas_timestampâ, value)
File â/usr/src/homeassistant/homeassistant/helpers/template.pyâ, line 1411, in raise_no_default
raise ValueError(
ValueError: Template error: as_timestamp got invalid input âunknownâ when rendering template â{% if states(âsensor.echo_dot_de_edu_negro_next_timerâ) != âunavailableâ %}
{{ ((as_timestamp(states(âsensor.echo_dot_de_edu_negro_next_timerâ)) - as_timestamp(now()))/60) | int + 1 }}
{% else %}
0
{% endif %}â but no default was specified
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File â/usr/src/homeassistant/homeassistant/helpers/template.pyâ, line 540, in async_render_to_info
render_info._result = self.async_render(variables, strict=strict, **kwargs)
File â/usr/src/homeassistant/homeassistant/helpers/template.pyâ, line 425, in async_render
raise TemplateError(err) from err
homeassistant.exceptions.TemplateError: ValueError: Template error: as_timestamp got invalid input âunknownâ when rendering template â{% if states(âsensor.echo_dot_de_edu_negro_next_timerâ) != âunavailableâ %}
{{ ((as_timestamp(states(âsensor.echo_dot_de_edu_negro_next_timerâ)) - as_timestamp(now()))/60) | int + 1 }}
{% else %}
0
{% endif %}â but no default was specified
The only issue/concern I have: I have to set this up on each individual Alexa device as sensor.this_device_next_timer does not work for me (I imagine thatâs more to do with the Alexa Media Player add on than this blueprint).
I did try to add multiple echo devices via the YAML editor, but it did not work out for me. I wound up having to duplicate this automation and save it for each of my 6 different Alexa devices.
I did manage to get an elongated flash of lights to work. Attached are the screenshot for the visual editor, as well as the YAML Editor for posterity/anyone else who may run into this topic in the future.
alias: Entry Door Timer
description: Flash Hue Lights when Echo Timer Goes Off
use_blueprint:
path: AndrejDelany/do-something-when-alexa-timer-has-expired.yaml
input:
echo_device_next_timer: sensor.entry_door_next_timer
target_action:
- repeat:
sequence:
- device_id: 2ab64fefbe93954fbdc4fb0544560b27
domain: light
entity_id: 6c9d7cabde555881da8d6efbf81ecbb4
type: flash
count: 30
Is anyone still working this thread? This has been doing my head in! I want to trigger an automation 30 seconds before my Alexa next timer (my echo device) expires. I can post my code, just wondering if anyone else is working on this?
TIA,
Russ
It is correct, that you have to create the automation for each echo separately.
As the creator of this blueprint, I drop by from time to time. Due to time constraints, however, I cannot offer extensive support and therefore I answer questions irregularly. However, in the spirit of open source, anyone can contribute and answer questions.
Thanks for the BP, I use it quite a bit! Iâll let you know if I figure out how to trigger an automation X seconds before timer expires.
Did you figure this out? Iâd like to have a trigger based on when the timer starts.
This should work for your triggerâŚ
trigger:
- platform: state
entity_id:
- sensor.YOUR ALEXA DEVICE_next_timer
from: unknown
Thanks. This works great.