ideAlarm (A dzVents alarm environment)

Easy to use, 100% Lua-based event scripting framework.

Moderator: leecollings

BakSeeDaa
Posts: 485
Joined: Thursday 17 September 2015 10:13
Target OS: Raspberry Pi / ODroid
Domoticz version:

ideAlarm (A dzVents alarm environment)

Post by BakSeeDaa »

ideAlarm v2.4.0 released

Prerequisits
  • Domoticz v3.8837 or later
Last edited by BakSeeDaa on Saturday 17 March 2018 10:09, edited 9 times in total.
User avatar
EdwinK
Posts: 1820
Joined: Sunday 22 January 2017 21:46
Target OS: Raspberry Pi / ODroid
Domoticz version: BETA
Location: Rhoon
Contact:

Re: ideAlarm v1.0.0 released (A dzVents alarm environment)

Post by EdwinK »

Was trying this, but made some error, resulting in me accidentally removing the complete domoticz folder. Luckily I just had made a backup before working on the script. Since I like the idea of your script, I will try it again this weekend.
Running latest BETA on a Pi-3 | Toon® Thermostat (rooted) | Hue | Tuya | IKEA tradfri | Dashticz V3 on Lenovo Huawei Tablet | Conbee
BakSeeDaa
Posts: 485
Joined: Thursday 17 September 2015 10:13
Target OS: Raspberry Pi / ODroid
Domoticz version:

Re: ideAlarm v1.0.0 released (A dzVents alarm environment)

Post by BakSeeDaa »

EdwinK wrote: Thursday 17 August 2017 16:05 Was trying this, but made some error, resulting in me accidentally removing the complete domoticz folder. Luckily I just had made a backup before working on the script. Since I like the idea of your script, I will try it again this weekend.
Let's hope that you are back on the track again soon @EdwinK ;)
BakSeeDaa
Posts: 485
Joined: Thursday 17 September 2015 10:13
Target OS: Raspberry Pi / ODroid
Domoticz version:

Re: ideAlarm v1.0.0 released (A dzVents alarm environment)

Post by BakSeeDaa »

Here are some nice script examples where you use the ideAlarm API for various purposes:



If you have some, please let me know so we can add them.
Last edited by BakSeeDaa on Saturday 17 March 2018 10:10, edited 2 times in total.
BakSeeDaa
Posts: 485
Joined: Thursday 17 September 2015 10:13
Target OS: Raspberry Pi / ODroid
Domoticz version:

Re: ideAlarm v2.0.0 released (A dzVents alarm environment)

Post by BakSeeDaa »

IdeAlarm version 2.0.0 has been released.

Keep secure also when alarm system is disarmed!

New in version 2.0.0 is a "Nagging" system.

Maybe you like to have some control of open doors and windows etc even when you and your family are at home. Therefore we introduce nagging in version 2.0.0. You can use it to be reminded about doors and windows etc that you (or someone else) forgot to close for a while. You have already defined all your sensors in the ideAlarm configuration file and there you can also set what sensors to watch and the time before nagging about it.

You can set the nagging interval in minutes. A nag will call a custom helper function to do whatever you like. Typically to speak a message. The nag will contain information about all the sensors in all zones. Here is an example custom helper function that will handle a nag event:

Code: Select all

alarmNagOpenSensors = function(domoticz, alarmZone, nagSensors, lastValue)
	if alarmZone.name == 'My home' then
		if #nagSensors == 0 and lastValue > 0 then
			domoticz.log('The previously reported sections are now closed! Good work!', domoticz.LOG_INFO)
		elseif #nagSensors > 0 then
			local msg = ''
			for _, sensor in ipairs(nagSensors) do
				if msg ~= '' then msg = msg..' and ' end
				msg = msg..sensor.name
			end
			msg = 'Open sections in zone: '..alarmZone.name..'. '..msg
			domoticz.log(msg, domoticz.LOG_INFO)
		end
	end
end,
There is also another custom helper function available if you for example want to turn on a light whenever certain doors are open. It's quite useful. Here is an example custom helper function that will handle such an event:

Code: Select all

