hi,
on Script syntax documentation page https://www.home-assistant.io/docs/scripts/#raise-and-consume-custom-events below ‘custom’ event_type is mentioned, which im rather keen to explore.
- alias: Capture Event
trigger:
- platform: event
event_type: event_light_state_changed
action:
- service: notify.notify
data_template:
message: "kitchen light is turned {{ trigger.event.data.state }}"
on the Event documentation page though this event isnt listed at all:https://www.home-assistant.io/docs/configuration/events/
is there any further info on this? id like to use this trigger to do something like run a python script, showing the lights.
using the below events call_service
and state_changed
for that now, with mixed results for the Pi getting into trouble with timing errors
- alias: 'Call Service Event Light'
id: 'Call Service Event Light'
trigger:
platform: event
event_type: call_service
event_data:
domain: light
action:
- delay: 00:00:02
- service: python_script.whats_on
- delay: 00:00:02
- service: python_script.summary
- alias: 'State changed Ikea Light'
id: 'State changed Ikea Light'
trigger:
platform: event
event_type: state_changed
condition:
condition: template
value_template: >
{{ trigger.event.data.entity_id in state_attr('group.ikea_tradfri_lights','entity_id') }}
action:
- delay: 00:00:02
- service: python_script.whats_on
- delay: 00:00:02
- service: python_script.summary
could I simply try:
- alias: 'Event light state changed Ikea Light'
id: 'Event light state changed Ikea Light'
trigger:
platform: event
event_type: event_light_state_changed
condition:
condition: template
value_template: >
{{ trigger.event.data.entity_id in state_attr('group.ikea_tradfri_lights','entity_id') }}
expanding a bit: is this ‘custom’ event available for all domains? event_switch_state_changed
, event_sensor_state_changed
etc etc? would be really nice indeed.
If so documention needs updating severely. but first things first.
hoping to cut down in processor power, by limiting what the automation is listening to. if it only listens to state changes in the light domain that would narrow it down a lot from listening to all states.
ive added the above automation, and the event is listed in the dev-event page, but nothing happens.