Trigger automation based on scene activated

Hi,

Every morning i activate the scene “Morgen” so that lights etc come on. I also want to add some more logic to this and have written an automation that should trigger when scene “morgen” is activated. The problem is that the automation is never triggered. I have tried with the condition commented away, but still no luck.

alias: 'Turn on lights when Morgen'
    trigger:
       platform: event
       event_type: call_service
       event_data:
         service_data:
           entity_id: scene.morgen
         domain: scene
         service: turn_on
    condition:
       condition: numeric_state
       entity_id: sensor.sensative_strips_comfort_luminance
       below: 10
    action:
       - service: light.turn_on
         data:
           entity_id: light.stuevinduer
           brightness: 70
       - service: light.turn_on
         data: 
           entity_id: light.spisestuebord       
           brightness: 183
           rgb_color: [255,163,74]    

Does anyone have some pointers to what is wrong here ?

I think it would be easier to create a script, which does the same as your scene but has your condition in the end with the actions if the condition is true. When you start the script, it will execute all the actions and once it is at your condition, it only continues if the condition is true.

Something like this:

script:
  example_script:
    sequence:
      - service: light.turn_on
        data:
          entity_id: light.bedroom
      - service: light.turn_on
        data:
          entity_id: light.livingroom'
      - ....


      - condition: numeric_state
        entity_id: sensor.sensative_strips_comfort_luminance
        below: 10
      - service: light.turn_on
        data:
          entity_id: light.stuevinduer
          brightness: 70
      - service: light.turn_on
        data: 
          entity_id: light.spisestuebord       
          brightness: 183
          rgb_color: [255,163,74]   
1 Like