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

Moderator: leecollings

Post Reply
Keleos
Posts: 29
Joined: Saturday 27 May 2017 9:37
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post 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
User avatar
jvdz
Posts: 2334
Joined: Tuesday 30 December 2014 19:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.107
Location: Netherlands
Contact:

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

Post 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
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
Keleos
Posts: 29
Joined: Saturday 27 May 2017 9:37
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post 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
User avatar
jvdz
Posts: 2334
Joined: Tuesday 30 December 2014 19:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.107
Location: Netherlands
Contact:

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

Post by jvdz »

Did you try this using globalvariables['Security'] to retrieve the current status?

Jos
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
Keleos
Posts: 29
Joined: Saturday 27 May 2017 9:37
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post by Keleos »

No, how could I do this?

Greetings
Kel
User avatar
jvdz
Posts: 2334
Joined: Tuesday 30 December 2014 19:25
Target OS: Raspberry Pi / ODroid
Domoticz version: 4.107
Location: Netherlands
Contact:

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

Post 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
New Garbage collection scripts: https://github.com/jvanderzande/GarbageCalendar
Keleos
Posts: 29
Joined: Saturday 27 May 2017 9:37
Target OS: Raspberry Pi / ODroid
Domoticz version:
Contact:

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

Post 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 :)
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest