One button for 2 switches and 2 lights

I have 2 basic lamps on Meross sockets to control them with HA and 2 IKEA zigbee lamps.

I managed to place a button on the dashboard to control the 2 Meross switches.

But I haven’t managed to place a button on the dashboard to control the 4 entities (2 switches and 2 lights).

Can you tell me how to do it?

Use a toggle helper to trigger an automation. Use choose as the action and trigger switches based on the state of the helper.

You can read all you need to.know about this by reading the docs.

1 Like

Do you have a link to the relevant documentation ?

can you post the code you have? hard to tell what’s wrong w/o seeing the code.

but w/o seeing the code, if i had to guess, perhaps you’re hitting an issue that you have switches and lights, and you’re using switch.turn_on/turn_off/toggle.

if that’s the issue, instead of that, use homeassistant.turn_on/turn_off/toggle, then list all 4 entities

Yep at the top.of the page is a link.to.the docs page. There you will.find all.the info you need to create an automation, and anything you need to know about helpers.

Wouldn’t it be easier to use a scene?
And activate the scene by means of a button?


      - type: button
        tap_action:
          action: call-service
          service: scene.turn_on
          service_data:
            entity_id: scene.daytime
        icon: mdi:home-modern
        show_icon: true
        name: DayTime
        show_state: false
        show_name: true
        icon_height: 50px

1 Like

I’m the vein of "there’s more than one way to skin a cat…

you can also make the switches show as lights so that you have 4 lights, not 2 switches and 2 lights.

Do this via the entity properties. Choose show as, then light: