Alarm system 'wiki'

In this subforum you can show projects you have made, or you are busy with. Please create your own topic.
JanKarel
Posts: 6
Joined: Thursday 18 February 2016 19:15
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Alarm system 'wiki'

Post by JanKarel » Monday 22 February 2016 14:00

Hello heggink, Unfortunately a few weeks ago I tried to follow up on your wiki whilst not being aware of the existence of this topic and so I ran into the same problems as described here, i.e., only execution of the lua script but no subsequent triggering of the blocky events. Nevertheless, I would be very interested in testing your adapted and upgraded alarm system wiki once available.

JanKarel

JanKarel
Posts: 6
Joined: Thursday 18 February 2016 19:15
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Alarm system 'wiki'

Post by JanKarel » Monday 22 February 2016 16:35

I have a few questions regards the presented blocklies To spyseiko, is yours still set up in combination with a lua script since otherwise I may not understand what turns on your AlarmDetect switch? To maomanno,is your system now only blockly based and could your earlier comment of a less well performing fibaro smoke sensor be related to that it perhaps requires a not on but panic status descriptor?

JanKarel

starfish001
Posts: 19
Joined: Monday 29 February 2016 0:54
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Alarm system 'wiki'

Post by starfish001 » Sunday 06 March 2016 21:45

Great thread - found this very helpful

I'm having some issues with the Zipato wt-rfid.eu Mini RFID/Z-Wave Keyboard - seems to be integrate correctly and tags work but if I arm and then disarm after a couple of minutes the keypad indicator light goes solid red and the tag does not seem to work. If I wait it seems to work again. I kno it is only a test but not ideal.


Also how are people implementing different alarm profiles - PIR + Door or perhaps just Door are you using two keypads or a different pad

MartinH
Posts: 2
Joined: Wednesday 01 July 2015 8:04
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Alarm system 'wiki'

Post by MartinH » Saturday 12 March 2016 12:33

Hi peoples,

I'm new, and almost there with my setup - but I have some probloms.

I'm using the Community Alarm Script v1.0 and it does alert me on my iphone, using Pilot (Domoticz) app perfectly, also alerts me via E-mail. (All sensors working both doors sensors, and Pir sensors)

It also sets my virtuel switch on when motion or door is opened up (vsAlarmDetected)

But i cant seem to get my Events working, so it is working as wrote in the " Community Alarm Script v1.0" im, messing the grafical guidelines for the Events - i need it to work like this:

Blocky:
- Alarm_Detected_Events - This is responsible for the siren and notification
action once Lua parses the device events.
vsAlarmDetected set by Lua is the trigger
- Alarm_Trigger_Sirens - Triggered by the On status of vsSirenTrigger; resp-
onsible for the possible firing of the siren. The
time delay introduced by the previous Blocky gives
users time to disarm before this sets the virtual
switch svFireSiren to ON
- Alarm_Acivate_Sirens - Triggered by svFireSiren. It will send an email notif-
ication to indicate the siren is on and will proceed
to set the virtual switches used here to Off.
- Alarm_Reset_Disarm - When security system is disarmed, it clears all
virtual switches used. It also turns off the siren
if it's accidentally trigged (ie, the delay is
insufficient to disarm the system due to the groceries
and key fumbling)

I'm so close, what's wrong?
Attachments
3.png
3.png (236.08 KiB) Viewed 4209 times
2.png
2.png (64.22 KiB) Viewed 4209 times
1.jpg
1.jpg (90.48 KiB) Viewed 4209 times

Machielw
Posts: 15
Joined: Saturday 23 January 2016 12:32
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Alarm system 'wiki'

Post by Machielw » Sunday 13 March 2016 17:56

Need some help

I am using this script
the line: device = next(devicechanged)
leads to this in the log:
2016-03-13 16:54:00.508 Error: EventSystem: in test alarm: [string "--[[ ..."]:100: bad argument #1 to 'next' (table expected, got nil)
It appears every minute.
The script is working fine for now.
can sombody tell me what is wrong?

rgouyet
Posts: 12
Joined: Friday 02 October 2015 8:23
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Alarm system 'wiki'

