continuing from this thread,
how could this automations condition_template be shortened? Ive tried to use a list, but cant get the filter correct…:
- alias: 'Call state change event (all)'
id: 'Call state change event (all)'
# hide_entity: True
# initial_state: 'on'
trigger:
platform: event
event_type: state_changed
condition:
- condition: template
value_template: >
{{ trigger.event.data.entity_id in state_attr('group.family','entity_id') or
trigger.event.data.entity_id in state_attr('group.hubs_binary_pinged','entity_id') or
trigger.event.data.entity_id in state_attr('group.critical_devices_state','entity_id') or
trigger.event.data.entity_id in state_attr('group.media_player_media','entity_id') or
trigger.event.data.entity_id in state_attr('group.device_tracker_media','entity_id') or
trigger.event.data.entity_id in state_attr('group.all_lights_only','entity_id') or
trigger.event.data.entity_id in state_attr('group.iungo_switch_switches_template','entity_id') or
trigger.event.data.entity_id in state_attr('group.iungo_switch_appliances_template','entity_id') or
trigger.event.data.entity_id in state_attr('group.binary_sensors_active_template','entity_id') }}
action:
service: python_script.summary
please check with me, thx,
Marius