How do I set the security panel status to ArmAway/ArmHome/Disarm with dzvents? I'd need just a push button (or dummy switch with Alexa) for kids to arm the alarm, i.e. switch cameras on etc.
Probably too simple, but just couldn't figure it out.
Thanks in advance.
Arm/Disarm security with a script [Solved]
Moderator: leecollings
- waaren
- Posts: 6028
- Joined: Tuesday 03 January 2017 14:18
- Target OS: Linux
- Domoticz version: Beta
- Location: Netherlands
- Contact:
Re: Arm/Disarm security with a script
below is one way of controlling the security panel with a dzVents script.
[EDIT] used armHome() twice should have been disarm()
Code: Select all
return
{
on =
{
devices =
{
'armAway', -- push Buttons
'armHome',
'disarm',
},
},
logging =
{
level = domoticz.LOG_DEBUG, -- set to domoticz.LOG_ERROR if all OK
marker = 'Security',
},
execute = function(dz, item)
local security = dz.devices('Domoticz Security Panel') -- or any other name you gave the panel device
if item.name == 'armAway' then
security.armAway().afterSec(60) -- You have 60 seconds to leave the house ...
elseif item.name == 'armHome' then
security.armHome()
else
security.disarm()
end
end
}
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
-
- Posts: 75
- Joined: Sunday 27 September 2015 15:52
- Target OS: Raspberry Pi / ODroid
- Domoticz version:
- Location: Finland
- Contact:
Re: Arm/Disarm security with a script [Solved]
Perfect! It was just as simple as it should have been, but missed few details here and there - now it works.
Thanks waaren.
Thanks waaren.
- waaren
- Posts: 6028
- Joined: Tuesday 03 January 2017 14:18
- Target OS: Linux
- Domoticz version: Beta
- Location: Netherlands
- Contact:
Re: Arm/Disarm security with a script
I had to edit my previous post. Please use that one.
Debian buster, bullseye on RPI-4, Intel NUC.
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
dz Beta, Z-Wave, RFLink, RFXtrx433e, P1, Youless, Hue, Yeelight, Xiaomi, MQTT
==>> dzVents wiki
Who is online
Users browsing this forum: No registered users and 1 guest