Quantcast
Channel: Configuration - Home Assistant Community
Viewing all articles
Browse latest Browse all 95919

Entity_id wildcard

$
0
0

@schluggi wrote:

Hi ,

i’ve got an problem with condition templating. I want to get notified if one of my battery-sensors has changed there state. I looked around and found this example, witch sadly not work in my case…

 - alias: Battery
    trigger:
      platform: event
      event_type: state_changed
      event_data:
        domain: sensor
    condition:
      condition: template
      value_template: "{{ trigger.event.data.entity_id.startswith('battery_') }}"
    action:
      service: notify.telegram
      data_template:
        message: "\U0001F50B Battery {{ trigger.to_state.attributes.friendly_name }} has changed to {{ trigger.to_state.state }}"

I always got this error:

ERROR (MainThread) [homeassistant.config] Invalid config for [automation]: extra keys not allowed @ data['condition'][1]['state']. Got None
not a valid value for dictionary value @ data['condition'][1]['condition']. Got None. (See /home/homeassistant/.homeassistant/configuration.yaml, line 629). Please check the docs at https://home-assistant.io/integrations/automation/

Thank you for helping and happy Christmas Eve :wink:

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 95919

Trending Articles