Post by rgouyet » Sunday 20 March 2016 23:39

I tried to set up my security system as describe here and in the wikihttp://www.domoticz.com/wiki/Alarm_Setup but the "security status" seems not updated when the "Security Panel" object is updated by script.

I have the Domoticz Internal "Security Panel" object in my list of devices.

If I use the security panel and I change the state (Arm or disarm) , the "security status" value is updated and I can fire script on this change.

If I use a script to update the Domoticz Internal "Security Panel" object with

Code: Select all

commandArray['Domoticz Security Panel'] = 'Arm Away'
or

Code: Select all

commandArray['Domoticz Security Panel'] = 'Disarm'
. Then the Domoticz Security Panel display the new value but the "security status" is not updated.

Then I can't use blocky script based on the "security status" value as describe in the wiki http://www.domoticz.com/wiki/Alarm_Setup

starfish001
Posts: 19
Joined: Monday 29 February 2016 0:54
Target OS: Raspberry Pi
Domoticz version:
Contact:

Re: Alarm system 'wiki'

Post by starfish001 » Wednesday 23 March 2016 0:22

@ rgouyet is your script correct - the name is probably Security Panel

Gravityz
Posts: 273
Joined: Wednesday 16 December 2015 20:13
Target OS: NAS (Synology & others)
Domoticz version: V3.8637
Location: Netherlands
Contact:

Re: Alarm system 'wiki'

Post by Gravityz » Saturday 26 March 2016 17:07

nice thread(if it is still alive)

found out resendly regarding the variables not triggering anything anymore

i however also found out that a PIR sensor sends 2 triggers, one ON and one OFF

you need to revise the lua script so that it only triggers when the PIR goes ON and not again when going off.
The fibaro motion sensor at least works this way so no harm in implementing this, even if yours only sends an ON
this is the change you need to make.(you can add te message commands, i deleted them)
commandArray = {}
tc=next(devicechanged)
PIR_switch=tostring(tc)
if (PIR_switch:sub(1,3) == 'PIR') and (devicechanged[PIR_switch] == 'On') then
if(otherdevices['Security Panel'] == 'Arm Away') then
commandArray['Variable:AlarmDetected'] = '1'
end
end
return commandArray

rgouyet
Posts: 12
Joined: Friday 02 October 2015 8:23
Target OS: NAS (Synology & others)
Domoticz version:
Contact:

Re: Alarm system 'wiki'

Post by rgouyet » Monday 18 April 2016 23:33

Hi @starfish001
I changed the name from "Domoticz Security Panel" to "Security Panel'" but it didn't change anything...


Hi @Gravityz,
Thanks for the "On" statuc check to avoid twice alerts.


Do you confirm the "security status" variable is no more updated ?

spyseiko
Posts: 12
Joined: Tuesday 05 January 2016 15:51
Target OS: Raspberry Pi
Domoticz version: V2.4967
Contact:

Re: Alarm system 'wiki'

Post by spyseiko » Thursday 21 April 2016 9:05

@JanKarel
I don't use lua scripts, but you're right. The motiondetection blockly is not correct. This should be the correct one, where the AlarmDetect is triggered and reset.
Attachments
MotionDetection.JPG
MotionDetection.JPG (76.96 KiB) Viewed 3923 times

PABben
Posts: 82
Joined: Friday 31 January 2014 15:32
Target OS: Windows
Domoticz version:
Location: Norway
Contact:

Re: Alarm system 'wiki'

Post by PABben » Thursday 18 August 2016 0:25

Machielw wrote:Need some help

I am using this script
the line: device = next(devicechanged)
leads to this in the log:
2016-03-13 16:54:00.508 Error: EventSystem: in test alarm: [string "--[[ ..."]:100: bad argument #1 to 'next' (table expected, got nil)
It appears every minute.
The script is working fine for now.
can sombody tell me what is wrong?
I'm getting the same. (removed the "commented out" lines on two lua scripts to see if that was the problem)

Any hints?