alarmOpenSensorsAllZones = function(domoticz, alarmZones)
	-- Toggle the big red lamp if there are any open sensors in 'My House'
	for _, alarmZone in ipairs(alarmZones) do
		if alarmZone.name == 'My House' then
			if (alarmZone.openSensorCount > 0) then
				domoticz.devices('Big Red Lamp').switchOn()
			elseif (alarmZone.openSensorCount == 0) then
				domoticz.devices('Big Red Lamp').switchOff()
			end
		end
	end
end,

Check it out and let us know what you think!
Last edited by BakSeeDaa on Friday 23 February 2018 9:23, edited 1 time in total.
User avatar
papoo
Posts: 126
Joined: Friday 22 January 2016 22:14
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.10
Location: France
Contact:

Re: ideAlarm v2.0.0 released (A dzVents alarm environment)

Post by papoo »

Very nice script, thanks.
for the V3 version i have little wish : a language file to translate the notifications in others languages like french, ....
BakSeeDaa
Posts: 485
Joined: Thursday 17 September 2015 10:13
Target OS: Raspberry Pi / ODroid
Domoticz version:

Re: ideAlarm v2.0.0 released (A dzVents alarm environment)

Post by BakSeeDaa »

papoo wrote: Friday 25 August 2017 21:18 Very nice script, thanks.
for the V3 version i have little wish : a language file to translate the notifications in others languages like french, ....
Thanks for your kind words and for the suggestion @papoo.

When an alarm event happens, that can for example be be that an alert has arised or that an alarm sensor has been tripped, a custom helper function is called. The custom helper functions are unique for each installation. Every user defines what shall happen in their Domoticz system to respond to an ideAlarm event. That is done in the ideAlarm custom helpers module as seen in this example.

For example when a sensor has been tripped, some people might like to have a message spoken, some other prefers an SMS while maybe someone else wants to switch on a light.

So because the ideAlarm custom helpers module is unique for each installation you can just change it to do whatever you like to. (You can (and should) of course change the language too). The file won't be overwritten when upgrading.

The ideAlarm custom helpers module example is really just a rough example showing some of the possibilities. I believe that it will look very different on each installation.
Last edited by BakSeeDaa on Friday 23 February 2018 9:23, edited 1 time in total.
dressie
Posts: 156
Joined: Monday 25 May 2015 22:44
Target OS: Raspberry Pi / ODroid
Domoticz version: V2020.2
Location: Netherlands
Contact:

Re: ideAlarm v2.0.0 released (A dzVents alarm environment)

Post by dressie »

Thanks for your work! Past weekend I installed it on my test Domoticz to play around, and it looks good!
I want to use it on my main server but I have a few questions:
-how do you add another zone?
-can you also create a "Secure-Home" mode, so you can move around in your house without setting off the alarm (only protect the doors for example)?

Thanks again!

Grt,
Andrès
BakSeeDaa
Posts: 485
Joined: Thursday 17 September 2015 10:13
Target OS: Raspberry Pi / ODroid
Domoticz version:

Re: ideAlarm v2.0.0 released (A dzVents alarm environment)

Post by BakSeeDaa »

dressie wrote: Monday 28 August 2017 14:47 Thanks for your work! Past weekend I installed it on my test Domoticz to play around, and it looks good!
I want to use it on my main server but I have a few questions:
-how do you add another zone?
-can you also create a "Secure-Home" mode, so you can move around in your house without setting off the alarm (only protect the doors for example)?

Thanks again!

Grt,
Andrès
Hi Andrès
dressie wrote: Monday 28 August 2017 14:47 -how do you add another zone?
If You look here, you can find 2 different configuration examples. One of them has 2 zones defined.

In the 2 zone config example, you can see in the code comments where a zone's configuration starts and where it ends. Give it a try and ask here (pasting your configuration) if you need more assistance.
dressie wrote: Monday 28 August 2017 14:47 -can you also create a "Secure-Home" mode, so you can move around in your house without setting off the alarm (only protect the doors for example)?
Yes, you can arm in 2 different modes. The arming mode "Armed Home" is typically used for arming when home. If You have motion detectors or other sensors in your home that you wish to exclude, you just define them as SENSOR_CLASS_B (See config example file again) Then they won't trigger any alarms while "Armed Home". (But if you arm as "Armed Away" they will!)

