Arg! I forgot you need the device types too! I fought with that a long while ago and forgot about those. Unfortunately you cannot reference SmartThings device handlers and you have to clone them into your account. Seems silly but this should get you going.
I just uploaded two device handlers that you will need to upload into your account. Thank you for your help testing this out.
Simulated_Contact_Sensor_Device_Handler
Simulated_Motion_Sensor_Device_Handler
That worked! I successfully created 4 contact and 2 motion virtual sensors. The house is secure now (no open contacts or motion) so I cannot verify that are working prioperly ā¦ but they look good!
Iāll report back after I get some indication that everything is working.
Awesome thank you for confirming. Hopefully the app was straight forward enough. I was really wanting to automate the data entry part since the zone names and numbers are already defined in the device handler but unfortunately that isnāt accessible from a SmartApp.
When I find some time I will introduce additional functionality. Please share any ideas.
I finally was able to get around getting the App and Device handlers installed. I setup a single zoneā¦ and Iām not sure what or if I am supposed to be seeing anything different?
I went ahead and setup all of my zones ā¦ all 27 of them. *Note - I also have Smoke / CO2 / Glass Break sensors *
And I trimmed the zones in the AD2SmartThings device handler to reflect the correct zones I have.
To try and debug - I changed isDebugEnabled to trueā¦ but am not sure where Iām supposed to find that log?
I also have multiple zones that seem to be in a stuck state even though the message displayed in the āRight Nowā tab shows 'DISARMED READY TO ARMā
My Chime never shows as being off.
And when I was going through the house identifying the sensors by triggering them I wouldnāt see the message. At the time, we did have a window openā¦ and that was the only message that was displayed - though the tile may or may not have changed state. I had to go back to the main panel to identify them.
I have a tile that allows me to reboot the AD2Pi but that doesnāt help either.
isDebugEnabled in the device handler will put updates in Live Logging. I typically open 2 browsers, 1 where I can edit the device handler and another on Live Logging so I can see the updates.
isDebugEnabled in the Arduino sketch will enable the serial logging. You will need to have a computer connected to the Arduino and the serial window open to see those.
I would suggest comparing what is sent from the Arduino to what is received by SmartThings. Also make sure you follow Stanās instructions on how to set your alarm code as a preference to the device handler. This will allow you to change chime and arm/disarm.
Got it nowā¦ didnāt realize that I had to have the page loaded to see the messages themselves.
Yeah, I have the alarm code in there, always has been. Iāve just been finding the display to not reflect what is going on at the panel.
I just pulled up the āRight Nowā section and it finally is showing the Chime being off. But I still have zones activatedā¦ and no one is home. They donāt seem to be clearing out.
FWIW, here is a sample of the rawMsg
||disarmed|DISARMED Ready to Arm|||
I had to parse for an empty chime status so that it would read as the chime as being off. The only time that I am seeing an explicit chimeOff declaration in the rawMsg is right after the chime is turned off from that ST app.
|chimeOff||DISARMED Ready to Arm||| - at the same time panel status isnāt being declared.
And if Iām reading the code correctly shouldnāt the zone listings being the last two sections? Mine arenāt displaying anything. Iām not at home to test if that changes with a zone change or notā¦ but will do that.
I have not experienced the issues you are having. Nothing should be active until the Arduino tells it its active which is why you donāt see chimeStatus every time. It only sends something when it changes so since your message changed, that is why it was sent to ST. If chimeStatus, powerStatus, zones, etc change, then those would be sent. The Arduino sketch keeps everything in memory. Every now and then I have a zone still showing active and its now because there are times when ST doesnāt receive/process updates from the ThingShield. I can see it was sent from the Arduino side, but it never shows up in the ST logs.
In the end gameā¦ There is an instance where the data doesnāt get to the other endā¦ and essentially it will be stuck until that is acted upon, in theory. As for my motion sensor, I triggered it purposely and it has been triggered through normal use since yesterdayā¦ and itās still showing as active.
Like the rebooting of the AD2Pi board, I may look into a status refresh tileā¦ or even mechanism. As Iām finding out with another project I am working onā¦ when there is a far end that only reports on the data it has been given and there is an avenue of error (where as the data doesnāt get there and itās status isnāt repeated) there is opportunity for failure.
Completely agree with you. This used to be more reliable many months ago but as there is more stress on the SmartThings platform things have gotten a little worse. This is why I reduced the updates from several to just one hoping for more reliability. But do your point things can still get lost.
I like your idea of a refresh button. I also considered updating the SmartApp to query each zone in the device handler looking for active zones when the alarm panel reports āDISARMED READY TO ARMā and mark them inactive if found. This would be another fail-safe measure.
Being new to this still, Iām still getting a handle on how the handlers work. If a SmartApp can reach back to the ST Shield, that would be awesome. That is inline with what I was thinking would be a great way to cross check.
Speaking of SmartAppā¦ what should I be seeing different than before? I have installed and setup but donāt see what if anything changed.
A SmartApp can reach āthroughā a device handler to the ST Shield. A new function will need to be defined for it to instruct the Shield to report back updates. I was proposing just looking at each zone current state as āknownā by SmartThings to make sure they are inactive based on the alarm status.
With my SmartApp, what it does is sets up virtual devices for each of the zones you told it to. You should see a bunch of new devices in your Things list. The SmartApp keeps those in sync with the device handler zones. The value here is now that they are individual devices, other SmartApps can monitor them for various purposes. Example lets say you have a alarm contact sensor on your shed in the back. Then between say 9 PM and the next morning you want to be notified if that door is open, you can just subscribe to that contact with your app versus having to create your own code to do that with the alarm device handler. Hopefully that makes sense.
Oh snap! That is awesomeā¦ didnāt even see that! (obviously)
Alsoā¦ I may work on setting up a device handler for simulated CO2/Smoke Detector and Glass Break Detector.
Kevin thanks. My Arduino code is tracking it well itās just that sometimes the updates donāt make it/get processed by the SmartThings decide handler.
I am using the Alarm Handler2 smart app and love it! Would it be possible to add a simulated switch for ArmStay and a simulated lock for ArmAway to allow things to be triggered when the alarm is armed into these modes? That would be awesome! Also, it would be cook if an ArmInstant option was included in the device handler (and corresponding simulated item in the Smart App), but that would likely be a taller order.
Thank you everyone for your hard work on this project. I just got it up and running today and it works great! I have full control of Arming/Disarming from within SmartThings. One question, and I apologize if I missed this in the long thread, but is there a way for SmartThings to be aware of the individual alarm sensors? For example, I want SmartThings to lock my Schlage front door lock automatically, but only if the front door alarm sensor is closed.
You cannot do it with just the device handler as you will need a SmartApp. If you are using my version of the code, there is a SmartApp in my Git repository that will automatically create virtual devices for each of your alarm zones. Once that is setup, you can create another app to subscribe to the virtual sensors and lock the door when necessary. Or Rule Machine (if you have the old version) or the new CoRe might be able to automate it as well. Unfortunately Smart Lighting cannot do it.