2016-08-18 00:21:55.617 Alarm aktivert!
2016-08-18 00:21:55.617 EventSystem: Event triggered: Alarm - Aktivert_1
2016-08-18 00:21:55.620 Error: EventSystem: in Bevegelse-alarm: [string "-- Title: script_device_PIRAlarm.lua ..."]:9: bad argument #1 to 'next' (table expected, got nil)
2016-08-18 00:21:55.623 Error: EventSystem: in (LUA) Skall-alarm: [string "commandArray = {} ..."]:3: bad argument #1 to 'next' (table expected, got nil)
2016-08-18 00:21:55.627 Error: EventSystem: in (LUA) Bevegelse-alarm: [string "commandArray = {} ..."]:3: bad argument #1 to 'next' (table expected, got nil)
2016-08-18 00:21:55.627 (Domoticz Internal) Security (Alarm)

User avatar
heggink
Posts: 588
Joined: Tuesday 08 September 2015 21:44
Target OS: Raspberry Pi
Domoticz version: V4.9999
Location: NL
Contact:

Re: Alarm system 'wiki'

Post by heggink » Friday 19 August 2016 16:25

Not sure. Can you post the entire script please? devicechanged should be an internal array and it's not recognised.
Pi3, latest beta
RFXCOM, z-wave (AEOTEC, switches, temhum, pir, contacts),
Plugwise2py, P1 'smart'meter & solar panel
Alexa, Wifi Cams motion detection
ESP: relays, PIR & Temp/TempHum
Geofence iCloud, Bluetooth & Wifi ping
Harmony hub, Nest

PABben
Posts: 82
Joined: Friday 31 January 2014 15:32
Target OS: Windows
Domoticz version:
Location: Norway
Contact:

Re: Alarm system 'wiki'

Post by PABben » Sunday 21 August 2016 15:41

heggink wrote:Not sure. Can you post the entire script please? devicechanged should be an internal array and it's not recognised.
Sure. Here they are :)

Spoiler: show

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,3) == 'PIR') and (devicechanged[PIR_switch] == 'On') then
	if(otherdevices['Security Panel'] == 'Arm Away') then
		print('PIR motion detected:'..PIR_switch)
		commandArray['SendNotification']='PIR motion detected:'..PIR_switch
		commandArray['Variable:AlarmDetected'] = '1'
	end
end
 
return commandArray

Code: Select all

commandArray = {}
 
tc=next(devicechanged)
MCS_switch=tostring(tc)
if (MCS_switch:sub(1,3) == 'MCS') then
	if(otherdevices['Security Panel'] == 'Arm Away') then
		print('MCS motion detected:'..MCS_switch)
		commandArray['SendNotification']='MCS motion detected:'..MCS_switch
		commandArray['Variable:AlarmDetected'] = '1'
	end
end
 
return commandArray

User avatar
jvdz
Posts: 1423
Joined: Tuesday 30 December 2014 20:25
Target OS: Raspberry Pi
Domoticz version: Stable
Location: Westland/Netherlands
Contact:

Re: Alarm system 'wiki'

Post by jvdz » Sunday 21 August 2016 15:50

It appears every minute.
You probably still have "All" selected under LUA in stead of "Device".

Jos

PABben
Posts: 82
Joined: Friday 31 January 2014 15:32
Target OS: Windows
Domoticz version:
Location: Norway
Contact:

Re: Alarm system 'wiki'

Post by PABben » Monday 22 August 2016 9:25

jvdz wrote:
It appears every minute.
You probably still have "All" selected under LUA in stead of "Device".

Jos
I assumed that selection was a sorting feature. Changed mine to "device" and i don't get any errors anymore, but the LUA does'nt activate the uservariable though. My sensors are named "PIR_name" and "MSC_name".
The "AlarmActive" variable changes as it is supposed to.

User avatar
jvdz
Posts: 1423
Joined: Tuesday 30 December 2014 20:25
Target OS: Raspberry Pi
Domoticz version: Stable
Location: Westland/Netherlands
Contact:

Re: Alarm system 'wiki'

Post by jvdz » Monday 22 August 2016 19:42

PABben wrote:I Changed mine to "device" and i don't get any errors anymore, but the LUA does'nt activate the uservariable though. My sensors are named "PIR_name" and "MSC_name".
The "AlarmActive" variable changes as it is supposed to.
So you mean that no events are triggered when a UserVariable is changed in LUA? If so, that is working as designed as far as I understand and is documented in the Events Wiki page.