You can for example also create another zone only for smoke detectors if you wish. Then you can have that zone constantly armed so you don't miss that there is a fire going on.
Last edited by BakSeeDaa on Friday 23 February 2018 9:22, edited 1 time in total.
dressie
Posts: 156
Joined: Monday 25 May 2015 22:44
Target OS: Raspberry Pi / ODroid
Domoticz version: V2020.2
Location: Netherlands
Contact:

Re: ideAlarm v2.0.0 released (A dzVents alarm environment)

Post by dressie »

Thanks man! I have 3 zones now, it's really easy and fun to tweak.

Verstuurd vanaf mijn SM-G920F met Tapatalk

dressie
Posts: 156
Joined: Monday 25 May 2015 22:44
Target OS: Raspberry Pi / ODroid
Domoticz version: V2020.2
Location: Netherlands
Contact:

Re: ideAlarm v2.0.0 released (A dzVents alarm environment)

Post by dressie »

Hi BakSeeDaa,

Is it possible to use a scene instead of an "alertDevices=" ? I'd like to start a scene when a sensor is triggered.

Grtz,

Andrès
BakSeeDaa
Posts: 485
Joined: Thursday 17 September 2015 10:13
Target OS: Raspberry Pi / ODroid
Domoticz version:

Re: ideAlarm v2.0.0 released (A dzVents alarm environment)

Post by BakSeeDaa »

dressie wrote: Thursday 07 September 2017 9:38 Hi BakSeeDaa,

Is it possible to use a scene instead of an "alertDevices=" ? I'd like to start a scene when a sensor is triggered.

Grtz,

Andrès
Hi!

Sure you can.

You can define custom helper functions for various alarm events.
The Wiki wrote:Every installation is unique and has it's own needs. Therefore ideAlarm has a number of alarm events that will trigger your custom script functions (if you choose to define them). That way you can choose whatever shall happen on those events. You define your custom scripts as helper functions in the event helpers file. Your helper functions will typically be able to access an alarm zone object that holds various information and provides functions about the alarmZone that is being processed.
Below an example that just sends a notification when an alert occurs. You can customize it to suit your needs. Just add code to activate your scene in it.

Code: Select all

alarmZoneAlert = function(domoticz, alarmZone, testMode)
	-- It's ALERT TIME!
	local msg = 'Intrusion detected in zone '..alarmZone.name..'. '
	for _, sensor in ipairs(alarmZone.trippedSensors(domoticz, 1)) do
		msg = msg..sensor.name..' tripped @ '..sensor.lastUpdate.raw..'. '
	end

	-- We don't have to turn On/Off the alert devices. That's handled by the main script.
	if not testMode then
		domoticz.notify('Alarm Zone Alert!',
			msg, domoticz.PRIORITY_HIGH)
	else
		domoticz.log('(TESTMODE IS ACTIVE) '..msg, domoticz.LOG_INFO)
	end
end,
dzVents code example for activating a scene:

Code: Select all

--activate my scene
domoticz.setScene('Evening lights', 'On')
Last edited by BakSeeDaa on Friday 23 February 2018 9:21, edited 1 time in total.
BakSeeDaa
Posts: 485
Joined: Thursday 17 September 2015 10:13
Target OS: Raspberry Pi / ODroid
Domoticz version:

Re: ideAlarm v2.0.0 released (A dzVents alarm environment)

Post by BakSeeDaa »

Released version 2.0.3 which should fix a problem related to when using functions in configuration file for sensor ['enabled']
User avatar
EdwinK
Posts: 1820
Joined: Sunday 22 January 2017 21:46
Target OS: Raspberry Pi / ODroid
Domoticz version: BETA
Location: Rhoon
Contact:

Re: ideAlarm v2.0.0 released (A dzVents alarm environment)

Post by EdwinK »

Playing with this again

Code: Select all

