Hi all,
I’m after some guidance on something I’ve tried to implement which works but is somewhat clunky and I’m wondering if anyone’s overcome it in a better way.
I’ve basically got several CCTV cameras, these each have an array of different detection alarms.
I’ve also got several PIR and contact type sensors.
What I’m after is a way to take a group of binary sensors and visually select whether they need to be included in a common alarm sensor.
e.g. of all the alarms for my camera I’d like to list these and then select which detection methods I’d like to contribute to a single detection alarm from that camera.
As it stands I’ve done all of this by using an automation where I list all the inputs I’m interested in and it then toggles a binary helper. It works, but each camera needs a bespoke automation to do this and there’s no way to alter it without changing the automation.
I’m then also after a similar system where I can visually chose which of these combined alarms will then trigger an alarm to my mobile, or pop up a feed on the screen or just be ignored.
Again with automations I’ve achieved this together with an array of helpers to identify if these are active or inactive.
So, what I’ve come up with is this:-
It all works, but as I said it’s very clunky, not very easy to tweak or expand without re-writing automations and I’m sure that there’s better way of doing some if not all the parts of it.
There’s something at the back of my mind from uni when we looked at bitwise AND gate which might somehow make this work, ie if the incoming sensors were organised as a byte of information and then ANDed with another byte that represented the alam selection/mask I’d end up with an outcome that represented a number which if >1 would mean the alarm was active or 0 if it wasn’t.
Anyone any ideas?