Page 3 of 5

Re: Alarm system 'wiki'

Posted: Monday 22 February 2016 13:00
by JanKarel
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

Re: Alarm system 'wiki'

Posted: Monday 22 February 2016 15:35
by JanKarel
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

Re: Alarm system 'wiki'

Posted: Sunday 06 March 2016 20:45
by starfish001
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

Re: Alarm system 'wiki'

Posted: Saturday 12 March 2016 11:33
by MartinH
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?

Re: Alarm system 'wiki'

Posted: Sunday 13 March 2016 16:56
by Machielw
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?

Re: Alarm system 'wiki'

Posted: Sunday 20 March 2016 22:39
by rgouyet
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

Re: Alarm system 'wiki'

Posted: Tuesday 22 March 2016 23:22
by starfish001
@ rgouyet is your script correct - the name is probably Security Panel

Re: Alarm system 'wiki'

Posted: Saturday 26 March 2016 16:07
by Gravityz
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

Re: Alarm system 'wiki'

Posted: Monday 18 April 2016 23:33
by rgouyet
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 ?

Re: Alarm system 'wiki'

Posted: Thursday 21 April 2016 9:05
by spyseiko
@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.

Re: Alarm system 'wiki'

Posted: Thursday 18 August 2016 0:25
by PABben
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)

Re: Alarm system 'wiki'

Posted: Friday 19 August 2016 16:25
by heggink
Not sure. Can you post the entire script please? devicechanged should be an internal array and it's not recognised.

Re: Alarm system 'wiki'

Posted: Sunday 21 August 2016 15:41
by PABben
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

Re: Alarm system 'wiki'

Posted: Sunday 21 August 2016 15:50
by jvdz
It appears every minute.
You probably still have "All" selected under LUA in stead of "Device".

Jos

Re: Alarm system 'wiki'

Posted: Monday 22 August 2016 9:25
by PABben
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.

Re: Alarm system 'wiki'

Posted: Monday 22 August 2016 19:42
by jvdz
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

Re: Alarm system 'wiki'

Posted: Monday 22 August 2016 19:52
by heggink
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

Re: Alarm system 'wiki'

Posted: Sunday 30 October 2016 7:47
by tyfoon
@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)

Re: Alarm system 'wiki'

Posted: Sunday 30 October 2016 9:19
by heggink
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

Re: Alarm system 'wiki'

Posted: Sunday 30 October 2016 10:17
by tyfoon
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?