017-09-29 14:41:15.200 Error: dzVents: Error: .../local/domoticz/var/scripts/dzVents/scripts/ideAlarm.lua:13: module 'ideAlarmModule' not found:
no field package.preload['ideAlarmModule']
no file '/usr/local/domoticz/var/scripts/dzVents/modules/ideAlarmModule.lua'
no file '/usr/local/share/lua/5.2/ideAlarmModule.lua'
no file '/usr/local/share/lua/5.2/ideAlarmModule/init.lua'
no file '/usr/local/lib/lua/5.2/ideAlarmModule.lua'
no file '/usr/local/lib/lua/5.2/ideAlarmModule/init.lua'
no file './ideAlarmModule.lua'
no file '/usr/local/domoticz/var/scripts/dzVents/ideAlarmModule.lua'
no file '/usr/local/domoticz/var/scripts/dzVents/runtime/ideAlarmModule.lua'
no file '/usr/local/domoticz/var/scripts/dzVents/runtime/device-adapters/ideAlarmModule.lua'
no file '/usr/local/domoticz/var/scripts/dzVents/dzVents/ideAlarmModule.lua'
no file '/usr/local/domoticz/var/scripts/dzVents/scripts/ideAlarmModule.lua'
no file '/usr/local/domoticz/var/scripts/dzVents/generated_scripts/ideAlarmModule.lua'
no file '/usr/local/domoticz/var/scripts/dzVents/data/ideAlarmModule.lua'
no file '/usr/local/domoticz/var/scripts/dzVents/ideAlarmModule.lua'
no file '/usr/local/domoticz/var/scripts/dzVents/ideAlarmModule.lua'
no file '/usr/local/lib/lua/5.2/ideAlarmModule.so'
no file '/usr/local/lib/lua/5.2/loadall.so'
no file './ideAlarmModule.so'
Running latest BETA on a Pi-3 | Toon® Thermostat (rooted) | Hue | Tuya | IKEA tradfri | Dashticz V3 on Lenovo Huawei Tablet | Conbee
maskfaen
Posts: 7
Joined: Sunday 24 September 2017 22:11
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: ideAlarm v2.0.0 released (A dzVents alarm environment)

Post by maskfaen »

How do you guys implement the Security panel in a nice way?

Or should I get some kind of nice hardware to arm/disarm?

I am using ImperiHome on a wall mounted tablet at the front door - Any suggestions?
WAF and reliability is important.


I also installed ideAlarm and got this error when arming:

Code: Select all

2017-09-30 16:06:47.549 Error: dzVents: Error: ideAlarm V2.0.3: There is no device with that name or id: Security Panel
2017-09-30 16:06:47.550 Error: dzVents: Error: ideAlarm V2.0.3: An error occured when calling event handler ideAlarm
2017-09-30 16:06:47.550 Error: dzVents: Error: ideAlarm V2.0.3: ...e/pi/domoticz/scripts/dzVents/modules/ideAlarmModule.lua:423: attempt to index a nil value
Thanks for what seems to be the script I will be using for my home alarm to be :)
dutchdevil83
Posts: 130
Joined: Monday 31 October 2016 19:34
Target OS: Raspberry Pi / ODroid
Domoticz version: latest
Location: Netherlands
Contact:

Re: ideAlarm v2.0.0 released (A dzVents alarm environment)

Post by dutchdevil83 »

maskfaen wrote: Saturday 30 September 2017 16:18 How do you guys implement the Security panel in a nice way?

Or should I get some kind of nice hardware to arm/disarm?

I am using ImperiHome on a wall mounted tablet at the front door - Any suggestions?
WAF and reliability is important.


I also installed ideAlarm and got this error when arming:

Code: Select all

2017-09-30 16:06:47.549 Error: dzVents: Error: ideAlarm V2.0.3: There is no device with that name or id: Security Panel
2017-09-30 16:06:47.550 Error: dzVents: Error: ideAlarm V2.0.3: An error occured when calling event handler ideAlarm
2017-09-30 16:06:47.550 Error: dzVents: Error: ideAlarm V2.0.3: ...e/pi/domoticz/scripts/dzVents/modules/ideAlarmModule.lua:423: attempt to index a nil value
Thanks for what seems to be the script I will be using for my home alarm to be :)
I bought a RFID scanner and connected the outputs to a fibaro relais switch. I disarm with tag and can also disarm with a personal code If someone wants acces without a tag. Arming is done with a push on the bell at the panel.

https://www.expert.nl/fibaro-universele ... lsrc=aw.ds

