Page 1 of 1

Script with Domoticz Security Panel

Posted: Friday 12 February 2021 19:44
by Nefsolive
Hello,

I am trying to create a script in dzvents with Domoticz Security Panel.

If the Domoticz Security Panel is in "Arm Way", and the doors sensors are activated to "open" then activate the alarm dummy to "On" after 15 seconds with a Beep.
If Domoticz Security Panel e is activated to "disable" then the doors sensors may be "on" and does not activate the alarm.

Has anyone created a script like this?

Ty

Re: Script with Domoticz Security Panel

Posted: Friday 12 February 2021 20:06
by waaren
Nefsolive wrote: Friday 12 February 2021 19:44 I am trying to create a script in dzvents with Domoticz Security Panel.
  • what do you have so far?
  • what are the names / idx of your doorsensors?
  • what is the name / idx / deviceType / deviceSubtype of your alarm dummy?
  • what is the name / idx of your security panel device?

Re: Script with Domoticz Security Panel

Posted: Friday 12 February 2021 20:27
by Nefsolive
waaren wrote: Friday 12 February 2021 20:06
Nefsolive wrote: Friday 12 February 2021 19:44 I am trying to create a script in dzvents with Domoticz Security Panel.
  • what do you have so far?
  • what are the names / idx of your doorsensors?
  • what is the name / idx / deviceType / deviceSubtype of your alarm dummy?
  • what is the name / idx of your security panel device?
Hello Waaren,
So far, i try whit blocky and i have some results, but i want try whit dzvents, and i have some dificult whit Security Panel!
This is my list;

[*]what are the names / idx of your doorsensors?
Porta / 9
Sótão Porta 1 / 1519
Sótão Porta 2 / 1523
Sótão Porta 3 / 1527
[*]what is the name / idx / deviceType / deviceSubtype of your alarm dummy?
Alarm /1531 / Light/Switch / Switch
[*]what is the name / idx of your security panel device?[/list]
Painel de Alarme / 1133

Thank u for your atention!

Re: Script with Domoticz Security Panel  [Solved]

Posted: Friday 12 February 2021 20:55
by waaren
Nefsolive wrote: Friday 12 February 2021 20:27 This is my list;
In it's most simple form it could look like below

Code: Select all

return
{
    on =
    {
        devices =
        {
            1519, 1523, 1527, -- doors
        },
    },

    logging =
    {
        level = domoticz.LOG_DEBUG, -- change to domoticz.LOG_ERROR when all OK
        marker = 'conditional Security',
    },

    execute = function(dz, item)

        dz.log('State of device ' .. item.name .. ' is now ' .. item.state, dz.LOG_DEBUG)

        local security = dz.devices(1133)
        local alarm = dz.devices(1531)

        if item.state == 'open' and security.state == dz.SECURITY_ARMEDAWAY then
            alarm.switchOn().afterSec(15)
            dz.log('beep', dz.LOG_DEBUG)
        end
    end
}


Re: Script with Domoticz Security Panel

Posted: Friday 12 February 2021 21:12
by Nefsolive
waaren wrote: Friday 12 February 2021 20:55
Nefsolive wrote: Friday 12 February 2021 20:27 This is my list;
In it's most simple form it could look like below

Code: Select all

return
{
    on =
    {
        devices =
        {
            1519, 1523, 1527, -- doors
        },
    },

    logging =
    {
        level = domoticz.LOG_DEBUG, -- change to domoticz.LOG_ERROR when all OK
        marker = 'conditional Security',
    },

    execute = function(dz, item)

        dz.log('State of device ' .. item.name .. ' is now ' .. item.state, dz.LOG_DEBUG)

        local security = dz.devices(1133)
        local alarm = dz.devices(1531)

        if item.state == 'open' and security.state == dz.SECURITY_ARMEDAWAY then
            alarm.switchOn().afterSec(15)
            dz.log('beep', dz.LOG_DEBUG)
        end
    end
}

Waaren, like you say, it's most simple form!
Thank u, one more time, for your help.

Works like a charm.