Page 5 of 5

Re: Alarm system 'wiki'

Posted: Sunday 04 December 2016 7:21
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

Re: Alarm system 'wiki'

Posted: Sunday 04 December 2016 8:46
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?

Re: Alarm system 'wiki'

Posted: Sunday 04 December 2016 9:31
by Egregius
Just the buttons, nothing automatic cause I didn't find anything yet that is 100% stable.

Re: Alarm system 'wiki'

Posted: Sunday 18 December 2016 8:38
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

Re: Alarm system 'wiki'

Posted: Monday 29 May 2017 17:54
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 6464 times
Event "SoundSiren" - Device - actually enable the siren once the delay has passed:
soundsiren.png
soundsiren.png (37.83 KiB) Viewed 6464 times
Event "CancelSiren" - Security (!!!) - Cancel False Alarm by disarming while siren is active:
cancelsiren.png
cancelsiren.png (35.59 KiB) Viewed 6464 times
Continued in next post...

Re: Alarm system 'wiki'

Posted: Monday 29 May 2017 17:59
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 6463 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 6463 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

Re: Alarm system 'wiki'

Posted: Friday 02 June 2017 13:03
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:)

Re: Alarm system 'wiki'

Posted: Friday 02 June 2017 13:44
by heggink
Rfxcom did for me... Weird.

Re: Alarm system 'wiki'

Posted: Sunday 18 June 2017 13:51
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

Re: Alarm system 'wiki'

Posted: Monday 28 August 2017 14:44
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

Re: Alarm system 'wiki'

Posted: Wednesday 27 June 2018 7:06
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?

Re: Alarm system 'wiki'

Posted: Friday 27 July 2018 14:55
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.

Re: Alarm system 'wiki'

Posted: Friday 16 November 2018 14:03
by rednas
Maybe a silly question, but what does MCS mean?

Re: Alarm system 'wiki'

Posted: Saturday 17 November 2018 15:04
by peterchef
MCS = 'magnetic contact switch' (i think)

Re: Alarm system 'wiki'

Posted: Monday 19 November 2018 8:25
by rednas
Nice one! Really couldn't figure out what it would mean :lol:

Re: Alarm system 'wiki'

Posted: Monday 19 November 2018 11:14
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.

Re: Alarm system 'wiki'

Posted: Tuesday 20 November 2018 9:47
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!

Re: Alarm system 'wiki'

Posted: Wednesday 12 December 2018 16:19
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.

Re: Alarm system 'wiki'

Posted: Thursday 24 December 2020 22:06
by marktn
Hi,

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

Best regard
Mark

Re: Alarm system 'wiki'

Posted: Tuesday 30 January 2024 20:09
by kimhav
What zwave keypads would be th recommend choice if one would buy something today?