Alarm group?

I’m thinking about setting up an alarm system. Basically when the alarm is armed, I want to trigger an alert when any of a list of configured devices changes its state. The devices will mostly be lights and door/window sensors but maybe other interactable devices as well. The idea is that when nobody is home, nobody should interact with these devices.

Now my question is: is there an easy way to group all the devices in a single list and get an event when any of them changes state?

From what I read about groups, they will either AND or OR their states together and act like a single device. But that’s not what I need here.

How would you set this up? I’m probably not the first one who wants to implement something like this?

Why not?

OR logic (the default behaviour) will make the group turn on when any of the binary entities are on, which you can use to activate your alarm.

But I don’t care about on or off. I care about state changes. Simplest example: when I left on a light when I left home, I want an alert when someone switches it off.

My group may contain all kinds of devices in different states, some on, some off. For example, I may have presence sensors for some of my electronic devices. Their default is on, but when someone disconnects them from the network → alarm. Lights on the other hand should probably be off normally.

Well I guess you get my point. I don’t care about the actual state, only about unexpected state changes.