Page 1 of 1

switching alarm panel

Posted: Wednesday 14 July 2021 14:51
by JuanUil
Hi,

I am trying to switch the domoticz security panel in lua.

I tried:

Code: Select all

if (devicechanged['Thuis'] == 'Off') then
	print ('testing')
	commandArray['Security Panel'] = 'Arm Away'
no result

Code: Select all

if (devicechanged['Thuis'] == 'Off') then
	print ('testing')
	commandArray['Alarm Panel'] = 'Arm Away'
no result

Code: Select all

if (devicechanged['Thuis'] == 'Off') then
	print ('testing')
	commandArray['SecPanel'] = 'Arm Away'
no result

anyone any idea what i am doing wrong?

Re: switching alarm panel

Posted: Wednesday 14 July 2021 15:32
by AllesVanZelf
I think you have to use: security.armAway()
See: wiki
and search for: Security Panel

Re: switching alarm panel

Posted: Thursday 15 July 2021 8:51
by JuanUil
AllesVanZelf wrote: Wednesday 14 July 2021 15:32 I think you have to use: security.armAway()
See: wiki
and search for: Security Panel
I am using LUA not Dzvents so this is not working.

Re: switching alarm panel

Posted: Thursday 15 July 2021 9:00
by AllesVanZelf
Okay, sorry. Missed that part.

Re: switching alarm panel

Posted: Thursday 15 July 2021 9:06
by waltervl
In this topic https://domoticz.com/forum/viewtopic.ph ... el#p247937
the security panel is called "Domoticz Security Panel"

Re: switching alarm panel

Posted: Thursday 15 July 2021 9:35
by JuanUil
waltervl wrote: Thursday 15 July 2021 9:06 In this topic https://domoticz.com/forum/viewtopic.ph ... el#p247937
the security panel is called "Domoticz Security Panel"
thnx for yourreply but also not working, alarm panel isn't switched. :?:

Re: switching alarm panel

Posted: Thursday 15 July 2021 10:10
by waltervl
In this topic also some interesting tips about this issue: https://domoticz.com/forum/viewtopic.php?f=61&t=1785
Can you manually set the security panel (with the PIN code)?

Re: switching alarm panel

Posted: Thursday 15 July 2021 12:59
by JuanUil
found the problem!
The panel was not in the devices tab.
So I changed the code, armed and disarmed it manually. then the panel appeared in the devices tab and I could use it in my LUA script.

Thanx everybody.

Re: switching alarm panel

Posted: Saturday 24 July 2021 8:27
by lost
JuanUil wrote: Thursday 15 July 2021 12:59 found the problem!
The panel was not in the devices tab.
So I changed the code, armed and disarmed it manually. then the panel appeared in the devices tab and I could use it in my LUA script.
Just take care that string used to check security panel status is different than the one to change it, for instance:
Check if Disarmed :
devicechanged[devSecPanel] == 'Normal'

Set status (if may be done by something external to secpanel, script, BT/Wifi presence detection using smartphones...):
commandArray[devSecPanel] = 'Disarm'
(To arm, this would be setting 'Arm Away').

This tricked me a few times...