AD2SmartThings

I am using a valid user code, so that should work. The AD2Pi has a blinking led (a couple times a sec). The messages I see in the message tile appear to be from the AD2Pi, not the alarm panel. (Sample log below)
9f1d1d16-b37b-49bf-a039-b195c522bfeb 8:11:12 PM: info Alarm Message Is:'!CONFIG>MODE=A&CONFIGBITS=ff04&ADDRESS=21&LRR=N&COM=N&EXP=NNNN!>null' 9f1d1d16-b37b-49bf-a039-b195c522bfeb 8:11:10 PM: error java.lang.NullPointerException: Cannot invoke method contains() on null object @ line 377 9f1d1d16-b37b-49bf-a039-b195c522bfeb 8:11:10 PM: info Alarm Message Is:'!CONFIG>MODE=A&CONFIGBITS=ff04&ADDRESS=21!>null' 9f1d1d16-b37b-49bf-a039-b195c522bfeb 8:11:07 PM: debug sending AD2Pi Config Command: null 9f1d1d16-b37b-49bf-a039-b195c522bfeb 8:11:06 PM: debug sending AD2Pi Config Command: null 9f1d1d16-b37b-49bf-a039-b195c522bfeb 8:09:50 PM: info Alarm Message Is:'!CONFIG>MODE=A&CONFIGBITS=ff04&ADDRESS=21&LRR=N&COM=N&EXP=NNNN!>ADDRESS=21' 9f1d1d16-b37b-49bf-a039-b195c522bfeb 8:09:49 PM: info Alarm Message Is:'!setting ADDRESS 21' 9f1d1d16-b37b-49bf-a039-b195c522bfeb 8:09:45 PM: debug sending AD2Pi Config Command: ADDRESS=21

None of the sensor message tiles show a status. I have checked the DO and DI wires many times, I even reversed them to see if that helped … it did not.

I am trolling the AlarmDecoder blogs now for clues. Any other suggestions? And thanks for your help, again

I uncommented some of the additional logging (debug) lines and have some more log file is that helps…

In the log below I set the ADDRESS=21 and hit AD2PI Config, then cleared that field i the Preferences and hit it again. My Alarm Panel does have an unused Keypad activated at address 21.

