I'm trying to create a 'generic' automation which handles all of my motion lights by listening for state changes of any properly labeled motion sensor and then turning on the primary lights in the same area as that motion sensor. I've gotten the light action down, but I'm having trouble with the trigger.
These triggers only work with booleans, which means that this automation wouldn't be able to handle multiple motion lights at the same time (for example walking from one room to another)
The workaround I've seen presented as an excuse for not adding additional functionality to Home Assistant is to create a helper template sensor to monitor the count of sensors matching the criteria, however this completely negates the ability to act on the actual triggering entity because the triggering entity has turned into a single helper entity rather than the actual motion entity that caused the trigger to occur.
Basically, I'm looking for a way to trigger an automation when any entity of a certain domain and device_class changes state from ["on", "off"] to ["on", "off"]