"New" SmartThings 2018 sensors

If you post a link to the driver you found I'll be able to tell if tilt is in there or not, would save me some time.

Yes, it looks like this sensor produces both acceleration and xyz, I'll see what I can do about getting these working.

5 Likes

I just paired 5 of the 2018 water sensors with the latest firmware 0x00000011. They are recognized as Zigbee Contact Sensors not Zigbee Moisture Sensors. I manually changed them to Zigbee Moisture Sensors and they seem to work fine.

@mike.maxwell Here is the fingerprint that they joined with:

Manufacturer: Samjin
Product Name: Generic Zigbee Contact Sensor
Model Number: water
deviceTypeId: 32
manufacturer:Samjin
model:water
basicAttributesInitialized:true
application:11
endpoints.01.manufacturer:Samjin
endpoints.01.idAsInt:1
endpoints.01.inClusters:0000,0001,0003,0020,0402,0500,0B05
endpoints.01.endpointId:01
endpoints.01.profileId:0104
endpoints.01.application:11
endpoints.01.outClusters:0003,0019
endpoints.01.initialized:true
endpoints.01.model:water
endpoints.01.stage:4
1 Like

perfect thanks, I've added that

I have made a mod to @jp0550's mod for this driver. This will be my interim driver till Hubitat/Samsung resolve the duplicate events that occur after these button devices have been unused for a period of time. Essentially it will ignore multiple button press events that occur with a specified timeframe. When I receive duplicates my logs show that they occur within 2 seconds of each other. I have found that 2500ms to be the sweet spot for me. Your mileage may vary and so I made this an adjustable option in the driver preferences.
Hopefully I won't need this driver for much longer.

And, yes, I know everyone does not experience this issue even with the same firmware. This driver is for those that do.

/*
 * 	12/30/18 Edited by Stephan Hackett
 *		- added option to ignore duplicate events received within adjustable timeframe (2500ms/2.5s worked for me). Tweak this preference to fit your scenario.
*/


metadata {
    definition ( name : "Smartthings Button", namespace: "stephack", author: "Robert Morris, Mitch Pond, jp0550, Stephan Hackett" ) {
    	capability "Holdable Button"
        capability "Battery"
        capability "Refresh"
        capability "Double Tapable Button"
        capability "Pushable Button"
        capability "Temperature Measurement"
        capability "Sensor"
        capability "Actuator"
        capability "Configuration"  
        
        fingerprint inClusters: "0000,0001,0003,0020,0402,0500", outClusters: "0003,0019", manufacturer: "Samjin", model: "button"
    }
}

preferences {
	input("debounce", "number", title: "Ignore multiple events received within this timeframe (ms):")
}

def parse(description){
 	log.debug "Received message: $description"    
    def event = zigbee.getEvent(description)
    
    if( description?.startsWith("catchall:") || description?.startsWith("read attr -") ){
        def descMap = zigbee.parseDescriptionAsMap(description)
        log.debug "Desc map: $descMap"
        if(descMap.clusterInt == 0x0001 && descMap.attrInt == 0x0020){ //battery
            event = getBatteryResult(zigbee.convertHexToInt(descMap.value))
        }
    }
    else if( description?.startsWith("zone status") ){
        event = parseIasButtonMessage(description)
    }
    
    log.debug "Parsed event $event"
    def result = event ? createEvent(event) : []
    
    if (description?.startsWith('enroll request')) {
		List cmds = zigbee.enrollResponse()
		log.debug "enroll response: ${cmds}"
		result = cmds?.collect { new hubitat.device.HubAction(it) }
	}
    
    result
}

def parseIasButtonMessage(description){
 	def zs = zigbee.parseZoneStatus(description)
    
    def eventType
    
    if(zs.isAlarm1Set()) eventType = "pushed"
    if(zs.isAlarm2Set()) eventType = "doubleTapped" 
    if(zs.isAlarm1Set() && zs.isAlarm2Set()) eventType = "held" 
    
    if(eventType){
		def rejectTime = 0
		if(debounce) rejectTime = debounce
		def recentEvents = device.eventsSince(new Date(now() - rejectTime)).findAll{it.name == eventType}
        log.info "Duplicate event rejected" 
        if(recentEvents.size == 0){
     		return [ name: eventType, value: 1, isStateChange: true, descriptionText: "Button 1 was $eventType" ]
		}
    }
}

def getBatteryResult(rawValue){
 	log.debug "Parse battery: $rawValue"
    def volts = rawValue / 10.0
    if(volts > 3.0 || volts == 0 || rawValue == 0xFF){
     	return [:]   
    }
    else {
        def result = [ name : 'battery' ]
        def minVolts = 2.1
        def maxVolts = 3.0
        def pct = (volts - minVolts) / (maxVolts - minVolts)
        result.value = Math.min(100, (int)(pct * 100))
        def linkText = getLinkText(device)
        result.descriptionText = "$linkText battery was ${result.value}%"
        return result
    }
}

def refresh(){
    zigbee.readAttribute(zigbee.POWER_CONFIGURATION_CLUSTER, 0x20) + zigbee.readAttribute(zigbee.TEMPERATURE_MEASUREMENT_CLUSTER, 0x0) + zigbee.enrollResponse()
}

def configure(){
    log.debug "Configure"
    
    sendEvent(name: 'numberOfButtons', value: 1)
    
    zigbee.onOffConfig() + 
        zigbee.levelConfig() + 
        zigbee.configureReporting(zigbee.POWER_CONFIGURATION_CLUSTER, 0x20, DataType.UINT8, 30, 21600, 0x01) + 
        zigbee.temperatureConfig(30, 3600) +
        zigbee.enrollResponse() + 
        zigbee.readAttribute(zigbee.POWER_CONFIGURATION_CLUSTER, 0x20) + 
        zigbee.readAttribute(zigbee.TEMPERATURE_MEASUREMENT_CLUSTER, 0x0) + []
}
3 Likes

@mike.maxwell any update on the native driver for this button? another year is almost about to go by … :wink:

The native driver was actually released a while back. My workaround above is to correct an issue with the button itself sending multiple events when awoken from sleep.

i just added one of the buttons today and it got identified as a moisture sensor … havent seen that happen when there are native drivers. on 2.0.1.117.

Same thing happened to me. Apparently new firmware changes some things on the Samjin (most/all 2018 Samsung/ST) devices so the fingerprint-matching doesn't work. You might be able to help them. :slight_smile: See: Samsung Buttons

2 Likes

now i know why i couldnt find the driver for a smartthings button.

thank you.

Samsung's newer firmware has a different fingerprint than the older firmware, so its fingerprint catchup again...
In any event, 2.0.4 has the new fp for the button...

2 Likes

Hopefully you can find it and it just didn't automatically select it--assuming you've upgraded your firmware since September or so, it's there as "Samsung ZigBee Button."

thanks … changed it manually.

the native driver does not seem to set the numberOfButtons attribute … would be great if you can add that also please.

thank you.

Did you press "Configure" after you switched drivers? (The common ZigBee, if not Hubitat, theme. :slight_smile: ) Mine set the attribute and I didn't do anything special, so I assume that was it.

it sets that on install, which of course doesn't run when you manually replace a driver.
once you get a device wrapper in an app, you can send that event on the devices behalf...

Sorry if I missed this somewhere. I see a lot of talk about the new SmartThings button, but has support for the acceleration feature of the 2018 SmartThings Multipurpose sensor been added? If so, which driver is it in?

1 Like

:point_up: Wondering this myself as well.

Also, can we get a confirmation that the new motion sensor is staying connected and responding properly? Are they fast? Slow? Meh?

I have several of these, no problem with staying connected, quick response time (maybe not as quick as the beloved iris, but much faster than z-wave). I really like the mount, gives lots of flexibility (although it only attaches to wall via adhesive, no screw option).

Battery lifes seems good after several months in high-traffic areas, and as a bonus the batteries are readily available, unlike previous generation model.

1 Like

Thanks Mark. Have you done any tests with their response when ceiling mounting them? Seems like the wide detection field would work well for that.