Lowes IRIS Transition

Sorry to be slow, just saw your note......here you go:

Driver for Petsafe Smart Door

/**

  • PetSafe Smart Door
  • Copyright 2015 Scott Gibson
  • Ported to Hubitat in 2019 by Mark Olson with explicit permission from Scott Gibson
  • Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
  • in compliance with the License. You may obtain a copy of the License at:
  •  http://www.apache.org/licenses/LICENSE-2.0
    
  • Unless required by applicable law or agreed to in writing, software distributed under the License is distributed
  • on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License
  • for the specific language governing permissions and limitations under the License.

*/
metadata {
// Automatically generated. Make future change here.
definition (name: "PetSafe Smart Door", namespace: "sticks18", author: "Scott Gibson") {
capability "Battery"
capability "Polling"
capability "Actuator"
capability "Refresh"
capability "Lock"

	fingerprint profileId: "0104", inClusters: "0000 0001 0003 0009 000A 0101", outClusters: "0000 0001 0003 0009 000A 0101"
}


	simulator {
	/*  // status "locked": "command: 9881, payload: 00 62 03 FF 00 00 FE FE"
	// status "unlocked": "command: 9881, payload: 00 62 03 00 00 00 FE FE"

	// reply "9881006201FF,delay 4200,9881006202": "command: 9881, payload: 00 62 03 FF 00 00 FE FE"
	// reply "988100620100,delay 4200,9881006202": "command: 9881, payload: 00 62 03 00 00 00 FE FE"  */
}

tiles {
	standardTile("toggle", "device.lock", width: 2, height: 2) {
		state "locked", label:'locked', action:"lock.unlock", icon:"st.locks.lock.locked", backgroundColor:"#79b821", nextState:"unlocking"
		state "unlocked", label:'unlocked', action:"lock.lock", icon:"st.locks.lock.unlocked", backgroundColor:"#ffffff", nextState:"locking"
		state "unknown", label:"unknown", action:"lock.lock", icon:"st.locks.lock.unknown", backgroundColor:"#ffffff", nextState:"locking"
		state "locking", label:'locking', icon:"st.locks.lock.locked", backgroundColor:"#79b821"
		state "unlocking", label:'unlocking', icon:"st.locks.lock.unlocked", backgroundColor:"#ffffff"
	}
	standardTile("lock", "device.lock", inactiveLabel: false, decoration: "flat") {
		state "default", label:'lock', action:"lock.lock", icon:"st.locks.lock.locked", nextState:"locking"
	}
	standardTile("unlock", "device.lock", inactiveLabel: false, decoration: "flat") {
		state "default", label:'unlock', action:"lock.unlock", icon:"st.locks.lock.unlocked", nextState:"unlocking"
	}
	valueTile("battery", "device.battery", inactiveLabel: false, decoration: "flat") {
		state "battery", label:'${currentValue}% battery', unit:""
	}
	standardTile("refresh", "device.lock", inactiveLabel: false, decoration: "flat") {
		state "default", label:'', action:"refresh.refresh", icon:"st.secondary.refresh"
	}

	main "toggle"
	details(["toggle", "lock", "unlock", "battery", "refresh"])
}

}

def parse(String description) {

log.trace description

def msg = zigbee.parse(description)
log.trace msg

def results = []
if (description?.startsWith('catchall:')) {
	results = parseCatchAllMessage(description)
}
else if (description?.startsWith('read attr -')) {
	results = parseReportAttributeMessage(description)
}

}

private parseReportAttributeMessage(String description) {

Map descMap = (description - "read attr - ").split(",").inject([:]) { map, param ->
def nameAndValue = param.split(":")
map += [(nameAndValue[0].trim()):nameAndValue[1].trim()]
}

//log.debug "Desc Map: $descMap"
def results = []
if (descMap.cluster == "0001" && descMap.attrId == "0020") {
	log.debug "Received battery level report"
	results = createEvent(getBatteryResult(Integer.parseInt(descMap.value, 16)))
}
else if (descMap.cluster == "0101" && descMap.attrId == "0000") {
	log.debug "Received lock status"
	def linkText = getLinkText(device)
    
    if(descMap.value == "01"){
    	results = createEvent( name: 'lock' , value: "locked", descriptionText: "${linkText} is locked")
	}
    else if(descMap.value == "02") {
    	results = createEvent( name: 'lock' , value: "unlocked", descriptionText: "${linkText} is unlocked")
    }
        
}

return results

}