Jos

User avatar
heggink
Posts: 588
Joined: Tuesday 08 September 2015 21:44
Target OS: Raspberry Pi
Domoticz version: V4.9999
Location: NL
Contact:

Re: Alarm system 'wiki'

Post by heggink » Monday 22 August 2016 19:52

Hi Jos,

Correct. After I created the wiki, domoticz behaviour changed such that changes in variables no longer trigger events. Since then I have not had the time to change the wiki.

Easiest is to replace variables with dummy devices and check those. That should be a simple change. At some point I will update the wiki.

H
Pi3, latest beta
RFXCOM, z-wave (AEOTEC, switches, temhum, pir, contacts),
Plugwise2py, P1 'smart'meter & solar panel
Alexa, Wifi Cams motion detection
ESP: relays, PIR & Temp/TempHum
Geofence iCloud, Bluetooth & Wifi ping
Harmony hub, Nest

tyfoon
Posts: 4
Joined: Tuesday 15 March 2016 10:17
Target OS: Windows
Domoticz version:
Contact:

Re: Alarm system 'wiki'

Post by tyfoon » Sunday 30 October 2016 8:47

@Heggink Have you ever been able to arm/disarm the panel via the controller (without touching the pad)?

I think this is a quit crucial ability as my current alarm all works via presence of phones and is very solid. The Panel is an overide for me (eg when the cleaning lady comes) or the phone is broken. But I want to keep them in sync with each other (eg. set the panel in away mode automatically when all are away)

User avatar
heggink
Posts: 588
Joined: Tuesday 08 September 2015 21:44
Target OS: Raspberry Pi
Domoticz version: V4.9999
Location: NL
Contact:

Re: Alarm system 'wiki'

Post by heggink » Sunday 30 October 2016 10:19

I have taken a different approach. Created a main (dummy) switch that switches the alarm on/off (called it TAO) . Everything goes through this switch so I don't use the domoticz alarm panel to switch on/off. This way, it does not matter what state the keypad is in and I can use any mechanism to easily switch on/off through any means (blocky, script, lua). It's no security risk for me since my router does not do any port forwarding, dnz or pnp (I VPN into my home with openvpn).

Verstuurd vanaf mijn HUAWEI NXT-L29 met Tapatalk
Pi3, latest beta
RFXCOM, z-wave (AEOTEC, switches, temhum, pir, contacts),
Plugwise2py, P1 'smart'meter & solar panel
Alexa, Wifi Cams motion detection
ESP: relays, PIR & Temp/TempHum
Geofence iCloud, Bluetooth & Wifi ping
Harmony hub, Nest

tyfoon
Posts: 4
Joined: Tuesday 15 March 2016 10:17
Target OS: Windows
Domoticz version:
Contact:

Re: Alarm system 'wiki'

Post by tyfoon » Sunday 30 October 2016 11:17

I was thinking about the same but can't figure out what do do when the alarm mode get's out of sync with the panel as I only want to use the panel when there are individuals that are not part of my general home/away atomation. Example:

- All phones away for x time and no motion for x time>> Assuming all away >> House mode away, alarm mode away (nobody touches the panel and I as I know people will forget and it's an extra thing to do, I don't want people to touch the panel)
- Cleaning lady comes >>> uses Zipato pad with correct RFID >> House mode still Away, Alarm mode off
- Cleaning lady goes away and forget's to use the tag/set away mode in panel

- Now I'm out of sync.

From an automation perspective I could still put the alarm mode on again (no motion, no doors for x , still no phones > set away & alarm mode on again) but the panel still has 'disarm'.

- Then cleaning lady comes again after a few days, house mode is Away and alarm is also in away mode. She enters but a using her correct RFID tag will have no effect as the Panel is still in disarm mode (so no state change). With alarm still in away, alarm will sound...[/list]

If it was just the cleaning lady I could probably handle but there are several other guests like the ironing lady, mother in law etc.

How did you solve this dilemma?

Post Reply

Who is online

Users browsing this forum: No registered users and 5 guests