I purchased the Heiman Zigbee Gas Alarm and have that working but I also purchased the HS1WL water leak sensor and would like to get that working. I connected it to hub fine as a motion sensor but it is not working. How do a make a custom device type to get this working. I read in the community about getting the connect info from logs so here it is:
I just got this zigbee water sensor too on Ali Express. Out of the box it pairs easily as Motion Detector and will report wetness as motion and dryness as no-motion… I tried a couple of builtin-in water DTH but none worked. I modified the motion DH to be water DH so leaks are reported in home monitor. It’s a basic DTH but it works. I hope someone will add battery, health checks, and what’s not.
/**
* Copyright 2015 SmartThings
*
* 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 {
definition (name: "Water Detector", namespace: "smartthings", author: "SmartThings") {
capability "Water Sensor"
fingerprint profileId: "0104", deviceId: "0402", inClusters: "0000,0001,0003,0009,0500"
}
// simulator metadata
simulator {
status "dry": "zone report :: type: 19 value: 0030"
status "wet": "zone report :: type: 19 value: 0031"
}
// UI tile definitions
tiles {
standardTile("water", "device.water", width: 2, height: 2) {
state("wet", icon:"st.alarm.water.wet", backgroundColor:"#ffffff")
state("dry", icon:"st.alarm.water.dry", backgroundColor:"#53a7c0")
}
main "water"
details "water"
}
}
// Parse incoming device messages to generate events
def parse(String description) {
def name = null
def value = description
def descriptionText = null
if (zigbee.isZoneType19(description)) {
name = "water"
def isActive = zigbee.translateStatusZoneType19(description)
value = isActive ? "wet" : "dry"
descriptionText = isActive ? "${device.displayName} is wet" : "${device.displayName} is dry"
}
def result = createEvent(
name: name,
value: value,
descriptionText: descriptionText
)
log.debug "Parse returned ${result?.descriptionText}"
return result
}