Page 1 of 1

Lua Script Zipato mini RFiD TagKey reacts not good.

Posted: Wednesday 16 January 2019 22:07
by VeldmDomo
Dear form members,
I'm running into the next problem. I am working on an alarm system in domoticz.
To enable and disable this, I want to use the Zipato mini RFiD keypad reader with tag.
As a basis for the configuration, I used the following article on the internet:
https://nl.hardware.info/reviews/7925/w ... t-domoticz ( Dutch site)
I have registered the Zipato RFiD on the domoticz's Zwave controller.
Image
I also configured the divices of the Zipato RFiD.
Image
Then I put a lua script into domotics that must ensure that when AlarmRFIDpanel switch goes off or on, it converts it into Disarmed or Armed Away.
Image
Here, however, it goes wrong. When I switch Away (Armed Away) on the Zipato RFiD I see in the logging:
Status: LUA: ### SecPanel: status changed to Disarmed.
When I switch Home (Disarmed) on the Zipato RFiD, I see the same thing again in the logging:
Status: LUA: ### SecPanel: status changed to Disarmed
When I switch Away it must change to Armed Away. This does not happen, however.
Image
I have reed other posts, but seems not exactly the problem I have.
Can someone help me to solve the problem?

Re: Lua Script Zipato mini RFiD TagKey reacts not good.

Posted: Wednesday 16 January 2019 23:01
by Droll
Try this one, this if the one I am using , and it does work :-)
It's mainly from the wiki here onsite...

Code: Select all

commandArray = {}
 if (devicechanged['AlarmRFIDpaneel']) then
        if (otherdevices['AlarmRFIDpaneel'] == 'On') then
                print('AlarmPanel Arm Away')
                commandArray['Security Panel'] = 'Arm Away'
                        else
                print('AlarmPanel Disarmed')
                commandArray['Security Panel'] = 'Disarm'
                
                
        end
end
return commandArray
Arne K

Re: Lua Script Zipato mini RFiD TagKey reacts not good.

Posted: Friday 18 January 2019 21:37
by VeldmDomo
Hi Arne,
Thanks for your script.
I tried this, and in the logging I saw Arm Away and Disarmed when it was switched on.
A big stap forward.
However, the alarm did not actually start.
After some searching on the internet I put the following command: commandArray ['Keypad Ack'] = 'On'
This ensured that the Arm Away and Disarm command was actually accepted in domoticz.
What I also found out was that if there is an alarm, it could not be switched off by deactivating the alarm.
I solved this by placing the command: commandArray ['AlarmSituationUitV0.1'] = 'Off'.

Code: Select all

commandArray = {}
 if (devicechanged['AlarmRFIDpaneel']) then
        if (otherdevices['AlarmRFIDpaneel'] == 'On') then
                print('AlarmPanel Arm Away')
                commandArray['Domoticz Security Panel'] = 'Arm Away'
                       else
                print('AlarmPanel Disarmed')
                commandArray['Domoticz Security Panel'] = 'Disarm'
                commandArray['AlarmSituatieUitV0.1'] = 'Off'
                commandArray['Keypad Ack'] = 'On'
                
                
        end
end
return commandArray
Image

Alex.