Alarm system 'wiki'

In this subforum you can show projects you have made, or you are busy with. Please create your own topic.

Moderator: leecollings

User avatar
Egregius
Posts: 2582
Joined: Thursday 09 April 2015 12:19
Target OS: Linux
Domoticz version: v2024.7
Location: Beitem, BE
Contact:

Re: Alarm system 'wiki'

Post by Egregius »

It's my why :P
I use 2 icons on my floorplan to handle this:
Image
Green house means home, otherwise it's red.
Opacque sleepy icon means not a sleep, otherwise it's yellow.

In my situation there's not much difference between sleep and away.
Sleep = all downstairs sensors trigger alarm, heating automatic.
Away = down+upstairs sensors trigger alarm, heating low.


In my script almost everything is based on if away or if sleep
korniza
Posts: 157
Joined: Thursday 27 August 2015 18:12
Target OS: Raspberry Pi / ODroid
Domoticz version: V3.6028
Location: Greece
Contact:

Re: Alarm system 'wiki'

Post by korniza »

You have a point on this. Do you use proximity sensors (bluetooth/rfid/rf) to switch mode so they work as indicators or you use these buttons?
>>>> Google Home <<<<<
SBC: Odroid XU4 * Raspberry Pi2 * banana Pi v1
Peripherals: rfxtrx433E, aeon z-stick gen5, bluetooth dongles
Extended Software packages: Xeoma (video NVR), FHEM (extra home automation software)
User avatar
Egregius
Posts: 2582
Joined: Thursday 09 April 2015 12:19
Target OS: Linux
Domoticz version: v2024.7
Location: Beitem, BE
Contact:

Re: Alarm system 'wiki'

Post by Egregius »

Just the buttons, nothing automatic cause I didn't find anything yet that is 100% stable.
lost
Posts: 616
Joined: Thursday 10 November 2016 9:30
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Alarm system 'wiki'

Post by lost »

korniza wrote:
lost wrote:On paper I designed sensors and put some user variables on every sensor (weights).
Hello,

Just to say I got inspired by your weighting mechanism. On my side, external motion is detected by a hidden camera that'll send pjg files to a ftp server on my PI. As there is no delay between motion captures (to get max chances to see someones head), there can be a few captures by second.

On the PI side, a python script runned as a service monitors ftp cam directory & zip (with passwd) then email (gmail ext account) archive using a name including motion files archive nb.

This nb is also given as a weight for a domoticz user var used by lua side that trigs alarms.

So a little capture because luminosity changes = no alarm... Someone messing around = alarm.

All internal sensors have a weight that'll trigger alarm immediately, I plan to have a weight approach for external sensors (I plan to set PIRs oustide, where they give false alerts).

So you gave me a good idea! :D
Till
Posts: 2
Joined: Saturday 07 January 2017 1:50
Target OS: Linux
Domoticz version:
Contact:

Re: Alarm system 'wiki'

Post by Till »

Hi,
heggink wrote:All,

IMPORTANT: The original WIKI was created when domoticz still recognised changes in user variables and was able to trigger events. That is no longer the case. User variables need to be replaced with dummy devices instead.
I had a lot of issues getting the alarm system to work well with the current stable Domoticz release. Now it seems to work. I'd like to document here what I've done, to help others (and prevent them from wasting several hours, like I did...). Feedback is welcome.

My conventions:
- All "Door" sensors have names that start with "Door" ("MCS_" in the original version)
- All motion sensors have names that start with "Motion" ("PIR_" in the original version)

I created the following dummy devices (Virtual Switches):
- "AlarmDetected": Becomes Active when an alarm is detected
- "VirtualSiren": The device that triggers physical siren(s). Using a virtual device for this makes it easier to support multiple sirens/signaling devices, and solves some other problems. "Sirene: Innen" is my physical siren.
- "AlarmSirenTrigger": Used for the siren delay

The original LUA code has only been modified slightly. Here it is:

Event "MotionAlarm" - Device:

Code: Select all

-- Title: script_device_PIRAlarm.lua
-- Date: 12-11-2015
-- checks for PIR during Alarm Away status
-- if detected then alert and set the alarm flag
-- 
 
commandArray = {}
 
tc=next(devicechanged)
PIR_switch=tostring(tc)
if (PIR_switch:sub(1,6) == 'Motion') then
	if(otherdevices['Security Panel'] == 'Arm Away') then
		print('Movement detected on '..PIR_switch)
		-- commandArray['SendNotification']='Movement detected on '..PIR_switch
		commandArray['Variable:LastAlarmDevice'] = 'Detected movement on '..PIR_switch
		commandArray['AlarmDetected']='On'
	end
