Hello,
i want to use kind of a wildcard for some sensors within an automation.
I’m running the UptimeKuma Integration which creates automatically sensors like this one:
My first approach was an automation like this. This automation is working fine, but not very comfortable:
alias: (B) Pings
description: ""
trigger:
- platform: state
entity_id:
- binary_sensor.uptimekuma_testping
- binary_sensor.uptimekuma_oled_display_haustur
- binary_sensor.uptimekuma_pool
to: "on"
for:
hours: 0
minutes: 0
seconds: 0
from: "off"
condition: []
action:
- service: notify.jabber
data:
title: Ping-Status
message: >
{{ state_attr(trigger.to_state.entity_id, 'friendly_name') }} ist
*online*.
mode: parallel
In order not to entery every new entitiy manually I tried to create the folling automation, which is not getting triggert at all.
alias: (B) Pings New
trigger:
- platform: event
event_type: state_changed
event_data:
domain: binary_sensor
condition:
- condition: template
value_template: >-
{{ trigger.event.data.entity_id.startswith('binary_sensor.uptimekuma_') and trigger.event.data.old_state.state == 'off' }}
action:
- service: notify.jabber
data_template:
message: test
Thank you in advance for any possible hints.
kafisc