Hi,
my alarm automation throws error in the log when i disable the alarm from the Smartphone.
If Alarm is turned off the attributes becomes nothing so homeassistant throws an error.
Could anyone help to solve this please ?
- alias: Wecker - Set Alarm Input Helper
trigger:
- platform: state
entity_id: sensor.martin_smartphone_next_alarm
action:
- service: input_datetime.set_datetime
data_template:
entity_id: input_datetime.wakeup_martin_smartphone
datetime: >-
{% if 'com.sec.android.app.clockpackage' in (state_attr('sensor.martin_smartphone_next_alarm', 'Package' )) %} {{
states('sensor.martin_smartphone_next_alarm') |as_datetime |as_local }} {% endif %}
mode: restart
Error in Log:
Logger: homeassistant.components.automation.wecker_set_alarm_input_helper
Source: components/automation/init.py:514
Integration: Automatisierung (documentation, issues)
First occurred: 11:49:26 (2 occurrences)
Last logged: 11:49:57
Error while executing automation automation.wecker_set_alarm_input_helper: Error rendering data template: TypeError: argument of type 'NoneType' is not iterable
Error while executing automation automation.wecker_set_alarm_input_helper: Invalid datetime specified: for dictionary value @ data['datetime']
Thanks in advance