22.04.2024, 10:54
(This post was last modified: 22.04.2024, 10:59 by fleeceable.)
(22.04.2024, 08:47)mishoboss Wrote: Hi! Right now the D (disarmed) status is mapped to number 0 and the disarm control is mapped to number 5. I need disarm control and status to be mapped to the same number, for example 5. So I thought it would be easy to remap those here:
if areastatus == 'D' then
grp.update(security_main_ga .. '0/' .. areanumber , 5)
elseif areastatus == 'A' then
grp.update(security_main_ga .. '0/' .. areanumber , 1)
elseif areastatus == 'F' then
grp.update(security_main_ga .. '0/' .. areanumber , 2)
elseif areastatus == 'S' then
grp.update(security_main_ga .. '0/' .. areanumber , 3)
elseif areastatus == 'I' then
grp.update(security_main_ga .. '0/' .. areanumber , 4)
end
And added the fifth option here:
command_enum = {
[1] = 'A',
[2] = 'F',
[3] = 'S',
[4] = 'I',
[5] = 'D',
}
However DISARMED status is still reported as 0 instead of 5 right after disarming, or it's even not reported at all in some cases. I've scheduled a script to call request_area_status_ga = true every minute and this one successfully updates it to 5. So it works, just not right after DISARMING for some reason. All other controls successfully update the status, it's just the disarm one that is the issue. What I'm missing here?
You need to change this to get 5 for disarm:
user.guardZoneStatus
Code:
elseif eventgroup == 5 then -- user code entered on keypad
grp.update(security_main_ga .. '0/' .. areanumber , 0) ------<<<<<CHANGE THIS TO 5
grp.update(security_main_ga .. '0/' .. areanumber+10,false) --reset exit delay
grp.update(security_main_ga .. '0/' .. areanumber+20 , false) --reset entry delay
elseif eventgroup == 13 or eventgroup == 14 then -- disarm with master or user code
grp.update(security_main_ga .. '0/' .. areanumber , 0) ------<<<<<CHANGE THIS TO 5
grp.update(security_main_ga .. '0/' .. areanumber+10,false) --reset exit delay
grp.update(security_main_ga .. '0/' .. areanumber+20 , false) --reset entry delay
Also you don't need to change "command_enum" because that is used only to send right arming command (usual arm, force arm, stay arm etc). If AreaControl variable is 5 then it gonna disarm on either way. Check residential script line 104.