private getBatteryResult(rawValue) {

//log.debug 'Battery'
def linkText = getLinkText(device)
def result = [ name: 'battery' ]

def volts = rawValue / 10
def descriptionText
if (volts > 6.5) {
	result.descriptionText = "${linkText} battery has too much power (${volts} volts)."
}
else {
	def minVolts = 4.0
	def maxVolts = 6.0
	def pct = (((volts - minVolts) / (maxVolts - minVolts))*100)
	result.value = Math.min(100, (int) pct)
	result.descriptionText = "${linkText} battery was ${result.value}%"
}

return result

}

private Map parseCatchAllMessage(String description) {

def results = [:]
def cluster = zigbee.parse(description)

if (shouldProcessMessage(cluster)) {
	switch(cluster.clusterId) {
		case 0x0001:
			results << createEvent(getBatteryResult(cluster.data.last()))
			break
	}
}

return results

}

private boolean shouldProcessMessage(cluster) {
// 0x0B is default response indicating message got through
// 0x07 is bind message

boolean ignoredMessage = cluster.profileId != 0x0104 ||
	cluster.command == 0x0B ||
	cluster.command == 0x07 ||
	(cluster.data.size() > 0 && cluster.data.first() == 0x3e)

return !ignoredMessage

}

def poll() {

log.debug "Executing 'poll'"
refresh()

}

def refresh() {

[
"st rattr 0x${device.deviceNetworkId} 0x0C 0x101 0", "delay 500",
"st rattr 0x${device.deviceNetworkId} 0x0C 1 0x20"
]

}

def updated() {

configure()

}

def lock() {

log.debug "Executing 'lock'"
sendEvent(name: "lock", value: "locked")
"st cmd 0x${device.deviceNetworkId} 0x0C 0x101 0 {}"

}

def unlock() {

log.debug "Executing 'unlock'"
sendEvent(name: "lock", value: "unlocked")
"st cmd 0x${device.deviceNetworkId} 0x0C 0x101 1 {}"

}

def configure() {

String zigbeeId = swapEndianHex(device.hub.zigbeeId)
log.debug "Confuguring Reporting and Bindings."
def configCmds = [	

    //Lock Reporting
    "zcl global send-me-a-report 0x101 0 0x30 0 3600 {01}", "delay 500",
    "send 0x${device.deviceNetworkId} 1 1", "delay 1000",

    //Battery Reporting
    "zcl global send-me-a-report 1 0x20 0x20 5 3600 {}", "delay 200",
    "send 0x${device.deviceNetworkId} 1 1", "delay 1500",

    "zdo bind 0x${device.deviceNetworkId} 0x0C 1 0x101 {${device.zigbeeId}} {}", "delay 500",
    "zdo bind 0x${device.deviceNetworkId} 0x0C 1 1 {${device.zigbeeId}} {}"

]
return configCmds + refresh() // send refresh cmds as part of config

}

private hex(value, width=2) {
def s = new BigInteger(Math.round(value).toString()).toString(16)
while (s.size() < width) {
s = "0" + s
}
s
}

private Integer convertHexToInt(hex) {
Integer.parseInt(hex,16)
}

private String swapEndianHex(String hex) {
reverseArray(hex.decodeHex()).encodeHex()
}

private byte[] reverseArray(byte[] array) {
int i = 0;
int j = array.length - 1;
byte tmp;
while (j > i) {
tmp = array[j];
array[j] = array[i];
array[i] = tmp;
j--;
i++;
}
return array
}

private getEndpointId() {
new BigInteger(device.endpointId, 16).toString()
}

EDIT: This clearly isn't the right way to post driver code. Can anyway help a noob out and I'll fix it!

So I have been looking around for a combo Zigbee/Z-Wave repeater and the only device that seems to have that is the Iris 3210-L/L2 outlets, but when looking on the forums it seems that only a few of the firmwares, I believe 20085010 and 20115010, are really worth it for the devices. Since Iris is now, gone is there any way to update plugs to these firmwares? I saw that ST hubs can update some Iris products or is it possible to update through Arcus?

Not that anyone has found yet, to the best of my knowledge. Personally, I have eliminated Z-Wave from my home in favor of Lutron Caseta (for switches, dimmers, fan controllers and Pico remotes), and Zigbee (for motion, contact, temperature, humidity, and leak sensors). This has been a very stable combination for my specific needs.

Yeah, I am still in the setup/transition stages from a WiFi based non-hub Alexa smart home into Hubitat so I still do not have a ton of devices, but I needed a Zigbee repeater for my Hue motion sensor and Hue remote dimmer, and I needed a Z-Wave repeater for my August Pro smart lock. I figured I would look for a 2-in-1 solution is all.

In your eyes, what is the key differentiating factors between Zigbee and Z-Wave for you, like why have you avoided Z-Wave?

For me, my older GE Z-Wave (not Z-Wave Plus) switches and dimmers were prone to randomly stop responding for no obvious reason. I grew tired on those devices. That firsthand experience, along with all of the reports of users having Z-wave mesh network issues in general (not just on Hubitat, but on SmartThings, Wink, and other platforms as well), led to my decision to go all-in on Lutron Caseta. Lutron is to Siwtches, Dimmers, Fan Controllers, a Pico remotes what Philips Hue is to Zigbee bulbs. Both companies offer solid, reliable performance. Both charge a premium, but since I wanted home automation to be less hobby/tinkering, and more true Automation, I decided to go with Lutron. Best home automation hardware I have ever used. For me, worth every penny to set it up once, and have it work 100% of the time without any issues whatsoever.

Other users have reliable Z-Wave mesh networks, although most are probably happiest with all Z-Wave Plus devices.

I prefer Zigbee due to its simpler pairing/resetting process. Z-Wave's Inclusion/Exclusion process is a little finicky, IMHO. Also, Zigbee devices (like motion sensors and contact sensors) typically are much faster to report a status change. Thus, they make for faster lighting automations. I was able to buy a bunch of Lowes Iris v2 Motion and Contact sensors from a bulk seller on ebay. Getting these devices for about $5 a piece was a great deal.

1 Like

Thank you. So would you recommend getting the Iris v2 motion and contact sensors if I can find them or are other brands/products probably better places to look first?

I really like the Iris v2 sensors, however they are getting harder to find. A lot of folks are also very happy with the latest Samsung/SmartThings Motion and Contact/Multi sensors. Some like the Nyce sensors as well. I would avoid the Aqara/Xiaomi sesnors, as these are not Zigbee HA1.2 standards compliant devices, and they tend to drop off the network. Also, I recommend Sengled Zigbee bulbs, if you decide to add smart bulbs to your system. Sengled bulbs are not Zigbee repeaters, by design, so they do not screw up your Zigbee home automation mesh network (I personally avoid old GE and Cree bulbs, as well as Osram/Lightify bulbs due to the problems they are know to cause.)

https://www.amazon.com/Samsung-SmartThings-GP-U999SJVLBAA-Optional-Automated/dp/B07F8ZHBLS/ref=sr_1_2?crid=4W96JM84UO33&dchild=1&keywords=samsung%2Bmotion%2Bsensor%2Bsmartthings&qid=1586025430&sprefix=Samsung%2BMotion%2B%2Caps%2C137&sr=8-2&th=1

and

https://www.amazon.com/Samsung-SmartThings-GP-U999SJVLBAA-Optional-Automated/dp/B07F956F3B/ref=sr_1_2?crid=4W96JM84UO33&dchild=1&keywords=samsung%2Bmotion%2Bsensor%2Bsmartthings&qid=1586025430&sprefix=Samsung%2BMotion%2B%2Caps%2C137&sr=8-2&th=1

3 Likes

Do you use Zigbee repeaters, or do you just have enough devices to provide a stable mesh? If you do use repeaters which ones would you recommend? I've heard good things about the Iris outlets, reason why I bought them, but I also have some of the IKEA Tradfri Signal Repeaters coming in the mail. Do you have any experience using those?

I use Iris v2 3210-L outlets as my repeaters and have had very good luck with them. All of mine are up to date with the last firmware that was released for them. I actually bought an Iris hub early last year for ~$25 new from Lowes, in order to upgrade all of the firmware on these Iris devices. I figured I might only get one shot at it, before Iris was shut down. A SmartThings hub can be used to upgrade the firmware on Iris Motion and Contact sensors, but not the Iris outlets.

The only issue I believe may exist with the 3210-L outlets running older firmware is with the Z-Wave repeater side of things. Since you already have some of these outlets, if you turn them over, you'll find the main product label. If yours also have a small, white, rectangular barcode label, there is a very good chance that they are running the latest firmware.

I'm not sure if this is the answer you're looking for but I hope it helps. I have many IRIS devices Gen 1 and Gen 2 and I've never had an issue with Hubitat. The only "Issue" was communicating with 1 device in my garage. Admittedly it was far from other devices when I experienced this issue. All I did was install a Gen 1 outlet (#SPG902) in between troubled device and a working device and never experienced an issue again. Best of luck!

4 Likes

So I have been following this post in order to pair the Z-Wave Repeater side of the 3210-Ls and am not having any luck so far. I have been able to pair the Zigbee without any problems but z-wave is just not working. Do you guys have any recommendations? I have 5 of them, 3 of which have the extra barcode sticker. Based on what I have read those are the ones that work with Z-Wave. Also when pairing, do you only get one chance per factory reset? Also is there any visual indication of the LEDs that the Z-Wave is in pairing mode?

Update:
I eventually paired all 5 of my plugs, lucky me considering only 3 had the barcode stickers, using the post linked above. I seemed to get the best results by sitting as closely to the hub as possible.

I don’t think there is any restriction on the number of times you can reset.

Since I posted this I helped walk a friend through pairing a few of these. We actually had to reset his hub to get to pair after it hung.

So couldn’t hurt to reset the plug and to reboot the hub.

Cheers.
Mac

Reset to factory default

Unplug device from the wall.While holding the front button, re-insert device into the receptacle. Once the blue light illuminates, release button to factory reset.

The two without the barcode stickers MAY cause more issues on your Z-Wave mesh than they are worth. The issue with the old firmware is not that they wouldn't pair...it was that they were potentially not good Z-Wave repeaters. At least, that is my understanding.

If you decided to Z-Wave Exclude the two without barcode stickers, please move the plugs within close proximity of the HE hub. Then, using the correct Z-Wave Repeater device, start the removal/exclusion procedure. Click the button 8 times very quickly on the outlet and hopefully you'll see that the hub has removed the device. If it doesn't work on the first try, try, try again. :wink:

1 Like

I believe this is also how to start the Z Wave pairing after you have paired the zigbee part of the plug. Has to be very quick as sometimes it get interpreted as an on/off function. If so you must start the Z-wave portion again.

1 Like

Is there any way to know what firmware they are using, when using this driver, it seems to list a bunch of device details and they are the same across all devices. That's why I figured the barcode-less plugs just got updated.

Note: All 5 of these plugs were purchased recently from eBay.

I am not familiar with @srwhite's driver for the 3210-L outlets. I have always just used the built-in Hubitat drivers. Steve mentioned recently that he might tweak his driver to display the firmware version.

Yep, I've bought from the same ebay seller numerous times. I paired each 3210-L with my SmartThings hub, then looked at the device details in the ST Web IDE to determine the firmware version. That is when I noticed the correlation between the extra little barcode sticker and the firmware version. I am not saying this correlation is true for all 3210-L outlets, but it was for my small sample size. YMMV, of course.

2 Likes

Not sure why I havent posted this here before, but if you're using any of the Iris V1 kit, I have a selection of drivers for AlertMe-based devices which I'm using with all of my security gear.

Many of the earlier devices were the same as the original UK models (save for some colour changes here and there) so I'd be interested to know if anybody has success with these.

These drivers try to expose as many of the device features as possible and provide presence detection, which is useful for keeping an eye on your security mesh.

Do any of these drivers work for the original gen 1 iris keypad

1 Like

Ah, sadly not. The keypad was never launched in the UK, so I don't have one to investigate. Even if I did, as I understand it there's a fair bit of work involved in getting it to behave.

However, I know it can be done. The platform I used before Hubitat, SystronicsRF, had full support for it. They spent quite some time working on it because it was one of the top devices requested by their US customers.

1 Like