How to store PIN codes for DSC Arming

I finally installed the DSC plugin…great work! Running version 0.38 from apps.mios.com. I realize the security concerns with storing the PIN in Vera, and I’m OK with that. I can disarm via a scene without a problem.

I’m trying to use “ArmedInstant” or something that will have zero-entry delay (like *9PIN arming).

According to the DSC documentation (version 1.03), the command “032” is “Partition Arm Control – Zero Entry Delay”
The plugin will use this command at the following time:
RequestQuickArmMode → ArmedInstant
RequestQuickArmMode ->Vacation
RequestArmMode → ArmedInstant
RequestQuickArmMode ->Vacation

When the Envisalink gets that command, it responds with “900” which is “Code Required” I see in the logs the “900” coming in (time=0:41:32.069), but no action is taken on it (I think). I know PINs are not stored in the plugin (only in scenes), so can this not be done?

Here is the log output (verbose logging enabled):

[code]10 11/21/12 0:41:31.488 UPnPCallbackEventHandler 0 start PIDLOG2 14905 <0x302b2680>
10 11/21/12 0:41:31.488 UPnPCallbackEventHandler action RunScene request pMem 0x1a6b000/27701248 diff: 19300352 <0x302b2680>
10 11/21/12 0:41:31.488 sbrk JobHandler_LuaUPnP::HandleActionRequest from IP:127.0.0.1 pMem 0x1a6b000/27701248 diff: 19300352 <0x302b2680>
08 11/21/12 0:41:31.489 JobHandler_LuaUPnP::HandleActionRequest device: 0 service: urn:micasaverde-com:serviceId:HomeAutomationGateway1 action: RunScene <0x302b2680>
08 11/21/12 0:41:31.489 JobHandler_LuaUPnP::HandleActionRequest argument SceneNum=111 <0x302b2680>
08 11/21/12 0:41:31.489 Scene::RunScene running 111 Arm-ArmedInstant <0x302b2680>
10 11/21/12 0:41:31.490 sbrk JobHandler_LuaUPnP::HandleActionRequest from IP:255.255.255.255 pMem 0x1a6b000/27701248 diff: 19300352 <0x302b2680>
08 11/21/12 0:41:31.490 JobHandler_LuaUPnP::HandleActionRequest device: 224 service: urn:micasaverde-com:serviceId:AlarmPartition2 action: RequestArmMode <0x302b2680>
08 11/21/12 0:41:31.491 JobHandler_LuaUPnP::HandleActionRequest argument State=ArmedInstant <0x302b2680>
08 11/21/12 0:41:31.491 JobHandler_LuaUPnP::HandleActionRequest argument PINCode=XXXX <0x302b2680>
50 11/21/12 0:41:31.492 luup_log:217: DSCAlarmPanel: debug Action::RequestArmMode ArmedInstant <0x302b2680>
50 11/21/12 0:41:31.492 luup_log:217: DSCAlarmPanel: debug extractPartition: Partition 1 <0x302b2680>
25 11/21/12 0:41:31.493 luup_io_write 217 size: 6 <0x302b2680>
51 11/21/12 0:41:31.493 0x30 0x33 0x32 0x31 0x43 0x36 0xd 0xa (0321C6\r\n) <0x302b2680>
25 11/21/12 0:41:31.494 luup_io_write 217 result: 1 <0x302b2680>
10 11/21/12 0:41:31.495 UPnPCallbackEventHandler action RunScene request done pMem 0x1a6b000/27701248 diff: 19300352 took 0 <0x302b2680>
52 11/21/12 0:41:31.569 0x35 0x30 0x30 0x30 0x33 0x32 0x32 0x41 (5000322A) <0x30b42680>
50 11/21/12 0:41:31.569 luup_log:217: DSCAlarmPanel: debug processIncoming:: Command=500, Data=‘032’, Checksum=2A <0x30b42680>
52 11/21/12 0:41:32.069 0x39 0x30 0x30 0x39 0x39 (90099) <0x30b42680>
50 11/21/12 0:41:32.069 luup_log:217: DSCAlarmPanel: debug processIncoming:: Command=900, Data=‘’, Checksum=99 <0x30b42680>
52 11/21/12 0:41:32.070 0x35 0x31 0x30 0x38 0x30 0x46 0x45 (51080FE) <0x30b42680>
50 11/21/12 0:41:32.071 luup_log:217: DSCAlarmPanel: debug processIncoming:: Command=510, Data=‘80’, Checksum=FE <0x30b42680>
50 11/21/12 0:41:32.071 luup_log:217: DSCAlarmPanel: debug Panel::Keypad LED State - Partition 1 only (80) <0x30b42680>
10 11/21/12 0:41:33.362 UPnPCallbackEventHandler 4 start PIDLOG2 14905 <0x2fcb2680>
31 11/21/12 0:41:45.100 AlarmManager::Run 0x8042c8 notified of a change entry 0x1946da8 id 375 deleted 0 <0x2bc71680>
31 11/21/12 0:41:45.101 AlarmManager::Run callback for alarm 0x8042c8 entry 0x1946da8 type 51 id 375 param=(nil) entry->when: 1353487305 time: 1353487305 tnum: 1 slow 0 tardy 0 <0x2bc71680>
24 11/21/12 0:41:45.101 ZWaveJobHandler::ServicePollLoop ZWJob_GetNodeDetails=1 || ZWJob_PollNode running=0 jobs=job#121 :getnodedetails_ri 37 (0x17408e0) P:110 S:0 node 37 / config 0 add 0 <
10 11/21/12 0:41:45.102 AlarmManager::AddRelativeAlarm current time 1353487305 delay 20 type 51 <0x2bc71680>
31 11/21/12 0:41:45.102 AlarmManager::CancelAlarmByType_DoIt 0x8042c8 type 51/51 id 375 entry 0x1946da8 deleted 0 waiting 1 <0x2bc71680>
10 11/21/12 0:41:45.102 AlarmManager::AddAbsoluteAlarm alarm 0x8042c8 entry 0x17c5988 id 376 type 51 param=(nil) entry->when: 1353487325 time: 1353487305 bCancelFirst 1=1 <0x2bc71680>
31 11/21/12 0:41:45.103 AlarmManager::Run 0x8042c8 notified of a change entry 0x89e648 id 62 deleted 0 <0x2be71680>
31 11/21/12 0:41:45.103 AlarmManager::Run finish callback for alarm 0x8042c8 entry 0x1946da8 type 51 id 375 param=(nil) entry->when: 1353487305 time: 1353487305 tnum: 1 slow 0 duration 0 <0x2bc7

