Page 1 of 1

Testers wanted for ideAlarm (A dzVents multi zone alarm script)

Posted: Wednesday 09 August 2017 8:47
by BakSeeDaa
Greetings!

I've been working some time now utilizing the lovely dzVents Lua scripting environment to make a multi zone alarm.

The project is named ideAlarm. The goal is to make it as generic as possible and highly customizable. It supports up to 9 individual alarm zones.

It can be found at https://github.com/BakSeeDaa/ideAlarm/wiki

Would you care to try it out?

Except for testers, all kind of project collaborators are also welcomed. Maybe you are a native english speaker and you feel that the wiki can be improved (I'm sure it can be) or you are a coder and can contribute by adding functionality or renaming the functions or whatever...

Until dzVents 2.3.0 is released and ideAlarm is updated to use it, ideAlarm will only work on linux systems.

In case you find any issues or have any suggestions etc please report them at https://github.com/BakSeeDaa/ideAlarm/issues
In case you have any questions you can just post them as issues too, and label them "Question". If You don't have a gitHub account you can post your question as a reply to this thread.

Cheers!

Re: Testers wanted for ideAlarm (A dzVents multi zone alarm script)

Posted: Wednesday 09 August 2017 9:31
by EdwinK
Looks like a script I would like to use, once I have a better understanding of dzEvents.

Re: Testers wanted for ideAlarm (A dzVents multi zone alarm script)

Posted: Wednesday 09 August 2017 14:07
by EdwinK
Mmm... It seems to switch (no siren or sensors added yet)

Code: Select all

2017-08-09 14:01:21.233 dzVents: Info: Handling events for: "Toggle Z1 Arm Away", value: "Off"
2017-08-09 14:01:21.233 dzVents: Info: ideAlarm V0.9.22: ------ Start external script: alarm.lua: Device: "Toggle Z1 Arm Away (ALARM)", Index: 190
2017-08-09 14:01:21.289 dzVents: Info: ideAlarm V0.9.22: ------ Finished alarm.lua
2017-08-09 14:01:39.650 User: Admin initiated a switch command (191/Toggle Z1 Arm HOME/On)
2017-08-09 14:02:24.844 User: Admin initiated a switch command (191/Toggle Z1 Arm HOME/Off)
2017-08-09 14:02:27.582 User: Admin initiated a switch command (190/Toggle Z1 Arm Away/On)
2017-08-09 14:02:27.772 dzVents: Info: Handling events for: "Toggle Z1 Arm Away", value: "On"
2017-08-09 14:02:27.773 dzVents: Info: ideAlarm V0.9.22: ------ Start external script: alarm.lua: Device: "Toggle Z1 Arm Away (ALARM)", Index: 190
2017-08-09 14:02:27.774 dzVents: Info: ideAlarm V0.9.22: triggerType toggleSwitch
2017-08-09 14:02:27.819 dzVents: Info: ideAlarm V0.9.22: ------ Finished alarm.lua
Text switches not updated
187 -= Armed Away
188 -> Armed Home
190 -> Toggle Away
191 -> Toggle Home

190 and 191 are switches, 187 and 188 are text switches.

Re: Testers wanted for ideAlarm (A dzVents multi zone alarm script)

Posted: Wednesday 09 August 2017 14:08
by EdwinK
Re-reading I see differnt numbers now. Gong to fix that first.

Didn't seem to change. Need to figure out more

Re: Testers wanted for ideAlarm (A dzVents multi zone alarm script)

Posted: Wednesday 09 August 2017 14:19
by BakSeeDaa
EdwinK wrote: Wednesday 09 August 2017 14:08 Re-reading I see differnt numbers now. Gong to fix that first.

Didn't seem to change. Need to figure out more
armAwayTogglesNeeded: (Required) How many times the switch should be toggled within one minutes to activate. Set this to 1 if the switch is a virtual switch device. This is typically set higher than 1 only when the armAwayToggleBtn is a physical device. Valid range: 1-9. Default setting: 1.
Please check this value. Please also set a 2 second off delay on the 2 virtual switches. If it still doesn't work, can you post your configuration file?

Wiki has been updated regarding this.

Re: Testers wanted for ideAlarm (A dzVents multi zone alarm script)

Posted: Wednesday 09 August 2017 17:29
by EdwinK

Code: Select all

--[[
Edit this file suit your needs 
-- Create the folder /path/to/domoticz/scripts/dzVents/modules (if it not already exists)
-- and place this file in that folder by the name ideAlarmConfig.lua

-- See https://github.com/allan-gam/ideAlarm/wiki/configuration
-- After editing, always verify that it's valid LUA at http://codepad.org/ (Mark your paste as "Private"!!!)
--]]

local _C = {}

local SENSOR_CLASS_A = 'a' -- Sensor can be triggered in both arming modes. E.g. "Armed Home" and "Armed Away".
local SENSOR_CLASS_B = 'b' -- Sensor can be triggered in arming mode "Armed Away" only.

--[[
-------------------------------------------------------------------------------
DO NOT ALTER ANYTHING ABOVE THIS LINE
-------------------------------------------------------------------------------
--]]

_C.ALARM_TEST_MODE = false -- if ALARM_TEST_MODE is set to true it will prevent audible alarm

_C.ALARM_ZONES = {
	-- Start configuration of the first alarm zone
	{
		name='My Home',
		armingModeTextDevID=187,
		statusTextDevID=188,
		entryDelay=15,
		exitDelay=20,
		alertDevices={'Siren', 'Garden Lights'},
		sensors = {
			['Entrance Door'] = {['class'] = SENSOR_CLASS_A, ['active'] = true},
			['Another Door'] = {['class'] = SENSOR_CLASS_A, ['active'] = true},

			-- active can be a boolean or a function as in the example below
			-- The sensor below will only trigger the alarm if
			-- "Master" is not at home and it's dark
			['Garden Shed Door'] = {['class'] = SENSOR_CLASS_A, ['active'] =
				function(domoticz)
					return (domoticz.devices('Master Present').state ~= 'On'
						and domoticz.time.isNightTime)	
				end},

		},
		armAwayToggleBtn='190',
		armAwayTogglesNeeded = 3,
		armHomeToggleBtn='191',
		armHomeTogglesNeeded = 1,
		mainZone = true,
		syncDomoSecToThisZone = false,
		syncThisZoneToDomoSec = true,
	},
	-- End configuration of the first alarm zone

	-- Start configuration of the second alarm zone
	{
		name = 'Pembridge Square Residence',
		armingModeTextDevID = 187,
		statusTextDevID = 188,
		entryDelay = 15,
		exitDelay = 15,
		alertDevices={'Notting Hill Alert Horn', 'Big Ben Chimes'},
		sensors = {
			['Big Gate'] = {['class'] = SENSOR_CLASS_A, ['active'] = true},
			['Patio Door'] = {['class'] = SENSOR_CLASS_B, ['active'] = true},
		},
		armAwayToggleBtn = '190',
		armAwayTogglesNeeded = 1,
		armHomeToggleBtn = '191',
		armHomeTogglesNeeded = 1,
		mainZone = false,
		syncDomoSecToThisZone = false,
		syncThisZoneToDomoSec = false,
	},
	-- End configuration of the second alarm zone
}

return _C


Re: Testers wanted for ideAlarm (A dzVents multi zone alarm script)

Posted: Wednesday 09 August 2017 17:44
by BakSeeDaa
Ok, you posted while I was changing my previous post.

Anyway, remove the second example zone. Then put your own sensors in the configuration file . Remove the example sensors. Change armAwayTogglesNeeded to 1. Please also set a 2 second off delay on the 2 virtual switches. If it still doesn't work, can you post your new edited configuration file?

Re: Testers wanted for ideAlarm (A dzVents multi zone alarm script)

Posted: Wednesday 09 August 2017 17:52
by EdwinK
Will do :) Later, now I need to do some cooking and dog walking and the likes.

