I want to build a alarm system with multiple states and actions depending on what caused the alarm.
First some Setup Information
I’m running openHAB 2.3.0 on a local Debian 9 Server (x64, 8GB RAM).
My Smarthome componeds are mostly Homematic and I use the CCU2 as bridge with the homematic binding.
I’m a full time PHP Developer, but I don’t have any clue about Java
My plan is to have 2 armed states. One that ohnly checks if someone opens a door or window, and one that also checks for activity inside the home.
I also plan to have 3 alarm levels. Depending on the armed state, and what caused the alarm, I want to definie if the alarm starts on Level 1 or 2.
Currently I have items to define the armed state and the alarm level, and also some rules that react to this items.
In my old rule I had only a group with all Sensors and reacted to changes in the Group. But that has two problems. First i dosn’t work when one window is open (for example the sleeping room during night) and the second problem is that I don’t know which door has been opened.
My attemp as a PHP Programmer would be to save every state in an array, and when the group get’s an update compare these to see what items have changed. How can i do this in openHAB? I don’t want to go over the persitence becaus it is slow and in my test far away from reliable