9f1d1d16-b37b-49bf-a039-b195c522bfeb 9:54:15 PM: debug Alarm Message Is:'ping' 9f1d1d16-b37b-49bf-a039-b195c522bfeb 9:54:15 PM: debug Parsing: catchall: 0104 0000 01 01 0140 00 F1B6 00 00 0000 0A 00 0A70696E67 9f1d1d16-b37b-49bf-a039-b195c522bfeb 9:54:09 PM: debug [Alarm System msg is !CONFIG>MODE=A&CONFIGBITS=ff04&ADDRESS=21!>null] 9f1d1d16-b37b-49bf-a039-b195c522bfeb 9:54:09 PM: info Alarm Message Is:'!CONFIG>MODE=A&CONFIGBITS=ff04&ADDRESS=21!>null' 9f1d1d16-b37b-49bf-a039-b195c522bfeb 9:54:09 PM: debug Alarm Message Is:'!CONFIG>MODE=A&CONFIGBITS=ff04&ADDRESS=21!>null' 9f1d1d16-b37b-49bf-a039-b195c522bfeb 9:54:09 PM: debug Parsing: catchall: 0104 0000 01 01 0140 00 F1B6 00 00 0000 0A 00 0A21434F4E4649473E4D4F44453D4126434F4E464947424954533D6666303426414444524553533D3231213E6E756C6C 9f1d1d16-b37b-49bf-a039-b195c522bfeb 9:54:08 PM: debug Alarm Message Is:'' 9f1d1d16-b37b-49bf-a039-b195c522bfeb 9:54:08 PM: debug Parsing: catchall: 0104 0000 01 01 0140 00 F1B6 00 00 0000 0B 01 0A00 9f1d1d16-b37b-49bf-a039-b195c522bfeb 9:54:07 PM: debug sending AD2Pi Config Command: null 9f1d1d16-b37b-49bf-a039-b195c522bfeb 9:53:14 PM: debug Alarm Message Is:'ping' 9f1d1d16-b37b-49bf-a039-b195c522bfeb 9:53:14 PM: debug Parsing: catchall: 0104 0000 01 01 0140 00 F1B6 00 00 0000 0A 00 0A70696E67 9f1d1d16-b37b-49bf-a039-b195c522bfeb 9:52:35 PM: debug [Alarm System msg is !setting ADDRESS 21] 9f1d1d16-b37b-49bf-a039-b195c522bfeb 9:52:35 PM: info Alarm Message Is:'!setting ADDRESS 21' 9f1d1d16-b37b-49bf-a039-b195c522bfeb 9:52:35 PM: debug Alarm Message Is:'!setting ADDRESS 21' 9f1d1d16-b37b-49bf-a039-b195c522bfeb 9:52:35 PM: debug Parsing: catchall: 0104 0000 01 01 0140 00 F1B6 00 00 0000 0A 00 0A2173657474696E672041444452455353203231 9f1d1d16-b37b-49bf-a039-b195c522bfeb 9:52:35 PM: debug [Alarm System msg is !>ADDRESS=21] 9f1d1d16-b37b-49bf-a039-b195c522bfeb 9:52:35 PM: info Alarm Message Is:'!>ADDRESS=21' 9f1d1d16-b37b-49bf-a039-b195c522bfeb 9:52:35 PM: debug Alarm Message Is:'!>ADDRESS=21' 9f1d1d16-b37b-49bf-a039-b195c522bfeb 9:52:35 PM: debug Parsing: catchall: 0104 0000 01 01 0140 00 F1B6 00 00 0000 0A 00 0A213E414444524553533D3231 9f1d1d16-b37b-49bf-a039-b195c522bfeb 9:52:34 PM: debug Alarm Message Is:'' 9f1d1d16-b37b-49bf-a039-b195c522bfeb 9:52:34 PM: debug Parsing: catchall: 0104 0000 01 01 0140 00 F1B6 00 00 0000 0B 01 0A00 9f1d1d16-b37b-49bf-a039-b195c522bfeb 9:52:33 PM: debug sending AD2Pi Config Command: ADDRESS=21

@scottma61,
Based on your log files, it looks like you have communication between Smartthings, the Arduino and the AD2Pi, but not with the alarm panel.

Here is the log file when I send over a configuration address and a <null:
03e016b5-c2f8-4719-bb3c-2d1c33d3a42a 11:00:04 PM CDT: info Alarm Message Is:’"DISARMED READY TO ARM "‘
03e016b5-c2f8-4719-bb3c-2d1c33d3a42a 10:59:53 PM CDT: info Alarm Message Is:’"DISARMED READY TO ARM "‘
03e016b5-c2f8-4719-bb3c-2d1c33d3a42a 10:59:40 PM CDT: debug sending AD2Pi Config Command: null
03e016b5-c2f8-4719-bb3c-2d1c33d3a42a 10:59:31 PM CDT: info Alarm Message Is:’"DISARMED READY TO ARM "‘
03e016b5-c2f8-4719-bb3c-2d1c33d3a42a 10:59:20 PM CDT: info Alarm Message Is:’"DISARMED READY TO ARM "‘
03e016b5-c2f8-4719-bb3c-2d1c33d3a42a 10:59:11 PM CDT: info Alarm Message Is:’!setting ADDRESS 31’
03e016b5-c2f8-4719-bb3c-2d1c33d3a42a 10:59:10 PM CDT: info Alarm Message Is:’!>ADDRESS=31’
03e016b5-c2f8-4719-bb3c-2d1c33d3a42a 10:59:08 PM CDT: debug sending AD2Pi Config Command: ADDRESS=31

The message "DISARMED READY TO ARM is generated by the AD2Pi in response to communication from the alarm panel.

From other user experiences, its usually the following:

  1. did you activate address 21 on your alarm panel? Use # command to verify
  2. replace the Rx/Tx jumper wires from AD2Pi to the panel in case one is bad

