tady je ta chyba v logu ...
Kód: Vybrat vše
Logger: homeassistant.components.automation.notifikace_odpojeni_zarizeni
Source: helpers/service.py:190
Integration: Automatizace (documentation, issues)
First occurred: 18:50:16 (20 occurrences)
Last logged: 23:11:10
Notifikace odpojení zařízení: Error executing script. Unexpected error for call_service at pos 1: Error rendering data template: UndefinedError: 'trigger' is undefined
While executing automation automation.notifikace_odpojeni_zarizeni
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
File "/usr/local/lib/python3.8/site-packages/jinja2/sandbox.py", line 407, in getattr
value = getattr(obj, attribute)
jinja2.exceptions.UndefinedError: 'trigger' is undefined
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 188, in async_prepare_call_from_config
service_data.update(template.render_complex(config[conf], variables))
File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 93, in render_complex
return {
File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 94, in <dictcomp>
render_complex(key, variables): render_complex(item, variables)
File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 98, in render_complex
return value.async_render(variables)
File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 355, in async_render
raise TemplateError(err) from err
homeassistant.exceptions.TemplateError: UndefinedError: 'trigger' is undefined
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 250, in _async_step
await getattr(
File "/usr/src/homeassistant/homeassistant/helpers/script.py", line 429, in _async_call_service_step
domain, service_name, service_data = service.async_prepare_call_from_config(
File "/usr/src/homeassistant/homeassistant/helpers/service.py", line 190, in async_prepare_call_from_config
raise HomeAssistantError(f"Error rendering data template: {ex}") from ex
homeassistant.exceptions.HomeAssistantError: Error rendering data template: UndefinedError: 'trigger' is undefined
A tady je moje automatizace
Kód: Vybrat vše
alias: Notifikace odpojení zařízení
description: ''
trigger:
- entity_id:
- light.lampicka_pokoj
- light.led_strip_kuchyn
for: '00:00:02'
platform: state
to: unavailable
condition: []
action:
- service: notify.mobile_app_petr_xiaomi
data:
message: >-
Zařízení SONOFF {{ trigger.to_state.attributes.friendly_name }} se v {{
now().strftime('%H:%M:%S') }} hodin odpojilo od Wifi.
mode: single
initial_state: 'on'
Děkuji za pomoc !