12 11/21/12 0:42:00.077 luvd_get_info_data_request starting /data_request?id=lu_status&DataVersion=487178281&MinimumDelay=1000&Timeout=60&LoadTime=1353487177&rand=0.15208970475941896 pMem 0x1a6b
10 11/21/12 0:42:00.099 JobHandler_LuaUPnP::HandleRequest id lu_status request pMem 0x1a6b000/27701248 diff: 19300352 <0x30d42680>
52 11/21/12 0:42:00.572 0x35 0x31 0x30 0x38 0x31 0x46 0x46 (51081FF) <0x30b42680>
50 11/21/12 0:42:00.572 luup_log:217: DSCAlarmPanel: debug processIncoming:: Command=510, Data=‘81’, Checksum=FF <0x30b42680>
50 11/21/12 0:42:00.573 luup_log:217: DSCAlarmPanel: debug Panel::Keypad LED State - Partition 1 only (81) <0x30b42680>
52 11/21/12 0:42:01.076 0x36 0x35 0x30 0x31 0x43 0x43 (6501CC) <0x30b42680>
50 11/21/12 0:42:01.077 luup_log:217: DSCAlarmPanel: debug processIncoming:: Command=650, Data=‘1’, Checksum=CC <0x30b42680>
06 11/21/12 0:42:01.077 Device_Variable::m_szValue_set device: 224 service: urn:micasaverde-com:serviceId:AlarmPartition2 variable: VendorStatusData was: now: #hooks: 0 upnp: 0 v:0xdcf128/NONE
10 11/21/12 0:42:01.078 UserData::m_iDataVersion_Variables_incr VendorStatusData user data 487177007 variables 487178287 <0x30b42680>
10 11/21/12 0:42:01.078 UserData::DataIsDirty UpdateStateList was 1 incr 0 user data 487177007 variables 487178287 <0x30b42680>
06 11/21/12 0:42:01.078 Device_Variable::m_szValue_set device: 224 service: urn:micasaverde-com:serviceId:AlarmPartition2 variable: VendorStatusCode was: 841 now: 650 #hooks: 0 upnp: 0 v:0xdcf0e
10 11/21/12 0:42:01.079 UserData::m_iDataVersion_Variables_incr VendorStatusCode user data 487177007 variables 487178288 <0x30b42680>
10 11/21/12 0:42:01.079 UserData::DataIsDirty UpdateStateList was 1 incr 0 user data 487177007 variables 487178288 <0x30b42680>
06 11/21/12 0:42:01.080 Device_Variable::m_szValue_set device: 224 service: urn:micasaverde-com:serviceId:AlarmPartition2 variable: VendorStatus was: Trouble Status (LED OFF) now: Ready #hooks:
10 11/21/12 0:42:01.080 UserData::m_iDataVersion_Variables_incr VendorStatus user data 487177007 variables 487178289 <0x30b42680>
10 11/21/12 0:42:01.081 UserData::DataIsDirty UpdateStateList was 1 incr 0 user data 487177007 variables 487178289 <0x30b42680>
50 11/21/12 0:42:01.081 luup_log:217: DSCAlarmPanel: debug Partition::Ready 650 partition: 1 <0x30b42680>
06 11/21/12 0:42:01.082 Device_Variable::m_szValue_set device: 224 service: urn:micasaverde-com:serviceId:AlarmPartition2 variable: ArmMode was: Disarmed now: Disarmed #hooks: 0 upnp: 0 v:0xdd02
06 11/21/12 0:42:01.082 Device_Variable::m_szValue_set device: 224 service: urn:micasaverde-com:serviceId:AlarmPartition2 variable: DetailedArmMode was: Ready now: Ready #hooks: 0 upnp: 0 v:0xe3
06 11/21/12 0:42:01.083 Device_Variable::m_szValue_set device: 224 service: urn:micasaverde-com:serviceId:DSCAlarmPartition1 variable: ArmModeNum was: 0 now: 0 #hooks: 0 upnp: 0 v:(nil)/NONE dup
06 11/21/12 0:42:01.083 Device_Variable::m_szValue_set device: 224 service: urn:micasaverde-com:serviceId:AlarmPartition2 variable: ArmMode was: Disarmed now: Disarmed #hooks: 0 upnp: 0 v:0xdd02
[/code]

