Automation trigger based on script turning on

Hello,

I’m trying to run an automation anytime a certain script turns on. The script is turned on via multiple different automation.

This is my trigger code for the automation but it doesn’t seem to be picking up on the script.turn_on events.

  trigger:
    - platform: event
      event_type: call_service
      event_data:
        domain: script
        service: script.turn_on
        service_data:
          entity_id: script.office_lighting

Any ideas what I might be doing incorrectly?

Why not just do it off the state of the script? The state is only “on” briefly, but it will trigger automations… I have a few that trigger notifications to my phone if certain scripts turn on.

trigger:
  - platform: state
    entity_id: script.office_lighting
    to: 'on'

Thank you, that worked.

1 Like