https://m.dhgate.com/product/125khz-rfi ... tml#pd-007
Hardware
1x Raspberry Pi
1x Razberry Z-Wave
1x RFXtrx433E
1x Toon
1x GoodWe Solarpanels
2x FGSD-002 Smoke Detector
1x FGBS-001 Binaire Sensor (RFID lezer)
7x FGMS-001 Motion Sensor
3x ZW089 Verzonken Deursensor
7x NC Wallplug
&lots of KaKu stuff
maskfaen
Posts: 7
Joined: Sunday 24 September 2017 22:11
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: ideAlarm v2.0.0 released (A dzVents alarm environment)

Post by maskfaen »

I disabled the sync with domoSecuritypanel in the config and now the error is gone.

BUT I still do not get how this should work..

- I arm the alarm with "Toggle Z1 Arm Away"
- I get the status to "Armed away" / "Normal"
- I trigger the motion sensor
NOTHING happens.
No notification, no switch (I created a virtual switch named 'Siren'). It still just says "Armed away" / "Normal".

I most be missing something?
maskfaen
Posts: 7
Joined: Sunday 24 September 2017 22:11
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: ideAlarm v2.0.0 released (A dzVents alarm environment)

Post by maskfaen »

I guess i should add my LOG.

I first trigger the Z1 Away. Then I go and set off the motionsensor after its armed.
'Hemmet' is what I renamed "My Home" to.

The motionsensor is 'Rörelse Entre'. Why does it not trigger alert/alarm?

Code: Select all

