ideAlarm (A dzVents alarm environment)

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

Moderator: leecollings

funnybu
Posts: 10
Joined: Monday 07 May 2018 14:48
Target OS: Raspberry Pi / ODroid
Domoticz version: 3.9272
Location: Russia, Novosibirsk
Contact:

Re: ideAlarm (A dzVents alarm environment)

Post by funnybu »

Hello, may be someone can help me.

I have simle script to set "armed away" security state after 30 sec. And i want send notification about it, but afterSec(30) doesnt works with notify for me (domoticz latest betta). It sends notification instantly.

How i can get notification with delay?

Code: Select all

local SEC_BUTTON = 'knopka_test'
--local SEC_BUTTON = 'knopka_prihojaya'
local SEC_PANEL = 'Domoticz Security Panel'  -- or the name of your Security Panel 
local TIME_TO_ARMING = 30

return {
	active = true,
	on = {
		devices = {SEC_BUTTON}
	},
	execute = function(domoticz, device)

    local but = domoticz.devices(SEC_BUTTON).state 
    local sec_panel = domoticz.devices(SEC_PANEL)


    if but == 'Click' 
        then 
            if (sec_panel.state == 'Disarmed')
                then
                    domoticz.devices(SEC_PANEL).armAway().afterSec(30)
                    domoticz.notify('Security', 'Domoticz Arming in 30 sec!')
                    domoticz.notify('Security', 'Domoticz state: ' .. sec_panel.state).afterSec(35)
                else
                    domoticz.notify('Security', 'Domoticz already Armed!')  
            end
    end
    
    if but == "Double Click"
        then
            if (sec_panel.state == 'Armed Away') 
                then
                    domoticz.devices(SEC_PANEL).disarm()
                    domoticz.notify('Security', 'Domoticz Disarmed!')
                else
                    domoticz.notify('Security', 'Domoticz already Disarmed!')
            end
    end 
	end
}
dressie
Posts: 156
Joined: Monday 25 May 2015 22:44
Target OS: Raspberry Pi / ODroid
Domoticz version: V2020.2
Location: Netherlands
Contact:

Re: ideAlarm (A dzVents alarm environment)

Post by dressie »

Hi everybody!

Is someone still using this ideAlarm? Just curious, I'm still using it and it keeps doing it's job. Haven't found anything better.
Since it's not being updated, someone else found anything newer/better?
sammyke007
Posts: 204
Joined: Monday 08 May 2017 20:48
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.1
Location: Belgium
Contact:

Re: ideAlarm (A dzVents alarm environment)

Post by sammyke007 »

dressie wrote: Thursday 23 April 2020 23:43 Hi everybody!

Is someone still using this ideAlarm? Just curious, I'm still using it and it keeps doing it's job. Haven't found anything better.
Since it's not being updated, someone else found anything newer/better?
+1? Does this work well?
I would like to ditch my 433mhz alarm and switch to Z-Wave using this script. Any tips?
ronaldbro
Posts: 327
Joined: Thursday 15 November 2018 21:38
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: Netherlands
Contact:

Re: ideAlarm (A dzVents alarm environment)

Post by ronaldbro »

I still use it and still works great. Although I did make some Small changes, but don’t remember what exactly.
At least one of the improvements was to add a state device with the states:
- Off
- Normal
- Arming
- Armed
- Disarmed
- Tripped
- Fired

I use this device in another dzvents script within Domoticz to implement the behavior when something happens. This is a little bit better to maintain.
dressie
Posts: 156
Joined: Monday 25 May 2015 22:44
Target OS: Raspberry Pi / ODroid
Domoticz version: V2020.2
Location: Netherlands
Contact:

Re: ideAlarm (A dzVents alarm environment)

Post by dressie »

sammyke007 wrote: Saturday 25 April 2020 22:38
dressie wrote: Thursday 23 April 2020 23:43 Hi everybody!

Is someone still using this ideAlarm? Just curious, I'm still using it and it keeps doing it's job. Haven't found anything better.
Since it's not being updated, someone else found anything newer/better?
+1? Does this work well?
I would like to ditch my 433mhz alarm and switch to Z-Wave using this script. Any tips?
Works very well! If you follow the instructions, you can get it up within no time!
sammyke007
Posts: 204
Joined: Monday 08 May 2017 20:48
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.1
Location: Belgium
Contact:

Re: ideAlarm (A dzVents alarm environment)

Post by sammyke007 »