end
 
return commandArray
Event "DoorAlarm" - Device:

Code: Select all

-- Title: script_device_MCSAlarm.lua
-- Date: 12-11-2015
-- checks for MCS during Alarm Away status
-- if detected then alert and set the alarm flag
 
commandArray = {}
 
tc=next(devicechanged)
MCS_switch=tostring(tc)
if (MCS_switch:sub(1,4) == 'Door') then
	if(otherdevices['Security Panel'] == 'Arm Away') then
		print('Door open/close detected for '..MCS_switch)
		commandArray['Variable:LastAlarmDevice'] = 'Detected door open/close on '..MCS_switch
		-- commandArray['SendNotification']='Door open/close detected for '..MCS_switch
		commandArray['AlarmDetected']='On'
	end
end
 
return commandArray
Event "KeypadAlarm" - Device:

Code: Select all

-- Title: script_device_AlarmPanel.lua
-- Date: 19-11-2015
-- this scrip switches the Alarm Status according to the alarm panel
--
commandArray = {}
 
tc=next(devicechanged)
Panel=tostring(tc)
if (Panel == 'Keypad Alarm Level') then
--      set the group to the status of the switch
        if (devicechanged[Panel] == 'On') then
                print('AlarmPanel Arm Away')
                commandArray['Security Panel'] = 'Arm Away'
        else
                print('AlarmPanel Disarm')
                commandArray['Security Panel'] = 'Disarm'
                commandArray['Keypad Ack'] = 'On'
        end
end
return commandArray
Event "SirenDelay" - Device - triggers siren after 30sec:
sirendelay.png
sirendelay.png (21.59 KiB) Viewed 5842 times
Event "SoundSiren" - Device - actually enable the siren once the delay has passed:
soundsiren.png
soundsiren.png (37.83 KiB) Viewed 5842 times
Event "CancelSiren" - Security (!!!) - Cancel False Alarm by disarming while siren is active:
cancelsiren.png
cancelsiren.png (35.59 KiB) Viewed 5842 times
Continued in next post...
Till
Posts: 2
Joined: Saturday 07 January 2017 1:50
Target OS: Linux
Domoticz version:
Contact:

Re: Alarm system 'wiki'

Post by Till »

Continued:

OK, now we need to map our Virtual Siren to physical sirens...

Event "SirenON" (top) / "SirenOFF" (bottom) - Device:
sirenonoff.png
sirenonoff.png (28.53 KiB) Viewed 5841 times
Obviously, you can add other stuff here... Turn on lamps/cameras, etc.

Finally, we can reset the "AlarmDetected" virtual device on disarming - not strictly required, but this way the "AlarmDetected" device can also be used as a useful indicator:

Event "SirenON" (top) / "SirenOFF" (bottom) - Security (!!!):
resetalarm.png
resetalarm.png (14.14 KiB) Viewed 5841 times
I hope this helps some of you! Feedback welcome. If someone wants to update the Wiki based on this, or use it in any other way, feel free to do so.

All the best,
Till
AATP
Posts: 1
Joined: Tuesday 29 March 2016 22:25
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Alarm system 'wiki'

Post by AATP »

In the first post of this topic user heggink mentions that he uses the König SAS SA200. Could someone please describe how to get these smokedetectors in Domoticz? My rfxcom doesn't pick up the learning signal.

Thanks in advance!

--edit--

I've updated the firmware to version 1019. Then the smokedetector appeared:)
Last edited by AATP on Friday 02 June 2017 14:07, edited 1 time in total.
User avatar
heggink
Posts: 972
Joined: Tuesday 08 September 2015 21:44
Target OS: Raspberry Pi / ODroid
Domoticz version: 12451
Location: NL
Contact:

Re: Alarm system 'wiki'

Post by heggink »

Rfxcom did for me... Weird.
Docker in Truenas scale, close to latest beta
DASHTICZ 🙃
RFXCOM, zwavejs2mqtt, zigbee2mqtt,
P1 meter & solar panel
Google home, Wifi Cams motion detection
Geofence iCloud, Bluetooth & Wifi ping
Harmony hub, Nest, lots more :-)
Keleos
Posts: 29
Joined: Saturday 27 May 2017 9:37
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Alarm system 'wiki'

Post by Keleos »

Hi everyone,

I'm currently setting up my alarm system with the Tutorial of Till.

One Question: why the detour about the AlarmSirenTrigger? Would it not be the same to set the VirtualSiren on after 30 seconds instead of the AlarmSirenTrigger?

