HI!
I have a problem since 2024.02. update.
My automation send an Actionable notification to my phone when i power on my TV, and ask if i want to start Home Theater too or not.
If i click YES> a script starts my HomeTheater
If I click NO > Then i got another notification that it is paused
BUT if i don’t hit anything in 60 sec the automation should continue, and clear the notification from my phone after a few minutes. ANd the problem is with this scenario.
Here is my automation:
alias: Tv után LG
description: ""
trigger:
- platform: state
entity_id: media_player.my_tv_3
for:
hours: 0
minutes: 0
seconds: 1
to: "on"
from: "off"
condition:
- condition: time
after: "15:00:00"
before: "23:00:00"
action:
- alias: Set up variables for the actions
variables:
action_open: "{{ 'OPEN_' ~ context.id }}"
action_close: "{{ 'CLOSE_' ~ context.id }}"
- service: notify.mobile_app_mi_8
data:
data:
actions:
- action: "{{ action_open }}"
title: Igen
- action: "{{ action_close }}"
title: NEM
tag: lg_hazimozi
title: LG házimozi automatizáció
message: Folytatja?
- alias: Wait for a response
wait_for_trigger:
- platform: event
event_type: mobile_app_notification_action
event_data:
action: "{{ action_open }}"
- platform: event
event_type: mobile_app_notification_action
event_data:
action: "{{ action_close }}"
continue_on_timeout: true
timeout: "60"
- alias: Perform the action
choose:
- conditions:
- condition: template
value_template: "{{ wait.trigger.event.data.action == action_open }}"
sequence:
- service: script.lg_aux_opt
data: {}
- conditions:
- condition: template
value_template: "{{ wait.trigger.event.data.action == action_close }}"
sequence:
- service: shell_command.test_pause
data: {}
default:
- delay:
hours: 0
minutes: 0
seconds: 1
milliseconds: 0
- delay:
hours: 0
minutes: 5
seconds: 0
milliseconds: 0
- service: notify.mobile_app_mi_8
data:
message: clear_notification
data:
tag: lg_hazimozi
mode: single
PROBLEM: If i don’t choose from options on my phone i got this error log, and my whole disk get flood. (more then 10GB after a few hours) and only restart could stop logging errors.
ERROR LOG (many many times)
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/automation/__init__.py", line 637, in async_trigger
and not self._cond_func(variables)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/automation/__init__.py", line 1014, in if_action
if check(hass, variables) is False:
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/condition.py", line 179, in wrapper
result = condition(hass, variables)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/condition.py", line 787, in template_if
return async_template(hass, value_template, variables)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/condition.py", line 767, in async_template
info = value_template.async_render_to_info(variables, parse_result=False)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 687, in async_render_to_info
assert self.hass and _render_info.get() is None
AssertionError
I also got this in my log:
2024-03-07 11:59:23.842 ERROR (MainThread) [homeassistant.helpers.template] Template variable error: 'None' has no attribute 'event' when rendering '{{ wait.trigger.event.data.action == action_open }}'
2024-03-07 11:59:23.842 WARNING (MainThread) [homeassistant.helpers.script] Error in 'choose[0]' evaluation: In 'template' condition: UndefinedError: 'None' has no attribute 'event'
2024-03-07 11:59:23.842 ERROR (MainThread) [homeassistant.helpers.template] Template variable error: 'None' has no attribute 'event' when rendering '{{ wait.trigger.event.data.action == action_close }}'
2024-03-07 11:59:23.843 WARNING (MainThread) [homeassistant.helpers.script] Error in 'choose[0]' evaluation: In 'template' condition: UndefinedError: 'None' has no attribute 'event'