Great! Was anyone successful with adding this feature?

"1. A subset of sensors that have their own entryDelay. This allows you to specify sensors that you know will be tripped when attempting to disarm the system, such as a front door sensor or PIR located in the same room as the security panel. IOW, all other sensors trip immediately (for example), but these specific sensors trip after a delay."

That would be the nice for the front door and garage sensor.

Verstuurd vanaf mijn ONEPLUS A6003 met Tapatalk

ronaldbro
Posts: 327
Joined: Thursday 15 November 2018 21:38
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: Netherlands
Contact:

Re: ideAlarm (A dzVents alarm environment)

Post by ronaldbro »

sammyke007 wrote: Sunday 26 April 2020 21:17 Great! Was anyone successful with adding this feature?

"1. A subset of sensors that have their own entryDelay. This allows you to specify sensors that you know will be tripped when attempting to disarm the system, such as a front door sensor or PIR located in the same room as the security panel. IOW, all other sensors trip immediately (for example), but these specific sensors trip after a delay."

That would be the nice for the front door and garage sensor.

Verstuurd vanaf mijn ONEPLUS A6003 met Tapatalk
Yes, I changed that too.
sammyke007
Posts: 204
Joined: Monday 08 May 2017 20:48
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.1
Location: Belgium
Contact:

Re: ideAlarm (A dzVents alarm environment)

Post by sammyke007 »

Are you willing to share your changes please? Maybe in PM?

Verstuurd vanaf mijn ONEPLUS A6003 met Tapatalk

ronaldbro
Posts: 327
Joined: Thursday 15 November 2018 21:38
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: Netherlands
Contact:

Re: ideAlarm (A dzVents alarm environment)

Post by ronaldbro »

Sure, no problem. See attachment.
Most changes are commented with a 'RB' tag, but can't promise that all changes are tagged ;)

For the delay. I added a variable entryDelay to each trigger device in de config file and the module file is changed to get the delay from the device.
Attachments
ideAlarm Ronald.zip
(10.79 KiB) Downloaded 124 times
Opus
Posts: 21
Joined: Monday 05 October 2015 9:31
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: ideAlarm (A dzVents alarm environment)

Post by Opus »

I use a switch in the door lock to trigger the toggle switches. Occasionally this becomes desynchronized. Could I use the on-off switch directly?

In addition, there is an acoustic signal when switching on and off:

Code: Select all

	alarmArmingModeChanged = function(domoticz, alarmZone)
		-- The arming mode for a zone has changed. We might want to be informed about that.
		local zoneName = alarmZone.name
		local armingMode = alarmZone.armingMode(domoticz)
		domoticz.notify('Alarmanlage',
			'Modus für ' .. zoneName .. ' ist ' .. armingMode,
			domoticz.PRIORITY_HIGH)
		
		if armingMode == domoticz.SECURITY_DISARMED then 
			-- One peep to signal "disarmed"
			domoticz.devices('Alarmsirene').switchOn().forSec(.1)
		else
			-- Two peeps to signal "armed"
			domoticz.devices('Alarmsirene').switchOn().forSec(.1).repeatAfterSec(1,1)
		end
	end,
ronaldbro
Posts: 327
Joined: Thursday 15 November 2018 21:38
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: Netherlands
Contact:

Re: ideAlarm (A dzVents alarm environment)

Post by ronaldbro »

I think the most easy is to create a simple script for the switch and enable/disable the alarm from there.
Opus
Posts: 21
Joined: Monday 05 October 2015 9:31
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: ideAlarm (A dzVents alarm environment)

Post by Opus »

It's not very easy. The hole code is waiting for events. Close the Door Lock is a trigger, open is not. Now I trigger the alert_on button with my own script when I close or open the lock. The alert_on button goes to off with a 2sec delay. so the instruction.
ronaldbro
Posts: 327
Joined: Thursday 15 November 2018 21:38
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: Netherlands
Contact:

Re: ideAlarm (A dzVents alarm environment)

Post by ronaldbro »

I don't think I understand your problem.

You have a door lock which contains a switch. If the door is locked it will be 'On' and when you unlock the door it switches to 'Off'. When you lock the door you want to switch on the alarm without a delay. When you unlock the door you want to do nothing. Switching off the alarm will be done in a different way.
Is this correct?

Do you have the domoticz internal alarm panel configured in ideAlarm? If you do you can use the panel to switch on and off the alarm, but you can also use dzVents to switch on the alarm without using the toggle buttons.

In this case you can write a dzVents scripts triggered by your door lock switch. And in this script use the following code:

If domoticz.devices('door lock').active then
domoticz.devices('security panel').armAway()
end
Opus
Posts: 21
Joined: Monday 05 October 2015 9:31
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

Re: ideAlarm (A dzVents alarm environment)

Post by Opus »

You are right. I don't use the security panel at this time because I coul't it not activate. An error occurs. But your way over this panel looks interesting. I will try it again and report.
User avatar
DewGew
Posts: 579
Joined: Thursday 21 April 2016 12:01
Target OS: Raspberry Pi / ODroid
Domoticz version: V4.10618
Location: Sweden
Contact:

Re: ideAlarm (A dzVents alarm environment)

Post by DewGew »

Since BakSeeDaa has left domoticz I upload the alarm script to Github. (I have added the entryDelay function above) You can find it here:

https://github.com/DewGew/ideAlarm

Please feel free to modify it, extend and improve
Raspberry Pi 3 | domoticz | Aeon Labs Z-Stick GEN5 | RFlink gateway
NanoPi NEO-air | REGO6XX interface | Machinon theme | Homebridge | Domoticz Google Assistant | ideAlarm
THBR
Posts: 37
Joined: Saturday 02 November 2019 21:05
Target OS: -
Domoticz version:
Contact:

Re: ideAlarm (A dzVents alarm environment)

Post by THBR »

Hello,

I'm having trouble accessing, editing, and using the scripts.

I (beginner) have created and run some other scripts, made in Domoticz (via "Setup > More Options > Events"). These are, as normal, stored in the directory "home/pi/domoticz/scripts/dzvents/generated_scripts". All those scripts work fine.

Now I have installed the scripts for the alarm system according to the manual (wget ... etc.), so the scripts are stored in the directory "home/pi/domoticz/scripts/dzvents/scripts".

Although (checked) the scripts are indeed there, I cannot access them via the Domoticz Events editor. They are not visible at all in the listing. The script(s) are running because I get some errors in the Domoticz log.

How can I access and edit the scripts with the Domoticz Events editor?

Moving the scripts to the "home/pi/domoticz/scripts/dzvents/generated_scripts" directory presents another problem. Also the same problem when copy/paste the content of each script separately in the Events editor:
I can access, edit and save them, but now then they don't run at all.
The Domoticz log says it can't run them in "home/pi/domoticz/scripts/dzvents/scripts".
A restart of Domoticz did't help.


What am I doing wrong?

Thanks for the comments!

Regards, Theo (NL).
ronaldbro
Posts: 327
Joined: Thursday 15 November 2018 21:38
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: Netherlands
Contact:

Re: ideAlarm (A dzVents alarm environment)

Post by ronaldbro »

Hi Theo,

You should edit the script in an external editor. As they are made to be put in ./scripts/dzvents/scripts they can't be edited in the internal event editor.

Regards Ronald
THBR
Posts: 37
Joined: Saturday 02 November 2019 21:05
Target OS: -
Domoticz version:
Contact:

Re: ideAlarm (A dzVents alarm environment)

Post by THBR »

Hello Ronald,

Thanks for the quick response.

I was not aware of that. I was under the assumption that such dzVents lua scripts for/in Domoticz were formatted in a standard protocol?

So with these scripts it's not a matter of simple copy/paste in the Domoticz internal editor, confusing.

Can you advise me which external editor is the best to use for this.
ronaldbro
Posts: 327
Joined: Thursday 15 November 2018 21:38
Target OS: Raspberry Pi / ODroid
Domoticz version: 2020.2
Location: Netherlands
Contact:

Re: ideAlarm (A dzVents alarm environment)

Post by ronaldbro »

Hi Theo,

Don't know what system you use. On my raspberry pi I mostly use nano or geany I the graphical UI. On windows I would use Notepad+

Regards Ronald
sammyke007
Posts: 204
Joined: Monday 08 May 2017 20:48
Target OS: Raspberry Pi / ODroid
Domoticz version: 2022.1
Location: Belgium
Contact:

Re: ideAlarm (A dzVents alarm environment)

Post by sammyke007 »

I always use WinSCP to get into my Pi and then use Notepad++ to edit scripts. It recognizes most languages / syntaxes, works great and it's free!

Verstuurd vanaf mijn Oneplus 8 met Tapatalk

Post Reply

Who is online

Users browsing this forum: Bing [Bot] and 0 guests