Greetings
Kel
franjorge
Posts: 1
Joined: Monday 28 August 2017 14:30
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Alarm system 'wiki'

Post by franjorge »

Hello,

I have configured Notifications on the devices as shown in the attached pictures.

¿Is there any way to disable the sending of those notifications when the system is 'disarmed' via the Security Panel?

I was thinking about a lua or blockly script to check the status of the system, and only if it is not 'disarmed' allow Domoticz to send notifications for all devices, but I have not been able to find a way to globally disable the sending of notifications.

Thanks,
Fran
Attachments
Captura.PNG
Captura.PNG (30.97 KiB) Viewed 5299 times
CyberE
Posts: 9
Joined: Monday 25 June 2018 17:46
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: NL
Contact:

Re: Alarm system 'wiki'

Post by CyberE »

Till wrote: Monday 29 May 2017 17:54
Spoiler: show
Hi,
heggink wrote:All,

IMPORTANT: The original WIKI was created when domoticz still recognised changes in user variables and was able to trigger events. That is no longer the case. User variables need to be replaced with dummy devices instead.
I had a lot of issues getting the alarm system to work well with the current stable Domoticz release. Now it seems to work. I'd like to document here what I've done, to help others (and prevent them from wasting several hours, like I did...). Feedback is welcome.

My conventions:
- All "Door" sensors have names that start with "Door" ("MCS_" in the original version)
- All motion sensors have names that start with "Motion" ("PIR_" in the original version)

I created the following dummy devices (Virtual Switches):
- "AlarmDetected": Becomes Active when an alarm is detected
- "VirtualSiren": The device that triggers physical siren(s). Using a virtual device for this makes it easier to support multiple sirens/signaling devices, and solves some other problems. "Sirene: Innen" is my physical siren.
- "AlarmSirenTrigger": Used for the siren delay

The original LUA code has only been modified slightly. Here it is:

Event "MotionAlarm" - Device:

Code: Select all

-- Title: script_device_PIRAlarm.lua
-- Date: 12-11-2015
-- checks for PIR during Alarm Away status
-- if detected then alert and set the alarm flag
-- 
 
commandArray = {}
 
tc=next(devicechanged)
PIR_switch=tostring(tc)
if (PIR_switch:sub(1,6) == 'Motion') then
	if(otherdevices['Security Panel'] == 'Arm Away') then
		print('Movement detected on '..PIR_switch)
		-- commandArray['SendNotification']='Movement detected on '..PIR_switch
		commandArray['Variable:LastAlarmDevice'] = 'Detected movement on '..PIR_switch
		commandArray['AlarmDetected']='On'
	end
end
 
return commandArray
Event "DoorAlarm" - Device:

Code: Select all

-- Title: script_device_MCSAlarm.lua
-- Date: 12-11-2015
-- checks for MCS during Alarm Away status
-- if detected then alert and set the alarm flag
 
commandArray = {}
 
tc=next(devicechanged)
MCS_switch=tostring(tc)
if (MCS_switch:sub(1,4) == 'Door') then
	if(otherdevices['Security Panel'] == 'Arm Away') then
		print('Door open/close detected for '..MCS_switch)
		commandArray['Variable:LastAlarmDevice'] = 'Detected door open/close on '..MCS_switch
		-- commandArray['SendNotification']='Door open/close detected for '..MCS_switch
		commandArray['AlarmDetected']='On'
	end
end
 
return commandArray
Event "KeypadAlarm" - Device:

Code: Select all

-- Title: script_device_AlarmPanel.lua
-- Date: 19-11-2015
-- this scrip switches the Alarm Status according to the alarm panel
--
commandArray = {}
 
tc=next(devicechanged)
Panel=tostring(tc)
if (Panel == 'Keypad Alarm Level') then
--      set the group to the status of the switch
        if (devicechanged[Panel] == 'On') then
                print('AlarmPanel Arm Away')
                commandArray['Security Panel'] = 'Arm Away'
        else
                print('AlarmPanel Disarm')
                commandArray['Security Panel'] = 'Disarm'
                commandArray['Keypad Ack'] = 'On'
        end
end
return commandArray
Event "SirenDelay" - Device - triggers siren after 30sec:
sirendelay.png

Event "SoundSiren" - Device - actually enable the siren once the delay has passed:
soundsiren.png

Event "CancelSiren" - Security (!!!) - Cancel False Alarm by disarming while siren is active:
cancelsiren.png

Continued in next post...
Hey guys, I've been using this solution for quite some time now, but with the slight change in some blocky's. I never got the user variable to work in a HTTP notification. It always results in an empty error (2018-06-27 06:29:50.501 Error: HTTP:) in the log. As I said, i've been using this solution, but with static texts instead of the wanted user variable. Do you guys found a way around it, or is this just a shortcoming of Domoticz?
CyberE
Posts: 9
Joined: Monday 25 June 2018 17:46
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: NL
Contact:

