Logger: homeassistant.helpers.template
Source: helpers/template.py:1292
First occurred: 08:55:39 (1 occurrences)
Last logged: 08:55:39
Template warning: 'as_timestamp' got invalid input 'unavailable' when rendering template '{% set alarm_time = as_timestamp(states('sensor.echo_schlafzimmer_next_alarm')) %} {% set current_time = as_timestamp(states('sensor.date_time').replace(',', '')) %} {% set pre_time = 3600 %} {{ current_time >= alarm_time - pre_time }}' but no default was specified. Currently 'as_timestamp' will return 'None', however this template will fail to render in Home Assistant core 2022.1
Logger: homeassistant.components.template.trigger
Source: components/template/trigger.py:63
Integration: Template (documentation, issues)
First occurred: 08:55:39 (1 occurrences)
Last logged: 08:55:39
Error evaluating 'template' trigger for 'Morgen Routine': TypeError: unsupported operand type(s) for -: 'NoneType' and 'int'
Not sure what I’m doing wrong, as the Automation does trigger and switch on my heating as it should, but the logs warn me about this:
Error evaluating ‘template’ trigger for ‘websocket_api’: ValueError: Template error: as_timestamp got invalid input ‘unavailable’ when rendering template ‘{% set alarm_time = as_timestamp(states(‘sensor.echo_mancave_next_alarm’)) %} {% set current_time = as_timestamp(states(‘sensor.date_time’).replace(’,’, ‘’)) %} {% set pre_time = 1800 %} {{ current_time >= alarm_time - pre_time }}’ but no default was specified
Error evaluating ‘template’ trigger for ‘websocket_api’: AttributeError: ‘NoneType’ object has no attribute ‘tzinfo’
Admittedly, I never really looked into the logs as stuff just works, but trying to get as many things clean as possible, such stuff now makes me wonder where I’m going wrong.
It looks like you have an autofill error that doubled _next_alarm : sensor.bad_next_alarm_next_alarm
You have “fancy quotes” around the sensor’s entity id, you need to use plain quotes. This happens sometimes when copying text from the forum that isn’t in a formatted code block.
Oh my goodness. I really didn’t see my fault with the double thing. The quotes were alright. These were just fancy because of the font in my internet explorer.
I’m a complete beginner at Homeassistant and I’m trying to set up my automation to run 5 minutes before the alarm, but I don’t really understand the example above.
I have created a sensor and can see the Developer Tool / Template that it shows True/False depending on whether the alarm is set 5 minutes before or not.
What I don’t really understand is how to create an automation of it.
This is the Triggers Template
You have a copy/paste error in your trigger configuration that is causing it to fail.
If you already created the template sensor, you do not need to use the template again in your trigger. You have not included the entity ID of your sensor so you will need to correct it (and possibly the to: state as well) before using the following automation:
Hi all, I’ve been using the next.alarm to start my espresso machine 30 minutes before it goes off and it has been going great for a year thanks to a Shelly built inside it…. That s until this week.
Alexa is failing to send the next alarm to Home Assistant this week. It remains Unknown after the alarm is set and on my dashboard it is stuck on Dec 31, 1969 7:00pm (same time it always shows when an alarm isn’t set).
Anyone else having trouble with Alexa sending the alarm time?