I’m not at home to test this at the moment, but…

If you are happy doing it from a scene, then you could try something like the following luup code:

luup.call_action("urn:micasaverde-com:serviceId:DSCAlarmPanel1", "SendCommand", {Command = "071", Data="1*9XXXX"}, YY)

XXXX would be your PIN, and YY is the device number of the panel.

Looks like that worked. Thank!

… or use “[tt]Armed[/tt]” or “[tt]Force[/tt]” if you want to do it declaratively.

“[tt]ArmedInstant[/tt]” is mapped to 032 as a command to the DSC, and the PINCode parameter is not passed through. “[tt]Armed[/tt]” will send a “033” if the PINCode is passed, and “030” if it’s not.

Why is “032” coded that way, if the “900” can’t be responded to with a PIN?

It ends up stalling my Envisalink for a bit, while the Envisalink waits for the PIN

Ok, I found a way to do it and not store the PIN.

Do QuickArm with “Stay” and wait at least the exit delay. Then do another QuickArm with “ArmedInstant”

That will kick the panel into no-entry delay and won’t require the “900” response.

You said you can disarm in a scene. I’ve been trying all day to disarm but I can’t get it to work. I can stay arm and arm. I would appreciate any help.

Have you read to the additional setup on the wiki page?

http://code.mios.com/trac/mios_dscalarmpanel