Re: Alarm system 'wiki'

Post by CyberE »

CyberE wrote: Wednesday 27 June 2018 7:06
Till wrote: Monday 29 May 2017 17:54
Spoiler: show
Hi,
heggink wrote:All,

IMPORTANT: The original WIKI was created when domoticz still recognised changes in user variables and was able to trigger events. That is no longer the case. User variables need to be replaced with dummy devices instead.
I had a lot of issues getting the alarm system to work well with the current stable Domoticz release. Now it seems to work. I'd like to document here what I've done, to help others (and prevent them from wasting several hours, like I did...). Feedback is welcome.

My conventions:
- All "Door" sensors have names that start with "Door" ("MCS_" in the original version)
- All motion sensors have names that start with "Motion" ("PIR_" in the original version)

I created the following dummy devices (Virtual Switches):
- "AlarmDetected": Becomes Active when an alarm is detected
- "VirtualSiren": The device that triggers physical siren(s). Using a virtual device for this makes it easier to support multiple sirens/signaling devices, and solves some other problems. "Sirene: Innen" is my physical siren.
- "AlarmSirenTrigger": Used for the siren delay

The original LUA code has only been modified slightly. Here it is:

Event "MotionAlarm" - Device:

Code: Select all

-- Title: script_device_PIRAlarm.lua
-- Date: 12-11-2015
-- checks for PIR during Alarm Away status
-- if detected then alert and set the alarm flag
-- 
 
commandArray = {}
 
tc=next(devicechanged)
PIR_switch=tostring(tc)
if (PIR_switch:sub(1,6) == 'Motion') then
	if(otherdevices['Security Panel'] == 'Arm Away') then
		print('Movement detected on '..PIR_switch)
		-- commandArray['SendNotification']='Movement detected on '..PIR_switch
		commandArray['Variable:LastAlarmDevice'] = 'Detected movement on '..PIR_switch
		commandArray['AlarmDetected']='On'
	end
end
 
return commandArray
Event "DoorAlarm" - Device:

Code: Select all

-- Title: script_device_MCSAlarm.lua
-- Date: 12-11-2015
-- checks for MCS during Alarm Away status
-- if detected then alert and set the alarm flag
 
commandArray = {}
 
tc=next(devicechanged)
MCS_switch=tostring(tc)
if (MCS_switch:sub(1,4) == 'Door') then
	if(otherdevices['Security Panel'] == 'Arm Away') then
		print('Door open/close detected for '..MCS_switch)
		commandArray['Variable:LastAlarmDevice'] = 'Detected door open/close on '..MCS_switch
		-- commandArray['SendNotification']='Door open/close detected for '..MCS_switch
		commandArray['AlarmDetected']='On'
	end
end
 
return commandArray
Event "KeypadAlarm" - Device:

Code: Select all

-- Title: script_device_AlarmPanel.lua
-- Date: 19-11-2015
-- this scrip switches the Alarm Status according to the alarm panel
--
commandArray = {}
 
tc=next(devicechanged)
Panel=tostring(tc)
if (Panel == 'Keypad Alarm Level') then
--      set the group to the status of the switch
        if (devicechanged[Panel] == 'On') then
                print('AlarmPanel Arm Away')
                commandArray['Security Panel'] = 'Arm Away'
        else
                print('AlarmPanel Disarm')
                commandArray['Security Panel'] = 'Disarm'
                commandArray['Keypad Ack'] = 'On'
        end
end
return commandArray
Event "SirenDelay" - Device - triggers siren after 30sec:
sirendelay.png

Event "SoundSiren" - Device - actually enable the siren once the delay has passed:
soundsiren.png

Event "CancelSiren" - Security (!!!) - Cancel False Alarm by disarming while siren is active:
cancelsiren.png

Continued in next post...
Hey guys, I've been using this solution for quite some time now, but with the slight change in some blocky's. I never got the user variable to work in a HTTP notification. It always results in an empty error (2018-06-27 06:29:50.501 Error: HTTP:) in the log. As I said, i've been using this solution, but with static texts instead of the wanted user variable. Do you guys found a way around it, or is this just a shortcoming of Domoticz?
After looking to the scripts again and again, I finally figured out what was wrong...

Code: Select all

