Page 1 of 1

Does otherdevices['Domoticz Security Panel'] not work any longer?

Posted: Sunday 11 June 2017 18:50
by Keleos
Hello everyone,

does the following bit of code does not work any longer?

Code: Select all

if (otherdevices['Domoticz Security Panel'] == 'Arm Away') then
because I do not get this code working:

Code: Select all

commandArray = {}
tc=next(devicechanged)
MCS_switch=tostring(tc)

-- Pruefe den Ausloeser Name auf "Tuer"
if (MCS_switch:sub(5,8) == 'Tuer') then

    -- Ist das Domoticz Security Panel auf "Arm Away" gestellt?
    if (otherdevices['Domoticz Security Panel'] == 'Arm Away') then

        -- Eintrag in das Protokoll schreiben
        print('Oeffnung der Tuer erkannt an: '..MCS_switch)

        -- Ereignis in Variablen merken
        commandArray['Variable:LastAlarmDevice'] = 'Oeffnung der Tuer erkannt an: '..MCS_switch
        commandArray['AlarmDetected']='On'

        -- Benachrichtigung senden
        -- commandArray['SendNotification']='Oeffnung der Tuer erkannt an: '..MCS_switch

    end
end

return commandArray
The Domoticz Security Panel State is ignored totaly :(

Greetings

Re: Does otherdevices['Domoticz Security Panel'] not work any longer?

Posted: Sunday 11 June 2017 19:20
by jvdz
Keleos wrote:Hello everyone,

does the following bit of code does not work any longer?

Code: Select all

if (otherdevices['Domoticz Security Panel'] == 'Arm Away') then
Don't think that ever worked as that needs to be 'Armed Away'. ;)
I use this way to test it by the way:

Code: Select all

if (globalvariables['Security'] == "Armed Away") then
Jos

Re: Does otherdevices['Domoticz Security Panel'] not work any longer?

Posted: Sunday 11 June 2017 19:25
by Keleos
Hi,

thank you very much for your response :)

The strange thing, the following code enables and disables the Alarm Panel but I'm not able to get the state :(

Code: Select all

commandArray = {}
tc=next(devicechanged)
Panel=tostring(tc)

-- Pruefe den Ausloeser Name auf "Keypad"
if (Panel:sub(5,10) == 'Keypad') then

    -- Die Variable "Security Panel" auf den Status des Keypads setzen
    if (devicechanged[Panel] == 'On') then

        -- Eintrag in das Protokoll schreiben
        print('Keypad Alarm-Status: Arm Away')

        -- Domoticz Security Panel deaktivieren
        commandArray['Domoticz Security Panel'] = 'Arm Away'

    else

        -- Eintrag in das Protokoll schreiben
        print('Keypad Alarm-Status: Ausgeschaltet')

        -- Domoticz Security Panel deaktivieren
        commandArray['Domoticz Security Panel'] = 'Disarm'

        -- Ereignis in Variablen merken
        commandArray['Keypad Ack'] = 'On'

    end

end
return commandArray
I'm trying to set up this description:

https://www.domoticz.com/forum/search.p ... sf=msgonly

Greetings

Re: Does otherdevices['Domoticz Security Panel'] not work any longer?

Posted: Sunday 11 June 2017 19:28
by jvdz
Did you try this using globalvariables['Security'] to retrieve the current status?

Jos

Re: Does otherdevices['Domoticz Security Panel'] not work any longer?

Posted: Sunday 11 June 2017 19:31
by Keleos
No, how could I do this?

Greetings
Kel

Re: Does otherdevices['Domoticz Security Panel'] not work any longer?

Posted: Sunday 11 June 2017 19:34
by jvdz
Not sure what you exactly want to do so please explain what you want to accomplish exactly with this the status value?

Jos

Re: Does otherdevices['Domoticz Security Panel'] not work any longer?

Posted: Sunday 11 June 2017 19:38
by Keleos
I just tested the global variable you recommended and it works wonderful :)

I try to test if the Domoticz Security Panel is set to "Armed Away", "Armed Home" or "Disabled" so every sensor recognizing a motion knows if he should trigger the alert.

Now I can continue scripting. Thank you very much :)