I did read it a few times. I know I’m missing it. Because in the wiki page it says to disarm pin code needed. I’ve set up scenes to arm away and to arm stay, and it’s working. I’ve set up a scene to disarm but once the alarm is armed it won’t disarm. It doesn’t allow me to put in the code. In device mode everything works fine.

[quote=“strangely, post:8, topic:173359”]Have you read to the additional setup on the wiki page?

http://code.mios.com/trac/mios_dscalarmpanel[/quote]

I’ve read this page a few times. I created a scene and went to the advanced tab…selected the Alarm Keypad and set RequestQuickArmMode and used NightInstant. When I run the scene, it doesn’t arm the system in night mode. I looked at the logs and i see where its sending the command and I noticed the light goes off on the keypad and then back on. But it still doesn’t arm in night mode.

There is no “night instant” mode in the Envisalink documentation, so the code maps the “NightInstant” as follows:elseif (state == "NightInstant") then -- No NightInstant command, use Stay instead. sendPartitionCommand("031", lul_device)

To get to night mode (where some motion sensors, etc. are armed), can you do a regular stay arming, then a short time later, send a “*1?”

If you want the “zero-entry delay” like I did, see my earlier post.

[quote=“PurdueGuy, post:11, topic:173359”]There is no “night instant” mode in the Envisalink documentation, so the code maps the “NightInstant” as follows:elseif (state == "NightInstant") then -- No NightInstant command, use Stay instead. sendPartitionCommand("031", lul_device)

To get to night mode (where some motion sensors, etc. are armed), can you do a regular stay arming, then a short time later, send a “*1?”

If you want the “zero-entry delay” like I did, see my earlier post.[/quote]

Thanks for the response! I’ll give that a go!

[quote=“PurdueGuy, post:6, topic:173359”]Ok, I found a way to do it and not store the PIN.

Do QuickArm with “Stay” and wait at least the exit delay. Then do another QuickArm with “ArmedInstant”

That will kick the panel into no-entry delay and won’t require the “900” response.[/quote]

Do you do this in LUUP code? Or can you do it with code? If so any help with the code.

I am using luup code with pin stored for instant arming and have the scene scheduled. however, if wife gets trigger happy when the schedule runs it disarms. No good for security conscious wife.

[quote=“klop, post:13, topic:173359”]Do you do this in LUUP code? Or can you do it with code? If so any help with the code.

I am using luup code with pin stored for instant arming and have the scene scheduled. however, if wife gets trigger happy when the schedule runs it disarms. No good for security conscious wife.[/quote]No LUUP code, just the graphical scene editor.

Create a scene, with 1 delay, so you have “Immediate” and “1 minute” in the delay drop down.
Set the delay to “Immediate”
Go to the Advanced tab, and from main drop down, choose the partition, hit add. From the new drop down that appears, hit “RequestQuickArmMode” and enter “Stay” (no quotes) in the box that appears.
Set the delay to “1 minute”.
Still inthe Advanced tab, and from main drop down, choose the partition, hit add. From the new drop down that appears, hit “RequestQuickArmMode” and enter “ArmedInstant” (no quotes) in the box that appears.

Note: Your delay must be longer than your exit delay. My exit delay is 45 seconds, so 1 minute is enough. If you exit delay is 60 sends, use 75 seconds, etc.