Re: Testers wanted for ideAlarm (A dzVents multi zone alarm script)

Posted: Thursday 10 August 2017 12:44
by BakSeeDaa
I've done some changes today. I have made the example configuration file very simple. Just a single zone on no sensor functions are defined since that is a more advanced kind of usage.

Here is the basic configuration file example.

For advanced users there is also an advanced configuration file example.

I have also been adding some example linux commands in the wiki for First Installation.

Furthermore I've added a new section in the Wiki named Then What It's there to describe what to do after the configuration is done and it does some explaining about how to arm and disarm the zones including a bunch of example scripts.

Re: Testers wanted for ideAlarm (A dzVents multi zone alarm script)

Posted: Thursday 10 August 2017 14:39
by EdwinK
Thanks.vWill look into it this weekend.

Re: Testers wanted for ideAlarm (A dzVents multi zone alarm script)

Posted: Friday 11 August 2017 12:56
by BakSeeDaa
EdwinK wrote: Thursday 10 August 2017 14:39 Thanks.vWill look into it this weekend.
Sounds good @EdwinK

Today I have made some nice improvements for the ideAlarm helpers.

Please get the new example helpers file and replace your existing ideAlarmHelpers.lua

I suggest you also start over with the config file using the simple example configuration file instead.

Download the latest ideAlarm.lua

Please also download the latest ideAlarm Module which is now at version 0.9.40.

Just ask if you have some questions. Thanks!

EDIT: Just made some additional changes. Syncing with the Domoticz built in security panel is now bi-directional.

Re: Testers wanted for ideAlarm (A dzVents multi zone alarm script)

Posted: Saturday 12 August 2017 18:36
by BakSeeDaa
Added documentation for the alamZone object that is available in the ideAlarm custom helper functions.

I believe we currently have 2 persons helping me to test ideAlarm. It's @EdwinK and @remb0

Your kind help is highly appreciated. Thanks!

:D :D :D

Re: Testers wanted for ideAlarm (A dzVents multi zone alarm script)

Posted: Monday 14 August 2017 9:47
by jelleeelco
Really like this project... I'll try to participate in the next couple of weeks. Somehow I lost the connection between my Visonic and Raspberry Pi, so I'm anxious to setup a new alarm system (next to the Visonic) using the Xiaomi sensors...

Re: Testers wanted for ideAlarm (A dzVents multi zone alarm script)

Posted: Monday 14 August 2017 9:56
by EdwinK
Didnt had any time to test this weekend. :(

Re: Testers wanted for ideAlarm (A dzVents multi zone alarm script)

Posted: Monday 14 August 2017 10:17
by BakSeeDaa
EdwinK wrote: Monday 14 August 2017 9:56 Didnt had any time to test this weekend. :(
No problem! :lol:

It might be as well because the testing we've done has led to that features has been added. New features made the configuration file change. So it's actually good that you waited. We are currently working on the zone object that will provide many useful functions when doing custom helpers. Therefore it's now better to wait for version 0.9.90 before start testing. It won't take many days I believe so please keep updated.

Cheers!

EDIT: Testing has ended. Releasing the final version 1.0.0

Continuing in the following thread: http://www.domoticz.com/forum/viewtopic.php?t=18926

Thank you @remb0 and @EdwinK for your kind help! ;) ;) ;)

Please close this thread.