Hello everybody,
I have an automation, that should notify me on occuring errors on my vacuum bots. I have plenty of coding skills especially .net, but yaml and jinja is still relatively new for me.
alias: Benachrichtigung Staubsauger
description: ""
triggers:
- trigger: state
entity_id:
- sensor.ufo_fehler
- sensor.ouzo_fehler
from: "0"
not_to:
- unavailable
- unknown
conditions: []
actions:
- choose:
- conditions:
- condition: state
entity_id: trigger.entity_id
state: "103"
sequence:
- metadata: {}
data:
title: Saugroboter braucht Hilfe!
message: >-
Hallo Heike, {% if trigger.to_state.entity_id ==
"sensor.ouzo_fehler" %} Ouzo {% else %} Yiko {% endif %} muss
gerettet werden!"
action: notify.mobile_app_sm_m225fv
- conditions:
- condition: state
entity_id: trigger.entity_id
state: "301"
sequence:
- metadata: {}
data:
title: Saugroboter braucht Hilfe!
message: >-
Hallo Heike, {% if trigger.to_state.entity_id ==
"sensor.ouzo_fehler" %} Ouzo {% else %} Yiko {% endif %} hat
Durst!"
action: notify.mobile_app_sm_m225fv
- conditions:
- condition: state
entity_id: trigger.entity_id
state: "302"
sequence:
- metadata: {}
data:
title: Saugroboter braucht Hilfe!
message: >-
Hallo Heike, {% if trigger.to_state.entity_id ==
"sensor.ouzo_fehler" %} Ouzo {% else %} Yiko {% endif %} hat
Pipi gemacht!"
action: notify.mobile_app_sm_m225fv
default:
- metadata: {}
data:
title: Saugroboter ist krank!
message: >-
Hallo Heike, mit {% if trigger.to_state.entity_id ==
"sensor.ouzo_fehler" %} Ouzo {% else %} Yiko {% endif %} stimmt
irgendwas nicht!"
action: notify.mobile_app_sm_m225fv
mode: single
Something with the condition is not working how I imagine it would, because all I get is the default path of the choose block.
The trace for the latest trigger looks like this:
this:
entity_id: automation.benachrichtigung_ufo
state: 'on'
attributes:
id: '1713989481918'
last_triggered: '2024-12-27T11:32:12.106134+00:00'
mode: single
current: 0
friendly_name: Benachrichtigung Staubsauger
last_changed: '2024-12-30T00:38:55.862851+00:00'
last_reported: '2024-12-30T00:38:55.862851+00:00'
last_updated: '2024-12-30T00:38:55.862851+00:00'
context:
id: 01JGAG0T3PH4KZBMR5D7B9VW0G
parent_id: null
user_id: null
trigger:
id: '0'
idx: '0'
alias: null
platform: state
entity_id: sensor.ufo_fehler
from_state:
entity_id: sensor.ufo_fehler
state: '0'
attributes:
description: 'NoError: Robot is operational'
friendly_name: Yiko Fehler
last_changed: '2024-12-30T00:38:36.668072+00:00'
last_reported: '2024-12-30T00:38:36.668072+00:00'
last_updated: '2024-12-30T00:38:36.668072+00:00'
context:
id: 01JGAG07BWMRXJ66N8MBNMPMVW
parent_id: null
user_id: null
to_state:
entity_id: sensor.ufo_fehler
state: '302'
attributes:
description: WasteWaterBox full
friendly_name: Yiko Fehler
last_changed: '2024-12-30T12:11:34.359721+00:00'
last_reported: '2024-12-30T12:11:34.359721+00:00'
last_updated: '2024-12-30T12:11:34.359721+00:00'
context:
id: 01JGBQN2JQEM533X2MNAD6NWT3
parent_id: null
user_id: null
for: null
attribute: null
description: state of sensor.ufo_fehler
Thanks in advance for pointing me in the correct direction!