2017-10-01 09:24:13.324 User: Admin initiated a switch command (172/Toggle Z1 Arm Away/On)
2017-10-01 09:24:13.445 dzVents: Info: Handling events for: "Toggle Z1 Arm Away", value: "On"
2017-10-01 09:24:13.445 dzVents: Info: ideAlarm V2.0.3: ------ Start external script: ideAlarm.lua: Device: "Toggle Z1 Arm Away (ideAlarm)", Index: 172
2017-10-01 09:24:13.446 dzVents: Info: ideAlarm V2.0.3: triggerType toggleSwitch
2017-10-01 09:24:13.446 dzVents: Info: ideAlarm V2.0.3: Armed Away Alarm mode toggle button for zone "Hemmet" was pushed.
2017-10-01 09:24:13.449 dzVents: Info: ideAlarm V2.0.3: Hemmet new status: Arming immediately
2017-10-01 09:24:13.449 dzVents: Info: ideAlarm V2.0.3: Arming zone Hemmet to Armed Away with a delay of 20 seconds
2017-10-01 09:24:13.458 dzVents: Info: ideAlarm V2.0.3: ------ Finished ideAlarm.lua
2017-10-01 09:24:13.458 EventSystem: Fetching url...
2017-10-01 09:24:13.458 EventSystem: Script event triggered: /home/pi/domoticz/scripts/dzVents/runtime/dzVents.lua
2017-10-01 09:24:13.757 dzVents: Info: Handling events for: "Z1 Status", value: "Arming"
2017-10-01 09:24:13.757 dzVents: Info: ideAlarm V2.0.3: ------ Start external script: ideAlarm.lua: Device: "Z1 Status (ideAlarm)", Index: 170
2017-10-01 09:24:13.758 dzVents: Info: ideAlarm V2.0.3: triggerType status
2017-10-01 09:24:13.759 dzVents: Info: ideAlarm V2.0.3: ------ Finished ideAlarm.lua
2017-10-01 09:24:15.453 dzVents: Info: Handling events for: "Toggle Z1 Arm Away", value: "Off"
2017-10-01 09:24:15.453 dzVents: Info: ideAlarm V2.0.3: ------ Start external script: ideAlarm.lua: Device: "Toggle Z1 Arm Away (ideAlarm)", Index: 172
2017-10-01 09:24:15.454 dzVents: Info: ideAlarm V2.0.3: triggerType sensor
2017-10-01 09:24:15.456 dzVents: Info: ideAlarm V2.0.3: ------ Finished ideAlarm.lua
2017-10-01 09:24:33.613 dzVents: Info: Handling events for: "Z1 Arming Mode", value: "Armed Away"
2017-10-01 09:24:33.613 dzVents: Info: ideAlarm V2.0.3: ------ Start external script: ideAlarm.lua: Device: "Z1 Arming Mode (ideAlarm)", Index: 169
2017-10-01 09:24:33.614 dzVents: Info: ideAlarm V2.0.3: triggerType armingMode
2017-10-01 09:24:33.614 dzVents: Info: ideAlarm V2.0.3: Hemmet new status: Normal immediately
2017-10-01 09:24:33.615 dzVents: Info: ideAlarm V2.0.3: ------ Finished ideAlarm.lua
2017-10-01 09:24:33.615 EventSystem: Fetching url...
2017-10-01 09:24:33.615 EventSystem: Script event triggered: /home/pi/domoticz/scripts/dzVents/runtime/dzVents.lua
2017-10-01 09:24:33.900 dzVents: Info: Handling events for: "Z1 Status", value: "Normal"
2017-10-01 09:24:33.900 dzVents: Info: ideAlarm V2.0.3: ------ Start external script: ideAlarm.lua: Device: "Z1 Status (ideAlarm)", Index: 170
2017-10-01 09:24:33.900 dzVents: Info: ideAlarm V2.0.3: triggerType status
2017-10-01 09:24:33.902 dzVents: Info: ideAlarm V2.0.3: ------ Finished ideAlarm.lua
2017-10-01 09:25:05.236 dzVents: Info: Handling events for: "Rörelse Entre", value: "On"
2017-10-01 09:25:05.236 dzVents: Info: ideAlarm V2.0.3: ------ Start external script: ideAlarm.lua: Device: "Rörelse Entre (Aeon Labs ZStick)", Index: 84
2017-10-01 09:25:05.238 dzVents: Info: ideAlarm V2.0.3: triggerType sensor
2017-10-01 09:25:05.239 dzVents: Info: ideAlarm V2.0.3: ------ Finished ideAlarm.lua
2017-10-01 09:25:05.240 dzVents: Info: ------ Start internal script: Morgonljus: Device: "Rörelse Entre (Aeon Labs ZStick)", Index: 84
2017-10-01 09:25:05.240 dzVents: Info: ------ Finished Morgonljus
2017-10-01 09:26:00.462 dzVents: Info: ideAlarm V2.0.3: ------ Start external script: ideAlarm.lua:, trigger: every other minute
2017-10-01 09:26:00.464 dzVents: Info: ideAlarm V2.0.3: triggerType timer
2017-10-01 09:26:00.483 dzVents: Info: ideAlarm V2.0.3: ------ Finished ideAlarm.lua
2017-10-01 09:26:06.026 dzVents: Info: Handling events for: "Rörelse Entre", value: "Off"
2017-10-01 09:26:06.026 dzVents: Info: ideAlarm V2.0.3: ------ Start external script: ideAlarm.lua: Device: "Rörelse Entre (Aeon Labs ZStick)", Index: 84
2017-10-01 09:26:06.026 dzVents: Info: ideAlarm V2.0.3: triggerType sensor
2017-10-01 09:26:06.028 dzVents: Info: ideAlarm V2.0.3: ------ Finished ideAlarm.lua
2017-10-01 09:26:06.028 dzVents: Info: ------ Start internal script: Morgonljus: Device: "Rörelse Entre (Aeon Labs ZStick)", Index: 84
2017-10-01 09:26:06.030 dzVents: Info: ------ Finished Morgonljus
BakSeeDaa
Posts: 485
Joined: Thursday 17 September 2015 10:13
Target OS: Raspberry Pi / ODroid
Domoticz version:

Re: ideAlarm v2.0.0 released (A dzVents alarm environment)

Post by BakSeeDaa »

EdwinK wrote: Friday 29 September 2017 14:46 Playing with this again

Code: Select all

017-09-29 14:41:15.200 Error: dzVents: Error: .../local/domoticz/var/scripts/dzVents/scripts/ideAlarm.lua:13: module 'ideAlarmModule' not found:
no field package.preload['ideAlarmModule']
no file '/usr/local/domoticz/var/scripts/dzVents/modules/ideAlarmModule.lua'
...
Hi. Please check the Wiki at First Installation. It seems that you have not downloaded the ideAlarm module. Please also check that all the other necessary files are in place by following the installation procedure.

Please also note that because you are using a Synology server for Domoticz, you have to "translate" the documentation folder paths so that they fit your system. E.g.

Code: Select all

~/domoticz/scripts/dzVents/modules/ideAlarmModule.lua
should instead be

Code: Select all

/usr/local/domoticz/scripts/dzVents/modules/ideAlarmModule.lua 
The same goes for all paths mentioned in the Wiki.

