Trigger independent of switch state

Over the past few years I have replaced all my bulbs with Hue. As this also means the traditional wall switches don’t have a purpose anymore I added a RFXCOM receiver to my Raspberry Pi and replaced the switches to 433 MHz versions. I also started using Home Assistant and managed to setup the basics. Lights are switched on and off depending on the state of switches.

However some rooms (eg my living room) have multiple switches which should be able to control the same group of Hue bulbs. And that’s were things get difficult. Basically I want to group switches and this group should be able to control a group of Hue bulbs. But as not all switches in this group will have the same state it would mean you would have to trigger an event independent of the switch state.

So if the Hue bulbs are currently on and I press one of the switches the bulbs should be turned off. Next if I press a switch from the same group it should turn the Hue bulbs on again.

Any idea whether something like this would be possible?

You can setup your automation to be like this:

When state of one of my switches changes:
Toggle light

So don’t focus on the state of any of your switches, just on the fact that they change.

Ah, thought the “state” was mandatory.

So something like this could work:

automation: alias: Switch lights trigger: platform: state entity_id: switch.livingroom1

But how about the “action” stuff. You seem to need to specify a service which includes “turn_off” or “turn_on”. Could I make it somehow the opposite of what it currently is?

action: service: light.turn_off entity_id: group.livingroom_lights

Add two automation rules. Both with a condition and the opposite service call. If on: turn off. If off: turn on.