AD2SmartThings

@d8adrvn. Thanks! Version 2.4 works like a champ! My use case (receiving a message if the system is in alarm) aligns perfectly with the code you created. Thank you!

Just tested using a contact sensor (open/close vs. active/inactive) as mully orignally suggested and that works too. The key thing that I was not understanding was that you don’t need to add a device or handler for a virtual device. The AD2 handler acts as the device you want to monitor for the messages. I’m happy with this solution. while I cant tell if the alarm is going off for fire or burglar, I can easily check the alarm status/logs after I get the notification to check that. Love this stuff!

@Stan Hello Stan, V2.4 works well. I have also added Arm Night Stay Tile to your program, you basically arm stay twice to activate Night stay. This allows user to arm all perimeter and selected motions around the house during night. It works. I changed the tile layout in the main tile as there was no space, moved the Chime tile to the end and now I have stay and night stay as two tiles on top of the main screen. I can share the code with any other user who needs this mode.

I am making progress :slight_smile:

Next challenge : We all need to figure out how to report individual sensor alarm in the vista20p setup to trigger separate actions in smartapp. The open or closed zones are being reported in the smartapp, what we cannot do in current app is to use them to trigger various actions.

With some minor modifications to the device type (and a Smart App), you can create individual sensors and use them just like any other sensors. The only issue is that the motions don’t trigger once the alarm is armed. I also added the ability to bypass zones and identify the difference between types of alarms. PM me if you need help creating the individual sensors and trigger them.

Wired sensors can be tracked via expander messages or relay messages when alarm is armed - I mentioned this earlier in the thread briefly and posted a link with some details :smile: Whether or not this plugin supports doing that or not I am not aware! But it is possible to view the events with the alarmdecoder!

1 Like

I have not been able to get that part to work. Oh well, it still does mostly what I want.

Newb time…

Thanks for all the info here! I now have the V2 hub running with the very first things being my AD2SmartThings implementation. I have the system working as expected. Now i’d like to configure notifications (push/sms) when the system is in Alarm.

I attempted to configure Smart Home Monitor using the security system as the sensor but could’t get it working. The Smart Home Monitor always reports the system as Disarm. Should I be using a different smart app? Not sure if i’m even in the right area.

Also, I noticed in the “// Parse incoming device messages to generate events” section of the code at “if (msg.contains(“FAULT”))” statement. The next statement after “else if (msg.contains(“30”))” goes to 21, 22, then back to 33-39. I’m assuming it’s a mistake and should be 30, 31, 31…?

Thanks again, very happy with my first step into the home automation world!

@ Stan … As I mentioned in my previous post, am trying to integrate Night Stay command in the v2.4. I am able to update the main tile and add tile, added a command and am able to put my vista 20p into Night Stay. The message tile sees a message “Night-Stay”. The part of the code I am struggling with is where I cannot change the message on main tile after the system is in Night Mode, main tile stays in “Arming Away” mode in yellow (It is just the display). Below are the extracts of the code. What am I doing wrong?

standardTile(“main”, “device.system”, width: 2, height: 2, canChangeIcon: true, canChangeBackground: true)
{
state “disarmed”, label:“Disarmed”, action:“disarm”, icon:“st.Home.home2”, backgroundColor:"#ffffff"
state “armedAway”, label:“Armed Away”, action:“disarm”, icon:“st.Home.home3”, backgroundColor:"#587498"
state “armedStay”, label:“Armed Stay”, action:“disarm”, icon:“st.Home.home4”, backgroundColor:"#587498"
state “armedNightStay”, label:“Armed Night Stay”, action:“disarm”, icon:“st.Home.home5”, backgroundColor:"#587498"
state “alarm”, label:“Alarm!”, action:“disarm”, icon:“st.Home.home3”, backgroundColor:"#E86850"
state “armingAway”, label:“Arming Away”, action:“disarm”, icon:“st.Home.home3”, backgroundColor:"#FFD800"
state “armingStay”, label:“Arming Stay”, action:“disarm”, icon:“st.Home.home4”, backgroundColor:"#FFD800"
state “armingNightStay”, label:“Arming Night Stay”, action:“disarm”, icon:“st.Home.home5”, backgroundColor:"#FFD800"
}
standardTile(“stay”, “device.system”, width: 1, height: 1, decoration: “flat”)
{
state “disarmed”, label: “Stay”, action: “armStay”, icon:“st.Home.home4”, nextState: "armingStay"
state “armingStay”, label:“Arming Stay”, action: “disarm”, icon:“st.Home.home4”, nextState: "armedStay"
state “armedStay”, label:“Armed Stay”, action: “disarm”, icon:“st.Home.home4”
}