commandArray['Variable:LastAlarmDevice'] = 'Detected door open/close on '..MCS_switch
The "/" in this line can not be used in a http notification and results in an empty error, because the http url is manipulated into something it can not process, due to the slash.
rednas
Posts: 132
Joined: Tuesday 20 October 2015 12:23
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Netherlands
Contact:

Re: Alarm system 'wiki'

Post by rednas »

Maybe a silly question, but what does MCS mean?
peterchef
Posts: 37
Joined: Sunday 03 January 2016 17:49
Target OS: Windows
Domoticz version: 2024.4
Location: France
Contact:

Re: Alarm system 'wiki'

Post by peterchef »

MCS = 'magnetic contact switch' (i think)
Windows, Domoticz
Aeotec Z-Stick Gen5, Aeotec Multisensor 6, Horstmann HRT4-ZW Thermostat Transmitter, Horstmann ASR-ZW Thermostat Receiver
Zipato Mini Keypad RFID, Everspring AN157 Plug
rednas
Posts: 132
Joined: Tuesday 20 October 2015 12:23
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Netherlands
Contact:

Re: Alarm system 'wiki'

Post by rednas »

Nice one! Really couldn't figure out what it would mean :lol:
User avatar
heggink
Posts: 972
Joined: Tuesday 08 September 2015 21:44
Target OS: Raspberry Pi / ODroid
Domoticz version: 12451
Location: NL
Contact:

Re: Alarm system 'wiki'

Post by heggink »

Nice one indeed. I started this thread and even I could not remember why I chose that in the beginning. At some point I switched to pir and dws (door window sensor). Maybe I can now switch back again lol .
Anyway, the idea was to help people with a generic approach building a simple, extensible system. I hope that still applies.
Docker in Truenas scale, close to latest beta
DASHTICZ 🙃
RFXCOM, zwavejs2mqtt, zigbee2mqtt,
P1 meter & solar panel
Google home, Wifi Cams motion detection
Geofence iCloud, Bluetooth & Wifi ping
Harmony hub, Nest, lots more :-)
lost
Posts: 616
Joined: Thursday 10 November 2016 9:30
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Alarm system 'wiki'

Post by lost »

heggink wrote: Monday 19 November 2018 11:14 Anyway, the idea was to help people with a generic approach building a simple, extensible system. I hope that still applies.
I started building my own alarm system, using this easily extensible naming convention based system, almost 2 years ago. Could add sensors with no hassle since then... I added some other ideas read on the forum as well as of my own, especially to deal with outdoor or "not so reliable" sensors.

I added a few other name prefix like "cam" (linked to virtual PIRs fed by cameras movement captures on both sides of my house) or "prm" (perimeter sensors, like outdoor PIRs)...

And every sensor category is assigned a weight and those that trigger add their weight in a user variable on a 1mn time slice. This way, internal/reliable sensors have a base weight that immediately trigger alarm and external ones only contribute to a fraction of the alarm trigger level (thus a bird/cat...spider...) passing by will not ring the bells... but someone working on a door/window for more than 20s will!

So this have become a bit more complex, due to outdoor sensors mainly, but your base idea is at the heart of my system!
jonluk
Posts: 8
Joined: Friday 10 February 2017 9:56
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: Alarm system 'wiki'

Post by jonluk »

I'm in the process of setting up my alarm system.
initially I was thinking to use my wall tablet to actually arm the alarm.
But what I wanted was once the arm code was entered (and the 30 second count down begun) scripts would go off and check the status of various sensors. So if say a window had been left open the user could be prompted to close it before the alarm would actually activate.
I can't see any variables or any states that change prior to the alarm actually arming - is that the case ?
With an external panel I think I could set a dummy switch so that scripts will run and also have a count down - beeps would be sent to my siren.
Once the count down is complete and IF the house is secure THEN the alarm status could be changed to armed. I think this would work.
marktn
Posts: 233
Joined: Tuesday 21 April 2015 21:39
Target OS: Windows
Domoticz version:
Contact:

Re: Alarm system 'wiki'

Post by marktn »

Hi,

When the alarm is disarmed, is there a way to get automatic back to my dashboard?

Best regard
Mark
Domoticz latest stable, Intel NUC, Proxmox, Zigate, RFLink, Kaku switches, Ikea lights, Xiaomi sensors, Honeywell smoke detectors, Yeelight, Shelly, Slave Domoticz PI 3B+, Node-Red, Espeasy.
kimhav
Posts: 148
Joined: Tuesday 01 October 2013 8:31
Target OS: Raspberry Pi / ODroid
Domoticz version: 2023.2
Location: Sweden
Contact:

Re: Alarm system 'wiki'

Post by kimhav »

What zwave keypads would be th recommend choice if one would buy something today?
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests