AD2SmartThings

@drchris1502,
Glad to hear the project is working. Your Smart Home Monitor is independent of this project, which you probably already know, but can use your home alarm panel as a “sensor” for intrusion. Did you try setting up the Smart Home Monitor Preferences (look for the sprocket)??

I tried reproducing your bug report with the isDebugEnabled=false. That’s the default state on my home system which has been working fine. Just to check, I reinstalled the code from github and still no issue. So I am a bit at loss on why this issue appeared for you. Let us know if you have any additional insights. and I will look into this further. Otherwise, we can see if other community members have the same issue.

@drchris1502 right now there is a 1 way sync between the alarm panel and SHM that I just implemented the other day based on @jsnyder10 request. Using the SmartApp you can set this up and it will arm SHM when the alarm is armed. As mentioned I don’t have a lot of experience with SHM but I just enabled it so I can investigate a 2 way integration. I should have that implemented in the next week. I will report back once done.

@ritchierich Thanks for the update. I did get the one-way synch with SHM working. That’s probably the most important part for me because with SHM you can have multiple alerts that go to multiple people / phones. I haven’t tested the alerts yet as I really need my wife to take the dogs away before I intentionally set off our alarm system!

If you make any progress on the 2 way integration, I would be very interested.

Thanks again!

Chris

This is AWESOME! My smart shield died long ago but after catching up on this thread it’s amazing the work you guys have done to a stupid challenge to my self years ago! I might have to buy a new smart shield and get mine working again.

Amazing job!

Thanks Craig. I appreciate you documenting the integration years ago since it inspired us all to do this.

The following updates have been made to the AD2SmartThings project:

  • Device Handler v4.4.6 - fixed a bug where the Arm Instant preference wasn’t working properly
  • Alarm Handler SmartApp v2.2
  • Added functionality to synchronize Smart Home Monitor with the alarm panel. This is a two way synchronization where updates made in SHM will update the alarm panel and updates made on the alarm panel (via keypad or device handler) will update SHM.
  • @jsnyder10 and @drchris1502 wanted to make sure you saw this update since you had asked about this feature.
  • Updates to the Simulated Motion and Contact device handlers used by the Alarm Handler SmartApp.
  • These are copies of the default SmartThings simulated switches but I realized that the tiles had an action associated to them and on a few occasions my virtual switches were out of sync with my alarm device handler because I had accidentally hit them in the app.
  • I commented out the action so this won’t happen. No other changes.

If you don’t use Smart Home Monitor then this is not a required update. Synchronization with SHM is an option though in the SmartApp preferences so you can easily enable and disable this feature. It is turned off by default. All preferences set prior in the SmartApp will be saved so there will be no loss to your virtual devices with this update.

To install this update:

  1. Login to the IDE
  2. Go to My Device Handlers and replace the code in the smartthings : Simulated Contact Sensor and smartthings : Simulated Motion Sensor device handlers, save and publish.
  3. Go to My SmartApps and replace the code in the Alarm Handler v2.X SmartApp, save and publish
  4. On your mobile device, go to SmartApps and choose Alarm Handler.
  5. Click Next on the first page to keep your existing preferences if setup otherwise choose the number of zones you want to create virtual devices for.
  6. Click next on the second page to keep your existing preferences if setup otherwise choose which zones you want to create virtual devices for.
  7. On the third page, toggle the Sync with SHM if you are interested in this feature, then click done.

These steps are important even if you had already toggled the Sync with SHM prior since additional event subscriptions have been added to the SmartApp. Without setting up the SmartApp again these changes will not take effect.

Thanks a bunch for the update, everything works great. It is really nice to be able to augment my dealer installed ADT system with SHM sensors.

@ritchierich Thanks so much! This update is icing on the cake. The two way sync works great.

Like I said, I’m pretty new to the SmartThings community. The work that you guys have put in has made my learning curve much easier to manage. The interface with the alarm system is doing everything I need it to do now. Next steps are to start using my SmartThings system to not only monitor my home, but to start to customize how it functions.

Thanks again!
Chris

Now that I am using SHM integrated with the alarm, I wanted my alarm panel smoke detector to show up in SHM. The Alarm Handler only included motion and contact sensors until now!

The following updates have been made to the AD2SmartThings project:

  • Alarm Handler v2.3 - Added Simulated Smoke Alarm to the selection when creating virtual zones. Also streamlined the code for all virtual devices to use the same event handler.
  • New Simulated Smoke Alarm device handlers used by the Alarm Handler SmartApp.

All preferences set prior in the SmartApp will be saved so there will be no loss to your virtual devices with this update.

To install this update:

  1. Login to the IDE
  2. Go to My Device Handlers, click New and From Code and paste in the Simulated Smoke Alarm Code, save
    and publish.
  3. Go to My SmartApps and replace the code in the Alarm Handler v2.X SmartApp, save and publish
  4. On your mobile device, go to SmartApps and choose Alarm Handler.
  5. Click Next on the first page to keep your existing preferences if setup otherwise choose the number of zones you want to create virtual devices for.
  6. On the second page feel free to update a zone to use the new Smoke Alarm type. Click next.
  7. On the third page, toggle the Sync with SHM if you are interested in this feature, then click done.

These steps are important even if you don’t plan to use the Simulated Smoke Alarm type since the event handler has changed in this release. Without setting up the SmartApp again these changes will not take effect.

Great stuff once again thanks Michael, all installed and operational. One question - in my ADT system I have one “Fire (Smoke/Heat) Detector” and three “Carbon Monoxide Detectors”. I set all four of these up as Simulated Smoke Alarms and they appear to be ok, but I haven’t actually triggered any of them to test. Did you intend for CO detectors to be setup this way?

I have several separate heat and smoke devices too, but in my installation they are all installed together in zone 1. They are not separate devices. I created this capability for that purpose but yes I if you have separate zones for each device they honestly behave the same way by either changing to open or closed (not sure which one) to trip the alarm panel.

Ok great thanks.

Post deleted. I was dumb.

I’m not having much success upgrading to the latest sketch. My starting point was a fully connected and working system, so I have confidence in the Arduino and connections.

I disconnected the Serial3 (JP 14/15 to 2/3) to avoid serial collisions, and panel power. Connect PC USB (shows Arduino Mega 2560 on COM10). Uploaded the blink program to test the USB connection. Loaded and compiled the new sketch.

But, uploading never completes. Sometimes it gives up after 10-15 minutes, sometimes it keeps trying indefinitely with these errors:

Sketch uses 21,256 bytes (8%) of program storage space. Maximum is 253,952 bytes.
Global variables use 2,294 bytes (28%) of dynamic memory, leaving 5,898 bytes for local variables. Maximum is 8,192 bytes.
avrdude: stk500v2_recv(): checksum error
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer
avrdude: stk500v2_command(): failed miserably to execute command 0x14
avrdude: stk500v2_paged_load: read command failed
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer
avrdude: stk500v2_command(): failed miserably to execute command 0x1d
avrdude: stk500v2_cmd(): failed to send command
avr_read(): error reading address 0x0000
    read operation not supported for memory "flash"
avrdude: failed to read all of flash memory, rc=-2
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_getsync(): timeout communicating with programmer
avrdude: stk500v2_command(): failed miserably to execute command 0x11
avrdude: stk500v2_disable(): failed to leave programming mode

Is there something obvious I’m doing? Npt doing?

It appears your computer is having trouble communicating with the Arduino. Have you tried restarting your computer and trying again?

Thank you. Yes, I’ve restarted a couple times. My next move is to rummage around to find an assortment of old-style USB cables to see if that makes a difference.

Does it make sense that a little sketch like BLINK would transfer OK, but a (not very big) bigger one like this would fail?

EDIT: another thought… I don’t remember it attaching to COM10 when I did this before. Is it possible to force a lower port?

@cal7,
I agree with @ritchierich…it looks like a connection port issue with your PC. Unfortunately, I have no way to replicate since I use a MAC. One other concern is to validate that the Arduino LED’s are light, just to be sure your board is still good (one green, one amber) and the AD2PI is still flashing.

BTW…during development, I’ll update code many times a day. I just plug in the USB and upload. No need to remove jumpers, etc… There should not be any serial port clashes since alarm panel is a different port than the USB.

Thanks, Stan. I’m not going to be able to work on this until this afternoon, but I’ll report back in the hope that you experienced Arduino folks can help me diagnose.

I’m relatively confident that the board is still good because I can successfully upload BLINK and (visually through the Shield) see that the red LED does blink according to the parameters of the sketch. Also, the AD2Pi is blinking.

My evidence so far is that (1) BLINK uploads fine but (2) the latest sketch won’t upload, so I’m going to try (3) uploading the version of your sketch that had been working to further diagnose. The error messages are always related to connection, but in different tries, they do vary and there may be a correlation to whether I have freshly rebooted the Arduino or first upload BLINK; probably makes no sense, but that’s what I’ve seen.

I suppose my next step is to pull it all down (the only really hard part to this whole project was physically accessing and securing the Arduino assembly to my panel which is near the ceiling and nestled in some shelving - so I really want to avoid dissembling it all!) and bench test it from scratch. Your note that your development was in the fully connected environment is helpful because it encourages me to keep trying as-is.

Thanks again to you and Michael (@ritchierich) for this project and for your continued support.

Not much has changed. Neither of the AD2 sketches upload (both compile). Since BLINK uploads and executes, is there some other sketch that you’d recommend? (I like BLINK because I can quickly tell if it’s working.)

Other diagnostic tools or logging parameters?

One thing is that the error messages are not as verbose. These come immediately, but it then stays in an Uploading state.

Sketch uses 21,256 bytes (8%) of program storage space. Maximum is 253,952 bytes.
Global variables use 2,294 bytes (28%) of dynamic memory, leaving 5,898 bytes for local variables. Maximum is 8,192 bytes.
avrdude: stk500v2_ReceiveMessage(): timeout
avrdude: stk500v2_recv(): checksum error
avrdude: verification error, first mismatch at byte 0x2900
         0x00 != 0x60
avrdude: verification error; content mismatch

I’ll try anything before my next step, which is to disassemble it all and start over. But, given this connection problem, I don’t have much optimism that will work.

For the record, the PC, Libraries, USB port and USB cable are the same I used initially with success.

If I strip it all down, will your sketch upload to a vanilla Mega w/o the Shield or A2dPi (just to get past the upload problem)?

@CAL7 I don’t have a lot of experience with these errors. You may want to Google search them because I don’t believe it has to do with our sketch. Tagging @ogiewon to see if he has any thoughts.