standardTile("nightstay", "device.system", width: 1, height: 1, decoration: "flat")
{
    	state "disarmed", label: "Night Stay", action: "armNightStay", icon:"st.Home.home5", nextState: "armingNightStay"
    	state "armingNightStay", label:"Arming Night Stay", action: "disarm", icon:"st.Home.home5", nextState: "armedNightStay"
    	state "armedNightStay", label:"Armed Night Stay", action: "disarm", icon:"st.Home.home5"
}

// log.info "Alarm Message: ${msg} "

  if (msg.contains("ARMED"))
	
    {
    	
        if (msg.contains("NIGHT-STAY"))
    	{
    		if (msg.contains("You may exit now"))
			{
        		result << createEvent(name: "system", value: "armingNightStay", displayed: true, isStateChange: true, isPhysical: true)
    		}
    		else
        	{
        		result << createEvent(name: "system", value: "armedNightStay", displayed: true, isStateChange: true, isPhysical: true)
			}
    	}
        
        else if (msg.contains("STAY"))
        
		{
    		if (msg.contains("You may exit now"))
			{
        		result << createEvent(name: "system", value: "armingStay", displayed: true)
    		}	
    		else
        	{
        		result << createEvent(name: "system", value: "armedStay", displayed: true, isStateChange: true, isPhysical: true)
    		}
    	}
         
         else if (msg.contains("AWAY"))
         
    	{
    		if (msg.contains("You may exit now"))
			{
        		result << createEvent(name: "system", value: "armingAway", displayed: true, isStateChange: true, isPhysical: true)
    		}
    		else
        	{
        		result << createEvent(name: "system", value: "armedAway", displayed: true, isStateChange: true, isPhysical: true)
			}
    	}          
	}

Looks like you have made some progress adding in this feature. Hopefully we can get this final bug worked out. From what I gather, it looks like you press “nightstay” tile and the code executes night stay and both the “nightstay” tile and “main” tile going into a arming state. From the quote above, you say the tile goes into “Arming Away” as the state? Did you mean “Arming Night Stay”??? Please confirm.

I’ll assume it actually goes to “Arming Night Stay”. Here are a couple suggestions that might be the issue then:

  1. Its possible that the Night-Stay alarm action does not have a arming delay. Have you been tracking the “Message Tile” to see what the messages are for the first 60 sec or so after activating Night-Stay?
  2. Your should also look at how you are using the nextState option. For example, you have nextState: “armedNightState” when in fact the action is to move the state to “disarm”. I don’t think that is the issue but I would just delete the nextState options. From what I have experienced, the nextState is useful to toggle the state of a tile as a shortcut rather than waiting on an event to trigger a state change. In this code, we are using the feedback from the alarm panel to advance the state, which has obvious advantages.

:grinning:@Stan Finally got it working after spending some time on it last night, and then waking up fresh this morning. As suggested by you, I monitored the messages very carefully from the alarm, it is a challenge as the system delay can cause the ping to act differently every time we arm or disarm.

Here is what was happening, since Armed Night Stay command is activated by pressing Armed Stay twice on the Vista20P panel or by pressing “code” +3 +3; first message being parsed by the code “Armed Stay You may exit now” was sending the parsed message to the tile in “STAY”.

I modified the code and including the following in the def parse section outside Armed Stay / Away query. In addition please see the complete modification (action 1-7) that I made to the code to get “Night Stay” Tile working in v2.4. Now we do not have to go to the panel to get the system in Night Stay Mode… Stan might want to modify and include this in next rev, as I know there are quite a few people out there who use Armed Night Stay mode at night. Well the alarm companies do not have this feature “Yay” …

Thanks a bunch to Stan and everybody else here … You rock !!!

Action1. Please add the following to def Parse section

if (msg.contains(“NIGHT-STAY”))
{
if (msg.contains(“You may exit now”))
{
result << createEvent(name: “system”, value: “armingNightStay”, displayed: true, isStateChange: true, isPhysical: true)
}
else
{
result << createEvent(name: “system”, value: “armedNightStay”, displayed: true, isStateChange: true, isPhysical: true)
}
}

Action: 2 Add, command “armNightStay” to metadata

Action: 3 Add following states to main tile

state “armedNightStay”, label:“Armed Night”, action:“disarm”, icon:“st.Home.home5”, backgroundColor:"#587498"
state “armingNightStay”, label:“Arming Night Stay”, action:“disarm”, icon:“st.Home.home5”, backgroundColor:"#FFD800"

Action: 4 Add following to the Tiles

standardTile(“nightstay”, “device.system”, width: 1, height: 1, decoration: “flat”)
{
state “disarmed”, label: “Night Stay”, action: “armNightStay”, icon:"st.Home.home5"
state “armingNightStay”, label:“Arming Night Stay”, action: “disarm”, icon:"st.Home.home5"
state “armedNightStay”, label:“Armed Night Stay”, action: “disarm”, icon:“st.Home.home5”

Action: 5 Add “nightstay” to main

Action: 6 Add armNightStay() to def lock() command section

Action: 7 Add following in addition to the command section

def armNightStay()
{
zigbee.smartShield(text: “[CODE]” + securityCode + “3” + “3”).format()
}

Save the code and Publish again … You will Rock-n-Roll …

Moving on to Arduino controlled Irrigation controller now :slightly_smiling:

1 Like

I finally got the finance committee (aka wife) to agree to purchase all the kit…

AD2PI, Audrino, Smartthings shield and jumper cables

The only thing I didn’t get is some kind of box to mount all of this in… does anyone have a suggestion for mounting?

I have downloaded the latest version of the smartapp, and the requisite stuff for the audrino.

I will document my journey in the coming weeks.

I am seriously looking forward to activating scenes based on motion/contact sensors around the house.

I put mine in something like this:

http://www.target.com/p/sterilite-clearview-6qt-bin-purple/-/A-13794493#prodSlot=medium_1_9&term=Sterilite®+ClearView+Latch

Not necessary pretty, but it works. It’s mounted to a stud near the panel.

I was thinking something a lot smaller and try to shoehorn it into the alarm panel.

It was the smallest that I could find that didn’t encroach upon the wiring. It’s smaller than it looks (maybe I grabbed the wrong image, but the idea was the same).

EDIT: This is it (grabbed wrong link):

http://www.target.com/p/sterilite-clearview-6qt-bin-purple/-/A-13794493#prodSlot=medium_1_9&term=Sterilite®+ClearView+Latch

the one you showed was 15 quarts… yeah I will look for something small…although I have a ton of room in my alarm box I could mount a thin one of those.

Great catch. Found it:

http://www.target.com/p/sterilite-clearview-6qt-bin-purple/-/A-13794493#prodSlot=medium_1_9&term=Sterilite®+ClearView+Latch

Thanks for that… Wife is on her way to get it for me.

Did you run into any significant issues with your install my desired use case is:

  1. Be able to arm/disarm alarm based on routines
  2. Turn on specific lights when specific sensors are triggered
  3. Disarm alarm based on proximity to house (unsure of this one)…

I drilled a small hole in the side and passed the wires through it. It really does work well.

The only issue I had was getting it enabled as a keypad (all my fault) - easily fixed (but that was the only speed bump).

The sensors work great with respect to triggering lights and such (I use mostly for door contacts). I do have the motions and CO/smoke detectors also as separate sensors. You can apparently get the alarm to send sensor data even when the alarm is on, but that requires a zone expander (which I have) and some “trickery” (as stated earlier in the thread) to force the system to provide this functionality (above my comfort level with programming the ADT system, maybe you can shed some light on this).

I do have processes that arm and disarm automatically (time driven, presence detection, mode changes, etc). For example, if my wife has turned the alarm on (or automatically turned on) and I come home, it will disarm and then rearm automatically (depends on time of day). We haven’t manually armed or disarm for nearly a year now.

see that is awesome and the main reason my wife let me do all of this.
We were burned with Revolv when it went under. I spent a lot of money on Insteon stuff.
So i am stuck using a bodged together smartapp, i just wish i could dim them but I am sure one of these days.

For now I am just happy to not have waisted 750 bucks in insteon gear.

I have a Revolv too.