Also, your the first person I have seen using address 21. I assume that is a valid keypad address?

Thank you for continuing to try to help. I did activate Address 21 on the alarm panel ( I have four physical keypads, 16-19, plus TotalConnect (virtual keypad address of 20), so 21 is my first available address. I made sure it was enabled on the alarm panel (*194 1 0) several times, however I never did go back any review that with the '#" to verify. I will do that this evening. If it is verified, I may open up 22 and try that just in case 21 is somehow bad.

I actually did replace both jumpers I was using for the Rx and Tx between the AD2PI and the Alarm Panel in the off chance that one of those was bad.

The only other thing I can think of is that I am using a 9V AC power adapter on the Arduino board because I have an outlet that is battery backed-up available at my alarm panel. Because of that I an NOT using jumpers from the Alarm panel’s power terminals (4/5) to the AD2PI (+/-) on the terminal block. Should this work, or do I still need the Alarm panel to AD2PI power jumpers in addition to the 9V AC to the Arduino board?

Thanks.

Matthew, I am also using a 9V power supply to power my Arduino as I also have a battery backed up outlet by my alarm panel. It should work fine. As Stan suggested, it sounds like you have everything hooked up correctly but for some reason the AD2Pi is having trouble communicating to your alarm panel. You may want to hook up a USB cable to your Arduino and review debug messages in the Arduino Serial console window as well to look for any errors. While everything should be sent to SmartThings, I have seen many times where messages are dropped in transmission and reviewing the logs from the Arduino is the best.

I think I may have sound the issue: From the AlarmDecoder site…

All AlarmDecoder products require all 4 wires including Red and Black for power in order to power the signals to the panel. The AD2PI board is powered by the Pi power supply but still needs the alarm panel power for signaling.

I will connect these power jumpers tonight and see if that resolves my issue.

Ah sorry misread your post. Yes you definitely need to hook up those wires to your panel power terminals. That should clear things up for you.

All is good. Receiving alarm panel signalling and sensor tiles are updating. I can arm and disarm system with the app. Thanks for all your help.

Hi Kevin,
I installed the alarmdecoder-smartthings per the README and everything seems to be working fine except for the Virtual Switches. When a zone is tripped, the AlarmDecoder “Thing” in the SmartThings app shows the fault (the red icon corresponding to it goes from “–” to “1”) but the switch I assigned to the zone does not change state. Any assistance you can provide would be great. Thanks!

There is a small known issue where the event subscriptions weren’t created properly.

You can verify this by going into the IDE

Click My Locations
Click List SmartApps
Find: AlarmDecoder (Service Manager) and click it

Under Event Subscriptions you should have see the related zone subscriptions - if these are not present, try uninstalling and reinstalling the plugin - this should be fixed soon, but keep trying until the subscriptions are there.

Do you mean you will see the zone-off and zone-on subscriptions not the switches?

That worked!! Thanks!

Also, Jeffrey is correct.

I am using your version of the AD2SmartThings code and your Arduino Sketch (including the additional JSON library). It seem to work, except it is cutting off the “[C” and inserting a “!>” in the first two characters part of the “[CODE}99991***” being sent to the panel (for disarm, I replaced my actual code with ‘9999’ here) see below for the log:

9f1d1d16-b37b-49bf-a039-b195c522bfeb 10:17:56 PM: debug rawMsg: |||****DISARMED**** Ready to Arm||| 9f1d1d16-b37b-49bf-a039-b195c522bfeb 10:17:50 PM: debug rawMsg: |||!>ODE]99991***||| 9f1d1d16-b37b-49bf-a039-b195c522bfeb 10:17:49 PM: debug rawMsg:

Any ideas on what is causing this? Thanks for your help.

Yeah my bad, edited to fix.

Hum I haven’t seen that before on my panel. The code should never be sent back from the Arduino to ST. When you click disarm in ST, it passes the code to the Arduino and then to the AD2Pi and the AD2Pi responds back with “!Sending Done”, but my code suppresses those and just changes the system status.

I would suggest hooking up a computer to your Arduino via USB, open the Arduino software and enable debugging there and open the Serial window to see if anything jumps out there. Sorry I cannot help further as this is something I haven’t seen before.

I did add the ability to “armInstant” (Stay Instant) and I saw what I need to add that to the Sketch. I will change this:
String alarmStatus; //if (rawPanelCode.substring(10,11) == "1" || rawPanelCode.substring(11,12) == "1") //slot 10 is 'sticky' and requires code to be entered again to clear, slot 11 means alarm is happening now if (rawPanelCode.substring(11,12) == "1") { alarmStatus = "alarm"; } else if (rawPanelCode.substring(2,3) == "0" && rawPanelCode.substring(3,4) == "0") { alarmStatus = "disarmed"; } else if (rawPanelCode.substring(2,3) == "1") { alarmStatus = "armedAway"; } else if (rawPanelCode.substring(3,4) == "1") { alarmStatus = "armedStay"; }

to this:
String alarmStatus; //if (rawPanelCode.substring(10,11) == "1" || rawPanelCode.substring(11,12) == "1") //slot 10 is 'sticky' and requires code to be entered again to clear, slot 11 means alarm is happening now if (rawPanelCode.substring(11,12) == "1") { alarmStatus = "alarm"; } else if (rawPanelCode.substring(2,3) == "0" && rawPanelCode.substring(3,4) == "0") { alarmStatus = "disarmed"; } else if (rawPanelCode.substring(2,3) == "1") { alarmStatus = "armedAway"; } else if (rawPanelCode.substring(3,4) == "1" && rawPanelCode.substring(13,14) == "1") { alarmStatus = "armedInstant"; } else if (rawPanelCode.substring(3,4) == "1") { alarmStatus = "armedStay"; }
I also added code in the device handeler to address this. I probably didn’t get that in just right. I will keep working on it. I will be interested in making the sensors available to SmartThings (virtual contacts) so I will be watching for those additions.

Thanks for the response.

@jscongdon @scottma61 @d8adrvn

I finally got a SmartApp created and posted to my GitHub. It will automatically create virtual devices for the number of zones specified. It will also subscribe to the Alert Messages that are setup in my version of the device handler for things like battery status, alarms, etc and send push notifications and/or SMS messages.

First you will need to specify how many zones you want to create virtual devices for, then the second page of setup will prompt you for each zone number, zone name, and zone type. I wish I could get that from the device handler but there isn’t a way to query for that so unfortunately you have to reenter that information. But it will create the virtual devices and save you some time. Once the virtual devices are added, you can subscribe to those in other applications.

Edit: Removed link to my fork since Stan and my projects have been merged.

Thanks! Update on my setup… I never got post the error I was getting, so I reverted back to your original code in both the Arduino sketch and the device handler. That worked! (that means my attempt at adding ‘Armed Instant’ failed.) I do think I will be able to add Armed Instant, I just missed something/fat fingered something in my first attempt. I will pick this up later. For now I just replaced the “2” (for Armed Away) with a “7” (for Armed Stay Instant) in the device handler and it all seems to work well.

After I got everying working I did attempt your new SmartApp ‘Alarm Handler’. I got all the way to the final ‘Done’ and I consistently get the dreaded “An unexpected error has occurred”. I am thinking this has far more to do with the SmartThings platform than your app. I will keep trying to see if I can get past this error. I will really appreciate this SmartApp exposing my alarm sensors to rest of the SmartThings. Thanks for you efforts on this. I’ll report back if I can (or cannot) get this to successfully complete.

Matthew, my apologizes I just took my code on Git and reinstalled it and tested it and noticed an error as well. I found a bug that I had fixed that I didn’t post to Git. Please download the updated version and try again and see if you can successfully install the app now.

Just reloaded Alarm Handler2 and tried again. Same result, The log shows this:

‎9‎:‎56‎:‎14‎ ‎AM: error physicalgraph.app.exception.UnknownDeviceTypeException: Device type 'Simulated Contact Sensor' in namespace 'smartthings' not found. @ line 99

Thanks.