Does that solve the problem @EdwinK?
Last edited by BakSeeDaa on Friday 23 February 2018 9:21, edited 1 time in total.
BakSeeDaa
Posts: 485
Joined: Thursday 17 September 2015 10:13
Target OS: Raspberry Pi / ODroid
Domoticz version:

Re: ideAlarm v2.0.0 released (A dzVents alarm environment)

Post by BakSeeDaa »

maskfaen wrote: Saturday 30 September 2017 16:18 ...

Code: Select all

2017-09-30 16:06:47.549 Error: dzVents: Error: ideAlarm V2.0.3: There is no device with that name or id: Security Panel
2017-09-30 16:06:47.550 Error: dzVents: Error: ideAlarm V2.0.3: An error occured when calling event handler ideAlarm
2017-09-30 16:06:47.550 Error: dzVents: Error: ideAlarm V2.0.3: ...e/pi/domoticz/scripts/dzVents/modules/ideAlarmModule.lua:423: attempt to index a nil value
...
Hi there @maskfaen

Not everyone uses the Domoticz built in security panel.

Only if you have defined one, set the PIN code and also named the device "Security Panel" you can enable the sync functionality in ideAlarm.
maskfaen wrote: Sunday 01 October 2017 0:21 ...
BUT I still do not get how this should work..

- I arm the alarm with "Toggle Z1 Arm Away"
- I get the status to "Armed away" / "Normal"
- I trigger the motion sensor
NOTHING happens.
No notification, no switch (I created a virtual switch named 'Siren'). It still just says "Armed away" / "Normal".

I most be missing something?
What shall happen when a sensor is tripped is defined in your custom helper function named alarmZoneTripped. See Wiki here.

Another helper function alarmZoneAlert might also be of interest.

Defined sirens are taken care of automatically, so no need handle them in custom helper functions
maskfaen wrote: Sunday 01 October 2017 9:31 I guess i should add my LOG.

I first trigger the Z1 Away. Then I go and set off the motionsensor after its armed.
'Hemmet' is what I renamed "My Home" to.

The motionsensor is 'Rörelse Entre'. Why does it not trigger alert/alarm?

Code: Select all

2017-10-01 09:24:13.324 User: Admin initiated a switch command (172/Toggle Z1 Arm Away/On)
2017-10-01 09:24:13.445 dzVents: Info: Handling events for: "Toggle Z1 Arm Away", value: "On"
2017-10-01 09:24:13.445 dzVents: Info: ideAlarm V2.0.3: ------ Start external script: ideAlarm.lua: Device: "Toggle Z1 Arm Away (ideAlarm)", Index: 172
2017-10-01 09:24:13.446 dzVents: Info: ideAlarm V2.0.3: triggerType toggleSwitch
2017-10-01 09:24:13.446 dzVents: Info: ideAlarm V2.0.3: Armed Away Alarm mode toggle button for zone "Hemmet" was pushed.
2017-10-01 09:24:13.449 dzVents: Info: ideAlarm V2.0.3: Hemmet new status: Arming immediately
2017-10-01 09:24:13.449 dzVents: Info: ideAlarm V2.0.3: Arming zone Hemmet to Armed Away with a delay of 20 seconds
2017-10-01 09:24:13.458 dzVents: Info: ideAlarm V2.0.3: ------ Finished ideAlarm.lua
2017-10-01 09:24:13.458 EventSystem: Fetching url...
2017-10-01 09:24:13.458 EventSystem: Script event triggered: /home/pi/domoticz/scripts/dzVents/runtime/dzVents.lua
2017-10-01 09:24:13.757 dzVents: Info: Handling events for: "Z1 Status", value: "Arming"
2017-10-01 09:24:13.757 dzVents: Info: ideAlarm V2.0.3: ------ Start external script: ideAlarm.lua: Device: "Z1 Status (ideAlarm)", Index: 170
2017-10-01 09:24:13.758 dzVents: Info: ideAlarm V2.0.3: triggerType status
2017-10-01 09:24:13.759 dzVents: Info: ideAlarm V2.0.3: ------ Finished ideAlarm.lua
2017-10-01 09:24:15.453 dzVents: Info: Handling events for: "Toggle Z1 Arm Away", value: "Off"
2017-10-01 09:24:15.453 dzVents: Info: ideAlarm V2.0.3: ------ Start external script: ideAlarm.lua: Device: "Toggle Z1 Arm Away (ideAlarm)", Index: 172
2017-10-01 09:24:15.454 dzVents: Info: ideAlarm V2.0.3: triggerType sensor
2017-10-01 09:24:15.456 dzVents: Info: ideAlarm V2.0.3: ------ Finished ideAlarm.lua
2017-10-01 09:24:33.613 dzVents: Info: Handling events for: "Z1 Arming Mode", value: "Armed Away"
2017-10-01 09:24:33.613 dzVents: Info: ideAlarm V2.0.3: ------ Start external script: ideAlarm.lua: Device: "Z1 Arming Mode (ideAlarm)", Index: 169
2017-10-01 09:24:33.614 dzVents: Info: ideAlarm V2.0.3: triggerType armingMode
2017-10-01 09:24:33.614 dzVents: Info: ideAlarm V2.0.3: Hemmet new status: Normal immediately
2017-10-01 09:24:33.615 dzVents: Info: ideAlarm V2.0.3: ------ Finished ideAlarm.lua
2017-10-01 09:24:33.615 EventSystem: Fetching url...
2017-10-01 09:24:33.615 EventSystem: Script event triggered: /home/pi/domoticz/scripts/dzVents/runtime/dzVents.lua
2017-10-01 09:24:33.900 dzVents: Info: Handling events for: "Z1 Status", value: "Normal"
2017-10-01 09:24:33.900 dzVents: Info: ideAlarm V2.0.3: ------ Start external script: ideAlarm.lua: Device: "Z1 Status (ideAlarm)", Index: 170
2017-10-01 09:24:33.900 dzVents: Info: ideAlarm V2.0.3: triggerType status
2017-10-01 09:24:33.902 dzVents: Info: ideAlarm V2.0.3: ------ Finished ideAlarm.lua
2017-10-01 09:25:05.236 dzVents: Info: Handling events for: "Rörelse Entre", value: "On"
2017-10-01 09:25:05.236 dzVents: Info: ideAlarm V2.0.3: ------ Start external script: ideAlarm.lua: Device: "Rörelse Entre (Aeon Labs ZStick)", Index: 84
2017-10-01 09:25:05.238 dzVents: Info: ideAlarm V2.0.3: triggerType sensor
2017-10-01 09:25:05.239 dzVents: Info: ideAlarm V2.0.3: ------ Finished ideAlarm.lua
2017-10-01 09:25:05.240 dzVents: Info: ------ Start internal script: Morgonljus: Device: "Rörelse Entre (Aeon Labs ZStick)", Index: 84
2017-10-01 09:25:05.240 dzVents: Info: ------ Finished Morgonljus
2017-10-01 09:26:00.462 dzVents: Info: ideAlarm V2.0.3: ------ Start external script: ideAlarm.lua:, trigger: every other minute
2017-10-01 09:26:00.464 dzVents: Info: ideAlarm V2.0.3: triggerType timer
2017-10-01 09:26:00.483 dzVents: Info: ideAlarm V2.0.3: ------ Finished ideAlarm.lua
2017-10-01 09:26:06.026 dzVents: Info: Handling events for: "Rörelse Entre", value: "Off"
2017-10-01 09:26:06.026 dzVents: Info: ideAlarm V2.0.3: ------ Start external script: ideAlarm.lua: Device: "Rörelse Entre (Aeon Labs ZStick)", Index: 84
2017-10-01 09:26:06.026 dzVents: Info: ideAlarm V2.0.3: triggerType sensor
2017-10-01 09:26:06.028 dzVents: Info: ideAlarm V2.0.3: ------ Finished ideAlarm.lua
2017-10-01 09:26:06.028 dzVents: Info: ------ Start internal script: Morgonljus: Device: "Rörelse Entre (Aeon Labs ZStick)", Index: 84
2017-10-01 09:26:06.030 dzVents: Info: ------ Finished Morgonljus
Your device "Rörelse Entre" is invoking the ideAlarm script indeed but no action is taken for some reason.

So if you paste your configuration file below I will try to help you further.
Last edited by BakSeeDaa on Friday 23 February 2018 9:21, edited 1 time in total.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest