Smartthings with AD2PI Network appliance

General Discussion

Re: Smartthings with AD2PI Network appliance

Postby JJsLegacy » Mon Apr 18, 2016 5:51 am

I would still be curious of the answer of why switches but I reworked the device handler and turned everything into open/close. Working perfectly in my quick testing. Now I can act on them like they are contact switches etc.
JJsLegacy
Junior Nut
Junior Nut
 
Posts: 31
Joined: Tue Jan 19, 2016 4:17 pm

Re: Smartthings with AD2PI Network appliance

Postby terryhonn » Mon Apr 18, 2016 5:55 am

JJsLegacy wrote:I would still be curious of the answer of why switches but I reworked the device handler and turned everything into open/close. Working perfectly in my quick testing. Now I can act on them like they are contact switches etc.

I was just about to do the same thing, but wanted to incorporate some hardwired motion sensors, too. Would you mind sharing your device handler?
terryhonn
newt
newt
 
Posts: 16
Joined: Sun Jul 20, 2014 7:00 am

Re: Smartthings with AD2PI Network appliance

Postby JJsLegacy » Mon Apr 18, 2016 6:11 am

At the moment just very simplistic to see if it works but here it is:

Code: Select all
/* virtual contact */

/* Based off of https://github.com/jwsf/device-type.arduino-8-way-relay/blob/master/VirtualSwitch.groovy */
metadata {
    definition (name: "JJVirtualSwitch", namespace: "JJalarmdecoder", author: "test@gmail.com") {
 capability "Contact Sensor"
    }
    simulator {
       //
    }
    tiles {
    // Main Row
    standardTile("contact", "device.contact", width: 2, height: 2, canChangeBackground: true, canChangeIcon: true) {
      state "open",   label: '${name}', icon: "st.contact.contact.open",   backgroundColor: "#ffa81e"
      state "closed", label: '${name}', icon: "st.contact.contact.closed", backgroundColor: "#79b821",defaultState: true
     }
    // This tile will be the tile that is displayed on the Hub page.
    main "contact"
    // These tiles will be displayed when clicked on the device, in the order listed here.
    details(["contact"])
  }
}
// handle commands
def on() {
    log.debug "On"
    sendEvent (name: "contact", value: "open")
}

def off() {
    log.debug "Off"
    sendEvent (name: "contact", value: "closed")
}

JJsLegacy
Junior Nut
Junior Nut
 
Posts: 31
Joined: Tue Jan 19, 2016 4:17 pm

Re: Quesito

Postby Scott » Mon Apr 18, 2016 9:36 am

JJsLegacy wrote:Not sure I understand what you said. In smartthings you made the 8 "zones" on/off switches. Why not use an open/close model instead? This would allow for more logical rules to be created like turn off the HVAC if a window is open or alert me if a door is left open for X minutes. Not so easy to do with them being on/off. Makes sense?


Definitely get what you're saying. It certainly makes more sense logically to use 'open' and 'close'. Switches were chosen because they can be tripped from something other than us. That allows us to use them for virtual zones, but like previously mentioned that's an extreme edge case, so I may end up moving to the contact sensor. Glad to hear that worked, at least!
Scott
Expert Nut
Expert Nut
 
Posts: 118
Joined: Thu Dec 12, 2013 11:17 am

Re: Smartthings with AD2PI Network appliance

Postby JJsLegacy » Mon Apr 18, 2016 10:06 am

Makes sense - so far so good. Nice open and close working as expected. Will test out integrating into other things like window detection with hvac running or when rain is coming etc.

Thanks!
JJsLegacy
Junior Nut
Junior Nut
 
Posts: 31
Joined: Tue Jan 19, 2016 4:17 pm

Re: Smartthings with AD2PI Network appliance

Postby terryhonn » Tue Apr 19, 2016 12:41 pm

Thanks for the device type code. I'm not seeing what I expect, so if you don't mind, I'd like to make sure I'm doing the same things you've done.
I took your code and created a new device type, and then changed the type of device for each of the AlarmDecoder Zone Switches that are actual physical open/close sensors in my Vista 20p hardware setup to use the new device type. After clicking through the service manager smartapp setup again, so that things should be refreshed, I see that the devices "AlarmDecoder Zone Switch #1" etc are now showing as an open/close sensor in the Things list, but there is no change in their status at any point. Opening and closing the doors and windows to which those Ademco zones are associated does not change the status of the device in Smartthings.

What am I missing?

Thanks!
terryhonn
newt
newt
 
Posts: 16
Joined: Sun Jul 20, 2014 7:00 am

Re: Smartthings with AD2PI Network appliance

Postby JJsLegacy » Tue Apr 19, 2016 2:24 pm

I am 99.9% sure I didn't change anything else but I will triple check later.

Have you configured your zone numbers to the 8 switches inside the alarm device settings?
When you open the door/window do you wait the 1 minute or force a refresh in the alarm panel device with all the red dots?
Do you see a "number" in the red circle that matches the zone? If you see the number that should trigger the open/close.
JJsLegacy
Junior Nut
Junior Nut
 
Posts: 31
Joined: Tue Jan 19, 2016 4:17 pm

Re: Smartthings with AD2PI Network appliance

Postby terryhonn » Wed Apr 20, 2016 6:14 am

JJsLegacy wrote:I am 99.9% sure I didn't change anything else but I will triple check later.

Have you configured your zone numbers to the 8 switches inside the alarm device settings?
When you open the door/window do you wait the 1 minute or force a refresh in the alarm panel device with all the red dots?
Do you see a "number" in the red circle that matches the zone? If you see the number that should trigger the open/close.

Everything sounds right, I do see the zone fault indicators in the Alarmdecoder device as I should (after waiting or after manually refreshing) but there is still no change/action on any of the child devices, whether configured as the original switch or as your open/close sensor.

I'll uninstall everything and try again, tomorrow probably.

Thanks for checking.
terryhonn
newt
newt
 
Posts: 16
Joined: Sun Jul 20, 2014 7:00 am

Re: Smartthings with AD2PI Network appliance

Postby JJsLegacy » Wed Apr 20, 2016 8:19 am

I wonder if you had the same issue I had originally 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 (not the IDE/DEV one if you have it)

Under Event Subscriptions you should have a zone-off and zone-on.

My first smartapp install these were missing. After removing and reinstalling the smartapp they got created again. I would leave the devicetypes alone and just redo the smartapp.

Without those subscriptions the switches will never change
JJsLegacy
Junior Nut
Junior Nut
 
Posts: 31
Joined: Tue Jan 19, 2016 4:17 pm

Re: Smartthings with AD2PI Network appliance

Postby Scott » Mon May 16, 2016 4:06 pm

Just pushed a few changes up to github. I switched everything to contact sensors instead of switches so you'll need to do a fresh install of the components if you already have the previous ones in place.

  • Panic switch now requires 3 presses to activate. There's a 10 second timeout that triggers a reset to the initial state if you don't complete the panic.
  • Moved to virtual contact sensors over switches.
  • Password-style fields for sensitive inputs.
  • Rearranged some event subscriptions to hopefully fix people's issues with missing events.
  • A few other UI tweaks
Scott
Expert Nut
Expert Nut
 
Posts: 118
Joined: Thu Dec 12, 2013 11:17 am

PreviousNext

Return to General

Who is online

Users browsing this forum: No registered users and 5 guests

cron