Page 5 of 6

Re: ideAlarm (A dzVents alarm environment)

Posted: Monday 08 October 2018 16:27
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
}

Re: ideAlarm (A dzVents alarm environment)

Posted: Thursday 23 April 2020 23:43
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?

Re: ideAlarm (A dzVents alarm environment)

Posted: Saturday 25 April 2020 22:38
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?

Re: ideAlarm (A dzVents alarm environment)

Posted: Sunday 26 April 2020 15:19
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.

Re: ideAlarm (A dzVents alarm environment)

Posted: Sunday 26 April 2020 15:21
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!

Re: ideAlarm (A dzVents alarm environment)

Posted: Sunday 26 April 2020 21:17
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


Re: ideAlarm (A dzVents alarm environment)

Posted: Sunday 26 April 2020 22:17
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.

Re: ideAlarm (A dzVents alarm environment)

Posted: Sunday 26 April 2020 22:33
by sammyke007
Are you willing to share your changes please? Maybe in PM?

Verstuurd vanaf mijn ONEPLUS A6003 met Tapatalk


Re: ideAlarm (A dzVents alarm environment)

Posted: Sunday 26 April 2020 22:52
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.

Re: ideAlarm (A dzVents alarm environment)

Posted: Wednesday 08 July 2020 17:19
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,

Re: ideAlarm (A dzVents alarm environment)

Posted: Wednesday 08 July 2020 19:53
by ronaldbro
I think the most easy is to create a simple script for the switch and enable/disable the alarm from there.

Re: ideAlarm (A dzVents alarm environment)

Posted: Wednesday 08 July 2020 22:57
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.

Re: ideAlarm (A dzVents alarm environment)

Posted: Wednesday 08 July 2020 23:43
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

Re: ideAlarm (A dzVents alarm environment)

Posted: Thursday 09 July 2020 0:19
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.

Re: ideAlarm (A dzVents alarm environment)

Posted: Thursday 09 July 2020 8:31
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

Re: ideAlarm (A dzVents alarm environment)

Posted: Tuesday 07 December 2021 0:11
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).

Re: ideAlarm (A dzVents alarm environment)

Posted: Tuesday 07 December 2021 8:56
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

Re: ideAlarm (A dzVents alarm environment)

Posted: Tuesday 07 December 2021 20:19
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.

Re: ideAlarm (A dzVents alarm environment)

Posted: Tuesday 07 December 2021 20:57
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

Re: ideAlarm (A dzVents alarm environment)

Posted: Tuesday 07 December 2021 23:30
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