Light automation help please

Hi all. What would be the correct way of writing this automation? https://paste.ubuntu.com/p/zKbrfKTMkf/

My automation was made in the winter so I did not think about that I do not need light in the bathroom during summer time. Therefore I only want to trigger the whole automation if the lux is less than 50 or whatever lux I set. But now the configuration tells med it does not work.

Help is much appreciated! Thanks!

you can only have one “action:” section in an automation. And I would modify the “alias:”. And your indentation was off.

    - alias: Bathroom light on cancel timer           
      trigger:
        platform: state
        entity_id: binary_sensor.fibaro_system_fgms001zw5_motion_sensor_sensor_4
        to: 'on'
      condition: 
        condition: numeric_state
        entity_id: sensor.fibaro_system_fgms001zw5_motion_sensor_luminance_3
        below: 50
      action:
        - service: light.turn_on
          entity_id: light.fibaro_system_bad_2_etasje
        - service: timer.cancel
          entity_id: timer.bad_oppe

Also modify the indentation under the trigger & action sections of the other automations as well like above.

Or if the timer must be cancelled on movement but the light is conditional:

    - alias: Bathroom light on cancel timer           
      trigger:
        platform: state
        entity_id: binary_sensor.fibaro_system_fgms001zw5_motion_sensor_sensor_4
        to: 'on'
      action:
        - service: timer.cancel
          entity_id: timer.bad_oppe
        - condition: numeric_state
          entity_id: sensor.fibaro_system_fgms001zw5_motion_sensor_luminance_3
          below: 50
        - service: light.turn_on
          entity_id: light.fibaro_system_bad_2_etasje

Thanks to both of you @tom_l & @finity!
I got some great help from the Discord chat room.

I need to fix all of my automation again since it is all wrong with the spacing. Not sure where I got it from but these need fixing. Happy Easter to both of you :slight_smile: