@gbrown please do!
Whould be great.
@chrbratt, sadly its difficult to offer more assistance on this, as all my devices are working, and I don't have the model you do Sorry.
@Royski You really should have a big thank you for the help and the time you spent with this!
It is thanks to your help that has inspired me to deal with the problem. Learned much more about how z-wave and hubitat drivers and how they actually work.
My brother help me out with this problem. His solution was as quoted in the new driver description It seems like the parser for binary data cannot handle the extra 2 bytes that are sent from the sensor. So the extra 2 bytes are removed from telegram 3003 before sent to the parser
So now both motion and contact work with this driver for me. Tampering sensor is the one thing left to add if someone want's it.
The updated driver that work's great after some short testing. Renamed it to "Philio PST02-1A Sensor v1.2"
/*
* Philio PST02-1A 4-in-1 Multi Sensor Device Type
*
* Based on Philio PSM02 4-in-1 Multi Sensor Device Type by eyeonall
* AND PSM01 Sensor created by SmartThings/Paul Spee
* AND SmartThings' Aeon MultiSensor 6 Device Type
* Edited by Bratt. It seems like the parser for binary data
* cannot handle the extra 2 bytes that are sent from the sensor. So the extra 2 bytes are removed from telegram 3003 before sent to the parser
*/
metadata {
definition (name: "Philio PST02-1A Sensor v1.2", namespace: "ertanden", author: "Ertan Deniz") {
capability "Contact Sensor"
capability "Motion Sensor"
capability "Temperature Measurement"
capability "Illuminance Measurement"
capability "Configuration"
capability "Sensor"
capability "Battery"
capability "Refresh"
capability "Polling"
fingerprint deviceId: "0x0701", inClusters: "0x5E,0x80,0x71,0x85,0x70,0x72,0x86,0x30,0x31,0x84,0x59,0x73,0x5A,0x8F,0x98,0x7A", outClusters: "0x20"
//fingerprint deviceId: "0x0701", inClusters: "0x5E,0x72,0x86,0x59,0x73,0x5A,0x8F,0x98,0x7A", outClusters: "0x20"
fingerprint mfr:"013C", prod:"0002", model:"000C"
}
preferences {
input description: "This feature allows you to correct any temperature variations by selecting an offset. Ex: If your sensor consistently reports a temp that's 5 degrees too warm, you'd enter \"-5\". If 3 degrees too cold, enter \"+3\".", displayDuringSetup: false, type: "paragraph", element: "paragraph"
input "tempOffset", "number", title: "Temperature Offset", description: "Adjust temperature by this many degrees", range: "*..*", displayDuringSetup: false
input name: "logEnable", type: "bool", title: "Enable debug logging", defaultValue: true
input name: "txtEnable", type: "bool", title: "Enable descriptionText logging", defaultValue: true
}
}
def logsOff(){
log.warn "debug logging disabled..."
device.updateSetting("logEnable",[value:"false",type:"bool"])
}
def installed() {
if (logEnable) log.debug "Installed with settings: ${settings}"
setConfigured("false") //wait until the next time device wakeup to send configure command after user change preference
}
////def updated() {
//// log.debug "Updated with settings: ${settings}"
////
//// setConfigured("false") //wait until the next time device wakeup to send configure command after user change preference
////}
def updated(){
log.info "updated..."
log.warn "debug logging is: ${logEnable == true}"
log.warn "description logging is: ${txtEnable == true}"
setConfigured("false") //wait until the next time device wakeup to send configure command after user change preference
if (logEnable) runIn(1800,logsOff)
}
def parse(String description) {
if (logEnable) log.debug "parse() >> description: $description"
def result = null
if (description.startsWith("Err 106")) {
log.debug "parse() >> Err 106"
result = createEvent( name: "secureInclusion", value: "failed", isStateChange: true,
descriptionText: "This sensor failed to complete the network security key exchange. If you are unable to control it via SmartThings, you must remove it from your network and add it again.")
} else if (description != "updated") {
if (logEnable) log.debug "parse() >> zwave.parse(description)"
def myDesc
if( description.contains("command: 3003"))
{
myDesc = description.substring(0, description.length() - 7)
if (logEnable) log.debug "Removed chars from 3003() >> description: $myDesc"
}
else{
myDesc = description
if (logEnable) log.debug "Telegram kept intact() >> description: $myDesc"
}
def cmd = zwave.parse(myDesc, [0x20: 1, 0x30: 2, 0x31: 5, 0x70: 1, 0x72: 1, 0x80: 1, 0x84: 2, 0x85: 1, 0x86: 1])
if (cmd) {
result = zwaveEvent(cmd)
}
}
if (logEnable) log.debug "After zwaveEvent(cmd) >> Parsed '${description}' to ${result.inspect()}"
return result
}
// Event Generation
//this notification will be sent only when device is battery powered
def zwaveEvent(hubitat.zwave.commands.wakeupv2.WakeUpNotification cmd) {
def result = [createEvent(descriptionText: "${device.displayName} woke up", isStateChange: false)]
def cmds = []
// Only ask for battery if we haven't had a BatteryReport in a while
if (!state.lastbatt || now() - state.lastbatt > 24*60*60*1000) {
result << response(command(zwave.batteryV1.batteryGet()))
result << response("delay 1200") // leave time for device to respond to batteryGet
}
if (!isConfigured()) {
if (logEnable) log.debug ("late configure")
result << response(configure())
} else {
if (logEnable) log.debug ("Device has been configured sending >> wakeUpNoMoreInformation()")
cmds << zwave.wakeUpV2.wakeUpNoMoreInformation().format()
result << response(cmds)
}
result
}
def zwaveEvent(hubitat.zwave.commands.multicmdv1.MultiCmdEncap cmd) {
if (logEnable) log.debug "multicmdencap: ${cmd.payload}"
//def encapsulatedCommand = cmd.encapsulatedCommand()
//if (encapsulatedCommand) {
// zwaveEvent(encapsulatedCommand)
//}
}
def zwaveEvent(hubitat.zwave.commands.securityv1.SecurityMessageEncapsulation cmd) {
def encapsulatedCommand = cmd.encapsulatedCommand([0x20: 1, 0x30: 2, 0x31: 5, 0x70: 1, 0x72: 1, 0x80: 1, 0x84: 2, 0x85: 1, 0x86: 1])
state.sec = 1
if (logEnable) log.debug "encapsulated: ${encapsulatedCommand}"
if (encapsulatedCommand) {
zwaveEvent(encapsulatedCommand)
} else {
if (logEnable) log.warn "Unable to extract encapsulated cmd from $cmd"
createEvent(descriptionText: cmd.toString())
}
}
def zwaveEvent(hubitat.zwave.commands.securityv1.SecurityCommandsSupportedReport cmd) {
if (logEnable) log.debug "Executing zwaveEvent 98 (SecurityV1): 03 (SecurityCommandsSupportedReport) with cmd: $cmd"
state.sec = 1
}
def zwaveEvent(hubitat.zwave.commands.securityv1.NetworkKeyVerify cmd) {
state.sec = 1
if (logEnable) log.debug "Executing zwaveEvent 98 (SecurityV1): 07 (NetworkKeyVerify) with cmd: $cmd (node is securely included)"
def result = [createEvent(name:"secureInclusion", value:"success", descriptionText:"Secure inclusion was successful", isStateChange: true)]
result
}
def zwaveEvent(hubitat.zwave.commands.configurationv1.ConfigurationReport cmd) {
if (logEnable) log.debug "---CONFIGURATION REPORT V1--- ${device.displayName} parameter ${cmd.parameterNumber} with a byte size of ${cmd.size} is set to ${cmd.configurationValue}"
}
def zwaveEvent(hubitat.zwave.commands.sensormultilevelv5.SensorMultilevelReport cmd)
{
if (logEnable) log.debug "PST02: SensorMultilevel ${cmd.toString()}"
def map = [:]
switch (cmd.sensorType) {
case 1:
// temperature
def cmdScale = cmd.scale == 1 ? "F" : "C"
map.value = convertTemperatureIfNeeded(cmd.scaledSensorValue, cmdScale, cmd.precision)
map.unit = getTemperatureScale()
map.name = "temperature"
if (tempOffset) {
def offset = tempOffset as int
def v = map.value as int
map.value = v + offset
}
if (logEnable) log.debug "Adjusted temp value ${map.value}"
break;
case 3:
// luminance
map.value = cmd.scaledSensorValue.toInteger().toString()
map.unit = "lux"
map.name = "illuminance"
break;
}
//map
createEvent(map)
}
def zwaveEvent(hubitat.zwave.commands.batteryv1.BatteryReport cmd) {
if (txtEnable) log.debug "PST02: BatteryReport ${cmd.toString()}}"
def map = [:]
map.name = "battery"
map.value = cmd.batteryLevel > 0 ? cmd.batteryLevel.toString() : 1
map.unit = "%"
map.displayed = false
//map
state.lastbatt = now()
createEvent(map)
}
def zwaveEvent(hubitat.zwave.commands.sensorbinaryv2.SensorBinaryReport cmd) {
if (logEnable) log.debug "PST02: SensorBinaryReport ${cmd.toString()}}"
def map = [:]
switch (cmd.sensorType) {
case 10: // contact sensor
map.name = "contact"
if (logEnable) log.debug "PST02 cmd.sensorValue: ${cmd.sensorValue}"
if (cmd.sensorValue.toInteger() > 0 ) {
log.debug "PST02 DOOR OPEN"
map.value = "open"
map.descriptionText = "$device.displayName is open"
} else {
log.debug "PST02 DOOR CLOSED"
map.value = "closed"
map.descriptionText = "$device.displayName is closed"
}
break;
case 12: // motion sensor
map.name = "motion"
if (logEnable) log.debug "PST02 cmd.sensorValue: ${cmd.sensorValue}"
if (cmd.sensorValue.toInteger() > 0 ) {
if (logEnable) log.debug "PST02 Motion Detected"
map.value = "active"
map.descriptionText = "$device.displayName is active"
} else {
log.debug "PST02 No Motion"
map.value = "inactive"
map.descriptionText = "$device.displayName no motion"
}
map.isStateChange = true
break;
}
//map
createEvent(map)
}
def zwaveEvent(hubitat.zwave.Command cmd) {
if (logEnable) log.debug "PST02: Catchall reached for cmd: ${cmd.toString()}}"
[:]
}
def configure() {
if (logEnable) log.debug "PST02: configure() called"
def request = []
request << zwave.configurationV1.configurationSet(parameterNumber: 3, size: 1, scaledConfigurationValue: 80) // PIR Sensitivity 1-100
request << zwave.configurationV1.configurationSet(parameterNumber: 4, size: 1, scaledConfigurationValue: 99) // Light threshold
request << zwave.configurationV1.configurationSet(parameterNumber: 5, size: 1, scaledConfigurationValue: 0) // Operation Mode
request << zwave.configurationV1.configurationSet(parameterNumber: 6, size: 1, scaledConfigurationValue: 4) // Multi-Sensor Function Switch
request << zwave.configurationV1.configurationSet(parameterNumber: 7, size: 1, scaledConfigurationValue: 54) // Customer Function
request << zwave.configurationV1.configurationSet(parameterNumber: 8, size: 1, scaledConfigurationValue: 3) // PIR re-detect interval time
request << zwave.configurationV1.configurationSet(parameterNumber: 9, size: 1, scaledConfigurationValue: 4) // Turn Off Light Time
request << zwave.configurationV1.configurationSet(parameterNumber: 9, size: 1, scaledConfigurationValue: 4) // Turn Off Light Time
request << zwave.configurationV1.configurationSet(parameterNumber: 10, size: 1, scaledConfigurationValue: 12) // Auto report Battery time 1-127, default 12
request << zwave.configurationV1.configurationSet(parameterNumber: 11, size: 1, scaledConfigurationValue: 12) // Auto report Door/Window state time 1-127, default 12
request << zwave.configurationV1.configurationSet(parameterNumber: 12, size: 1, scaledConfigurationValue: 12) // Auto report Illumination time 1-127, default 12
request << zwave.configurationV1.configurationSet(parameterNumber: 13, size: 1, scaledConfigurationValue: 12) // Auto report Temperature time 1-127, default 12
request << zwave.wakeUpV2.wakeUpIntervalSet(seconds: 24 * 3600, nodeid:zwaveHubNodeId) // Wake up period
//7. query sensor data
request << zwave.batteryV1.batteryGet()
request << zwave.sensorBinaryV2.sensorBinaryGet(sensorType: 10) //contact
request << zwave.sensorBinaryV2.sensorBinaryGet(sensorType: 12) //motion
request << zwave.sensorMultilevelV5.sensorMultilevelGet(sensorType: 1) //temperature
request << zwave.sensorMultilevelV5.sensorMultilevelGet(sensorType: 3) //illuminance
setConfigured("true")
commands(request) + ["delay 20000", zwave.wakeUpV2.wakeUpNoMoreInformation().format()]
}
private setConfigured(configure) {
if (txtEnable) log.debug "setConfigured: ${configure}"
updateDataValue("configured", configure)
}
private isConfigured() {
getDataValue("configured") == "true"
}
private command(hubitat.zwave.Command cmd) {
if (state.sec) {
zwave.securityV1.securityMessageEncapsulation().encapsulate(cmd).format()
} else {
cmd.format()
}
}
private commands(commands, delay=200) {
if (txtEnable) log.debug "sending commands: ${commands}"
delayBetween(commands.collect{ command(it) }, delay)
}
Hope this help someone, someday. This seams like a popular sensor in Sweden.
To describe it a little better. When motion or contact is triggered it sends this.
``Parsed 'zw device: 12, command: 3003, payload: FF 0C C7 00``` But this make's an error so C7, 00 is removed from payload and then it works with zwave.sensorBinaryV2.
@gbrown if you want another solution for your driver, this was the problem. But you maybe get that from the description my brother made. I didn't!
Awesome. I'll give that version a whirl as well. Thanks. G.
@gbrown @Royski and @njanda are your's working with motion or contact since 2.0.9.129.?
Both my PST02-1A 4-1 stoped working with motion and contact since the update to 2.0.9.129. Temp and battery reporting works. Also notice my PAT02-1B temp/humidity dosen't work with Notification.
Uncertain i did something else that could impact this except updating firmware.
Iβm not seeing anything weird but I've not updated yet.
Working fine here, more than could be said of my Xiaomi's which all dropped and had to be re-paired
Ouchh!
Hard to say anything other then we get what we pay for with Xiaomi's
This is a first in almost a year of use for me. Been rock solid until last night.
I think it was your comment some wear that convinced me they work just great so i also bought a temperature and a motion sensor from them. Diden't have any trouble with them thru the updates.
So @chrbratt and @Royski, would you be advising me that I should not update just yet as there is an issue with these drivers ??
I've had no Z-wave issues at all with the update, I'm also beginning to think that my Xiaomi issue isn't related to the update either. All my motion sensors started reporting in, 9 hours after being re-paired. So seems I have had some very strange mesh issue which I can't put my finger on.
You shouldn't be worried about it. I'am definitely not sure it had anything to with it. Joust a conclusion it was one of the changes i remember doing. But @Royski should also had some trouble with it if that was the case. Will see if i can sort it out next week, it get's the payload but can't identify the value anymore. Just like the problem i had the first time with it.
@njanda Did you also have the 4-1 with motion/contact/temperature/Illuminance?
Strangle no.
Mine are 3 in 1βs branded Zipato but they look just the same as the pictures you posted yet do not do PIR (motion).
Theyβre Contact, Temperature and Illumination only.
Nic
One of mine is like that, Devolo branded, no issues here
Made it work again. Seams something was changed how payload was handle. Hade not saved how the old was presented. So had to rewrite the driver again. Added better descriptions for the Configuration Parameters to. Hopefully it will work, even if they change payload msg again.
/* Philio PST02-1A 4-in-1 Multi Sensor Device Type
*
* Based on Philio PSM02 4-in-1 Multi Sensor Device Type by eyeonall
* AND PSM01 Sensor created by SmartThings/Paul Spee
* AND SmartThings' Aeon MultiSensor 6 Device Type
* 1.2 Edited by Bratt. It seems like the parser for binary data cannot handle the extra 2 bytes that are sent from the sensor.
* So the extra 2 bytes are removed from telegram 3003 before sent to the parser
* 1.3 Updated parsing method and added better description for Configuration Parameters.
*/
metadata {
definition (name: "Philio PST02-1A Sensor v1.3", namespace: "ertanden", author: "Ertan Deniz") {
capability "Temperature Measurement"
capability "Contact Sensor"
capability "Motion Sensor"
capability "Illuminance Measurement"
capability "Configuration"
capability "Sensor"
capability "Battery"
capability "Refresh"
capability "Polling"
fingerprint deviceId: "0x0701", inClusters: "0x5E,0x80,0x71,0x85,0x70,0x72,0x86,0x30,0x31,0x84,0x59,0x73,0x5A,0x8F,0x98,0x7A", outClusters: "0x20"
//fingerprint deviceId: "0x0701", inClusters: "0x5E,0x72,0x86,0x59,0x73,0x5A,0x8F,0x98,0x7A", outClusters: "0x20"
fingerprint mfr:"013C", prod:"0002", model:"000C"
}
preferences {
input description: "This feature allows you to correct any temperature variations by selecting an offset. Ex: If your sensor consistently reports a temp that's 5 degrees too warm, you'd enter \"-5\". If 3 degrees too cold, enter \"+3\".", displayDuringSetup: false, type: "paragraph", element: "paragraph"
input "tempOffset", "number", title: "Temperature Offset", description: "Adjust temperature by this many degrees", range: "*..*", displayDuringSetup: false
input name: "logEnable", type: "bool", title: "Enable debug logging", defaultValue: true
input name: "txtEnable", type: "bool", title: "Enable descriptionText logging", defaultValue: true
}
}
def logsOff(){
log.warn "debug logging disabled..."
device.updateSetting("logEnable",[value:"false",type:"bool"])
}
def installed() {
if (logEnable) log.debug "Installed with settings: ${settings}"
setConfigured("false") //wait until the next time device wakeup to send configure command after user change preference
}
def updated(){
log.info "updated..."
log.warn "debug logging is: ${logEnable == true}"
log.warn "description logging is: ${txtEnable == true}"
setConfigured("false") //wait until the next time device wakeup to send configure command after user change preference
if (logEnable) runIn(1800,logsOff)
}
def parse(String description) {
if (logEnable) log.debug "parse() >> description: $description"
def result = null
if (description.startsWith("Err 106")) {
log.debug "parse() >> Err 106"
result = createEvent( name: "secureInclusion", value: "failed", isStateChange: true,
descriptionText: "This sensor failed to complete the network security key exchange. If you are unable to control it via SmartThings, you must remove it from your network and add it again.")
} else if (description != "updated") {
if (logEnable) log.debug "parse >> zwave.parse(myDesc)"
def cmd
def myDesc
if( description.contains("command: 3003"))
{
// Create a new sensorbinaryv2
cmd = new hubitat.zwave.commands.sensorbinaryv2.SensorBinaryReport()
def start = description.indexOf('payload:')
// Read value and convert to short payload: FF 0A CA 00. FF = Sensor value 0A = Sensor type
cmd.sensorValue = Short.parseShort(description.substring(start +9, start +11),16)
cmd.sensorType = Short.parseShort(description.substring(start +12, start +14),16)
}
else{
myDesc = description
if (logEnable) log.debug "payload kept intact() >> description: $myDesc"
cmd = zwave.parse(myDesc, [0x20: 1, 0x30: 2, 0x31: 5, 0x70: 1, 0x72: 1, 0x80: 1, 0x84: 2, 0x85: 1, 0x86: 1])
}
if (cmd) {
result = zwaveEvent(cmd)
}
}
if (logEnable) log.debug "After zwaveEvent(cmd) >> Parsed '${description}' to ${result.inspect()}"
return result
}
// Event Generation
//this notification will be sent only when device is battery powered
def zwaveEvent(hubitat.zwave.commands.wakeupv2.WakeUpNotification cmd) {
def result = [createEvent(descriptionText: "${device.displayName} woke up", isStateChange: false)]
def cmds = []
// Only ask for battery if we haven't had a BatteryReport in a while
if (!state.lastbatt || now() - state.lastbatt > 24*60*60*1000) {
result << response(command(zwave.batteryV1.batteryGet()))
result << response("delay 1200") // leave time for device to respond to batteryGet
}
if (!isConfigured()) {
if (logEnable) log.debug ("late configure")
result << response(configure())
} else {
if (logEnable) log.debug ("Device has been configured sending >> wakeUpNoMoreInformation()")
cmds << zwave.wakeUpV2.wakeUpNoMoreInformation().format()
result << response(cmds)
}
result
}
def zwaveEvent(hubitat.zwave.commands.multicmdv1.MultiCmdEncap cmd) {
if (logEnable) log.debug "multicmdencap: ${cmd.payload}"
//def encapsulatedCommand = cmd.encapsulatedCommand()
//if (encapsulatedCommand) {
// zwaveEvent(encapsulatedCommand)
//}
}
def zwaveEvent(hubitat.zwave.commands.securityv1.SecurityMessageEncapsulation cmd) {
def encapsulatedCommand = cmd.encapsulatedCommand([0x20: 1, 0x30: 1, 0x31: 5, 0x70: 1, 0x72: 1, 0x80: 1, 0x84: 2, 0x85: 1, 0x86: 1])
state.sec = 1
if (logEnable) log.debug "encapsulated: ${encapsulatedCommand}"
if (encapsulatedCommand) {
zwaveEvent(encapsulatedCommand)
} else {
if (logEnable) log.warn "Unable to extract encapsulated cmd from $cmd"
createEvent(descriptionText: cmd.toString())
}
}
def zwaveEvent(hubitat.zwave.commands.securityv1.SecurityCommandsSupportedReport cmd) {
if (logEnable) log.debug "Executing zwaveEvent 98 (SecurityV1): 03 (SecurityCommandsSupportedReport) with cmd: $cmd"
state.sec = 1
}
def zwaveEvent(hubitat.zwave.commands.securityv1.NetworkKeyVerify cmd) {
state.sec = 1
if (logEnable) log.debug "Executing zwaveEvent 98 (SecurityV1): 07 (NetworkKeyVerify) with cmd: $cmd (node is securely included)"
def result = [createEvent(name:"secureInclusion", value:"success", descriptionText:"Secure inclusion was successful", isStateChange: true)]
result
}
def zwaveEvent(hubitat.zwave.commands.configurationv1.ConfigurationReport cmd) {
if (logEnable) log.debug "---CONFIGURATION REPORT V1--- ${device.displayName} parameter ${cmd.parameterNumber} with a byte size of ${cmd.size} is set to ${cmd.configurationValue}"
}
def zwaveEvent(hubitat.zwave.commands.sensormultilevelv5.SensorMultilevelReport cmd)
{
if (logEnable) log.debug "PST02: SensorMultilevel ${cmd.toString()}"
def map = [:]
switch (cmd.sensorType) {
case 1:
// temperature
def cmdScale = cmd.scale == 1 ? "F" : "C"
map.value = convertTemperatureIfNeeded(cmd.scaledSensorValue, cmdScale, cmd.precision)
map.unit = getTemperatureScale()
map.name = "temperature"
if (tempOffset) {
def offset = tempOffset as int
def v = map.value as int
map.value = v + offset
}
if (logEnable) log.debug "Adjusted temp value ${map.value}"
break;
case 3:
// luminance
map.value = cmd.scaledSensorValue.toInteger().toString()
map.unit = "lux"
map.name = "illuminance"
break;
}
//map
createEvent(map)
}
def zwaveEvent(hubitat.zwave.commands.batteryv1.BatteryReport cmd) {
if (logEnable) log.debug "PST02: BatteryReport ${cmd.toString()}}"
def map = [:]
map.name = "battery"
map.value = cmd.batteryLevel > 0 ? cmd.batteryLevel.toString() : 1
map.unit = "%"
map.displayed = false
//map
state.lastbatt = now()
createEvent(map)
}
def zwaveEvent(hubitat.zwave.commands.sensorbinaryv2.SensorBinaryReport cmd) {
if (logEnable) log.debug "PST02: SensorBinaryReport ${cmd.toString()}}"
def map = [:]
switch (cmd.sensorType) {
case 10: // contact sensor
map.name = "contact"
if (logEnable) log.debug "PST02 cmd.sensorValue: ${cmd.sensorValue}"
if (cmd.sensorValue.toInteger() > 0 ) {
if (logEnable) log.info "PST02 DOOR OPEN"
map.value = "open"
map.descriptionText = "$device.displayName is open"
} else {
if (logEnable) log.info "PST02 DOOR CLOSED"
map.value = "closed"
map.descriptionText = "$device.displayName is closed"
}
break;
case 12: // motion sensor
map.name = "motion"
if (logEnable) log.debug "PST02 cmd.sensorValue: ${cmd.sensorValue}"
if (cmd.sensorValue.toInteger() > 0 ) {
if (logEnable) log.info "PST02 Motion Detected"
map.value = "active"
map.descriptionText = "$device.displayName is active"
} else {
if (logEnable) log.info "PST02 No Motion"
map.value = "inactive"
map.descriptionText = "$device.displayName no motion"
}
map.isStateChange = true
break;
}
//map
createEvent(map)
}
def zwaveEvent(hubitat.zwave.Command cmd) {
if (logEnable) log.debug "PST02: Catchall reached for cmd: ${cmd.toString()}}"
[:]
}
def configure() {
if (logEnable) log.debug "PST02: configure() called"
def request = []
//http://manuals-backend.z-wave.info/make.php?lang=en&sku=PST02-1A&cert=ZC10-16030003
/*Configuration Parameters
IMPORTANT: Controllers may only allow configuring signed values. In order to set values in the range 128 ... 255 the value sent in the application shall be the desired value minus 256.
For example: To set a parameter to 200 it may be needed to set a value of 200 minus 256 = minus 56.
In case of a two byte value the same logic applies: Values greater than 32768 may needed to be given as negative values too.
*/
//Auto Report Battery Time (Configuration Parameter 10 Default: 12)
request << zwave.configurationV1.configurationSet(parameterNumber: 10, size: 1, scaledConfigurationValue: 12)
//Auto Report Door/Window State Time (Configuration Parameter 11 Default: 12)
request << zwave.configurationV1.configurationSet(parameterNumber: 12, size: 1, scaledConfigurationValue: 12)
//Auto Report Illumination Time (Configuration Parameter 12 Default: 12)
request << zwave.configurationV1.configurationSet(parameterNumber: 12, size: 1, scaledConfigurationValue: 12)
//Auto Report Temperature Time (Configuration Parameter 13 Default: 12)
request << zwave.configurationV1.configurationSet(parameterNumber: 13, size: 1, scaledConfigurationValue: 12)
/* Parameter 2: Basic Set Level (Configuration Parameter: 2 Setting: 0-255 Default: 255)
Setting the BASIC command value to turn on the light. The 0xFF(-1) means turn on the light.
For dimmer equipment 1 to 100 means the light strength.0 means turn off the light. */
request << zwave.configurationV1.configurationSet(parameterNumber: 2, size: 1, scaledConfigurationValue: 255)
/* Auto Report Tick Interval (Configuration Parameter: 20 Setting: 0-255 Default: 30)
The interval time for auto report each tick.
Setting this configuration will effect configuration No.10, No.11, No.12 and No.13.Caution: Setting to 0 means turn off all auto report function. */
request << zwave.configurationV1.configurationSet(parameterNumber: 2, size: 1, scaledConfigurationValue: 30)
/* Temperature Differential Report (Configuration Parameter 21 Default: 1)
The temperature differential to report.0 means turn off this function. The unit is Fahrenheit.Enable this function the device will detect every minutes.
And when the temperature is over 140 degree Fahrenheit, it will continue report.
Enable this functionality will cause some issue please see the detail in the Temperature Report section. */
request << zwave.configurationV1.configurationSet(parameterNumber: 21, size: 1, scaledConfigurationValue: 1)
/* Illumination Differential Report (Configuration Parameter 22 Default: 0)
The illumination differential to report.0 means turn off this function. The unit is percentage.Enable this function the device will detect every minutes.
Enable this functionality will cause some issue please see the detail in the Illumination Report section. */
request << zwave.configurationV1.configurationSet(parameterNumber: 22, size: 1, scaledConfigurationValue: 0)
/* PIR Sensitivity (Configuration Parameter: 3 Setting: 1-99 Default: 80)
The illumination differential to report.0 means turn off this function. The unit is percentage.Enable this function the device will detect every minutes.
Enable this functionality will cause some issue please see the detail in the Illumination Report section. */
request << zwave.configurationV1.configurationSet(parameterNumber: 3, size: 1, scaledConfigurationValue: 80)
/* Light Threshold (Configuration Parameter:4 Setting: 1-100 Default: 99)
Setting the illumination threshold to turn on the light. When the event triggered and the environment illumination lower then the threshold, the device will turn on the light.
0 means turn off illumination detected function. And never turn on the light.
1 means darkest. 99 means brightest. 100 means turn off illumination detected function. And always turn on the light.
Notice: In none test mode, only the value in 1 to 99 will enable the illumination detected function and update the illumination value. */
request << zwave.configurationV1.configurationSet(parameterNumber: 4, size: 1, scaledConfigurationValue: 99)
/* Operation Mode (Configuration Parameter: 5 Setting: 0 - 255 Default: 0)
Operation mode. Using bit to control.Caution: The value is unsigned byte, the range is from 0x00 ~0xFF.
Bit0: Reserve.
Bit1: 1 means test mode, 0 means normal mode.Notice: This bit only effect by the DIP Switch setting to customer mode, otherwise it decides by DIP Switch setting to Test or Normal Mode.
Bit2: Disable the door/window function. (1:Disable, 0:Enable)
Bit3: Setting the temperature scale.0: Fahrenheit, 1:Celsius
Bit4: Disable the illumination report after event triggered. (1:Disable, 0:Enable)
Bit5: Disable the temperature report after event triggered. (1:Disable, 0:Enable)
Bit6: Reserve.Bit7: Disable the back key release into test mode. (1:Disable, 0:Enable) Notice: The reserve bit is allowed any value, but no effect. */
request << zwave.configurationV1.configurationSet(parameterNumber: 5, size: 1, scaledConfigurationValue: 0)
/* Mult-Sensor Function Switch (Configuration Parameter: 6 Setting: 0 - 255 Default: 4)
Multisensor function switch. Using bit to control.Caution: The value is unsigned byte, the range is from 0x00 ~0xFF.
Bit0: Disable magnetic integrate illumination to turn ON the lighting nodes in the association group 2. (1:Disable, 0:Enable)
Bit1: Disable PIR integrate Illumination to turn ON the lighting nodes in the association group 2. (1:Disable, 0:Enable)
Bit2: Disable magnetic integrate PIRto turn ON the lighting nodes in the association group 2. (Default is Disable) (1:Disable, 0:Enable)
Bit3: When Bit2 is 0 (Enable), Are the device and the lighting in the same room?
0: In the same room(Default),
1: In the different room.Notice:
If this bit is 1, it is recommended also set the Bit1 to 1, causethe PIR triggered, doesn't mean the people in that room.
Bit4: Disable delay 5 seconds to turn off the light, when door/window closed.(1:Disable, 0:Enable)
Bit5: Disable auto turn off the light, after door/window opened to turn on the light.(1:Disable, 0:Enable)
Notice: If bit2 is zero, this setting is useless.Notice: If the configuration No.9 is zero, this setting is useless.
Bit6: Reserve.Bit7: Reserve.Notice: The reserve bit is allowed any value, but no effect. */
request << zwave.configurationV1.configurationSet(parameterNumber: 6, size: 1, scaledConfigurationValue: 4)
/* Customer Function (Configuration Parameter: 7 Setting: 0 - 255 Default: 4)
Customer function switch, using bit control.Caution: The value is unsigned byte, the range is from 0x00 ~0xFF.
Bit0: Reserve.
Bit1: Enable sending motion OFF report.(0:Disable, 1:Enable)
Note: Depends on the Bit4, 0: Report Notification CC, Type: 0x07, Event: 0xFE1: Sensor Binary Report, Type: 0x0C, Value: 0x00
Bit2: Enable PIR super sensitivity mode.(0:Disable, 1:Enable)
Bit3: Disable send out BASIC OFF after door closed.(1:Disable, 0:Enable)
Bit4: Notification Type,0: Using Notification Report. 1: Using Sensor Binary Report.
Bit5: Disable Multi CC in auto report.(1:Disable, 0:Enable)
Bit6: Disable to report battery state when the device triggered.(1:Disable, 0:Enable)
Bit7: Reserve.Notice: The reserve bit is allowed any value, but no effect. */
request << zwave.configurationV1.configurationSet(parameterNumber: 7, size: 1, scaledConfigurationValue: 54)
/* PIR Re-Detect Interval Time (Configuration Parameter: 8 Setting: 0 - 127 Default: 3)
In the normal mode, after the PIR motion detected, setting the re-detect time. 8 seconds per tick, default tick is 3 (24 seconds).
Setting the suitable value to prevent received the trigger signal too frequently. Also can save the battery energy.
Notice: If this value bigger than the configuration setting NO. 9. There is a period after the light turned off and the PIR not start detecting. */
request << zwave.configurationV1.configurationSet(parameterNumber: 8, size: 1, scaledConfigurationValue: 3)
/* Turn Off Light Time (Configuration Parameter: 9 Setting: 0 - 127 Default: 4 )
After turn on the lighting, setting the delay time to turn off the lighting when the PIR motion is not detected.
8 seconds per tick, default tick is 4 (32 seconds).0 means never send turn off light command. */
request << zwave.configurationV1.configurationSet(parameterNumber: 9, size: 1, scaledConfigurationValue: 4)
request << zwave.wakeUpV2.wakeUpIntervalSet(seconds: 24 * 3600, nodeid:zwaveHubNodeId) // Wake up period
//7. query sensor data
request << zwave.batteryV1.batteryGet()
request << zwave.sensorBinaryV2.sensorBinaryGet(sensorType: 10) //contact
request << zwave.sensorBinaryV2.sensorBinaryGet(sensorType: 12) //motion
request << zwave.sensorMultilevelV5.sensorMultilevelGet(sensorType: 1) //temperature
request << zwave.sensorMultilevelV5.sensorMultilevelGet(sensorType: 3) //illuminance
setConfigured("true")
commands(request) + ["delay 20000", zwave.wakeUpV2.wakeUpNoMoreInformation().format()]
}
private setConfigured(configure) {
if (txtEnable) log.debug "setConfigured: ${configure}"
updateDataValue("configured", configure)
}
private isConfigured() {
getDataValue("configured") == "true"
}
private command(hubitat.zwave.Command cmd) {
if (state.sec) {
zwave.securityV1.securityMessageEncapsulation().encapsulate(cmd).format()
} else {
cmd.format()
}
}
private commands(commands, delay=200) {
if (txtEnable) log.debug "sending commands: ${commands}"
delayBetween(commands.collect{ command(it) }, delay)
}
I have bought a Philio PST02-1c sensor (D-T-L) and used this driver code but get no response from the sensor. Is the code above be suitable for this sensor as well? Thx!
Hi @dgcr!
Have you tried them all or just the lattes driver ?. Some of them should work, can you post a debug log otherwise ?