Automations, Scenes, and Glance cards (Solved)

I’m trying to set-up a simple…lets call it a task for now.

I have four Sonoffs wired into extension cords all going to light sources. (They are listed as switches in the .yaml files)

What I want to do is set a “task” so that when I press a icon on a glance card it will trigger something that will turn off two lights/switches and turn on two different lights/switches. Ideally, I’d like to have it that when I’m done, I can press the same card and turn the original lights back on and turn the other ones off.

I thought that what I was looking for was a scene but I think that’s wrong. I tried automation, but that doesn’t seem to work either.

Can someone point me in the right direction, show me an example?

I am not a programmer but I would write a script then call that script from a card.
Example :

lights_off:
  sequence:
      - service: homeassistant.turn_off
        entity_id:
            - group.2_a_lights
      - service: homeassistant.turn_on
        entity_id:
            - group.2_b_lights

Oooooh, that’s interesting. I’m almost mad I didn’t think of that. Thank you. :slight_smile: