Mix switch and light in a script

I need som help. I am trying to create on script that turn on all my light, they are mixed between switch and light´s and I can’t get it to work, can someone help me what I am doing wrong?

  tand_alla_lampor:
    alias: Tänd alla lampor
    sequence:
      - service: homeassistant.turn_on
        data:
          entity_id: 
            - switch.kontor__fonster
            - switch.kok__lilla_fonstret
            - switch.kontor__fonster
            - switch.kontor__hylla
            - switch.lilla_hallen
            - switch.sovrum__hoger
            - switch.sovrum__vanster
            - switch.vardagsrum__bokhylla
            - switch.vardagsrum__tvbank
            - switch.albins_rum__fonster
            - switch.albins_rum__hylla     
                  
      - service: light.turn_on
        data:
            entity_id: light.hall__vagglampa
            data:
                brightness: 60
            
            
      - service: light.turn_on
        data:
            entity_id: 
            - light.kok__fonster
            - light.sovrum__fonster
            - light.vardagsrum__fonster
            data:
                brightness: 180
    
      - service: light.turn_on
        data:
            entity_id: light.kontor__skrivbord
            data:
                brightness: 40

Thanks in advanced!

Please check the logfile and state what exactly the problem is (e.g. what’s not working). But your service calls to the light.turn_on service contains data elements withing data elements…it should be like this:

      - service: light.turn_on
        data:
            entity_id: light.hall__vagglampa
            brightness: 60

~Cheers

I did not have any errors, it just didn’t work. But this made the trick and now it´s working.

Thanks a lot @PhyberApex, I rely appreciate it!

1 Like