I have an strange problem.
In my domoticz-system (rpi3B+ with raspbian) I wanted to use the remote control (Aeontec Keyfob gen5) to switch between security panel alarm status: Disable, Arm Away, Arm Home. With some puzzling this is working well now with the following script:
Code: Select all
commandArray = {}
if (devicechanged['remote-1'] == 'On') then
commandArray['Domoticz Security Panel'] = 'Arm Away'
print('### SecPanel: status changed to ' .. globalvariables['Security'])
end
if (devicechanged['remote-2'] == 'On') then
commandArray['Domoticz Security Panel'] = 'Arm Home'
print('### SecPanel: status changed to ' .. globalvariables['Security'])
end
if (devicechanged['remote-3'] == 'On') then
commandArray['Domoticz Security Panel'] = 'Disarm'
print('### SecPanel: status changed to ' .. globalvariables['Security'])
end
return commandArray
This script is saved as device Lua.
Changing the status of Alarm by buttons works. But the log is showing the last status of the security panel instead of the new one.
What can I change in this script to fix this? Any tips?