Update neo coolcam outlet

Ignore negative values
 DHT cleanup
This commit is contained in:
pgrondek 2020-09-18 15:24:50 +02:00
parent a1f2b5a877
commit e915eace80

View File

@ -13,7 +13,7 @@
*
*/
metadata {
definition (name: "Neo Coolcam Outlet", namespace: "pgrondek", author: "Przemysław Grondek", ocfDeviceType: "oic.d.switch", runLocally: true, minHubCoreVersion: '000.017.0012', executeCommandsLocally: false, genericHandler: "Z-Wave") {
definition (name: "Neo Coolcam Outlet", namespace: "pgrondek", author: "Przemysław Grondek", ocfDeviceType: "oic.d.switch", /* runLocally: false, minHubCoreVersion: '000.017.0012', executeCommandsLocally: false, genericHandler: "Z-Wave" */) {
capability "Energy Meter"
capability "Actuator"
capability "Switch"
@ -87,18 +87,11 @@ def installed() {
log.debug "installed()"
// Device-Watch simply pings if no device events received for 32min(checkInterval)
initialize()
if (zwaveInfo?.mfr?.equals("0063") || zwaveInfo?.mfr?.equals("014F")) { // These old GE devices have to be polled. GoControl Plug refresh status every 15 min.
runEvery15Minutes("poll", [forceForLocallyExecuting: true])
}
}
def updated() {
// Device-Watch simply pings if no device events received for 32min(checkInterval)
initialize()
if (zwaveInfo?.mfr?.equals("0063") || zwaveInfo?.mfr?.equals("014F")) { // These old GE devices have to be polled. GoControl Plug refresh status every 15 min.
unschedule("poll", [forceForLocallyExecuting: true])
runEvery15Minutes("poll", [forceForLocallyExecuting: true])
}
try {
if (!state.MSR) {
response(zwave.manufacturerSpecificV2.manufacturerSpecificGet().format())
@ -139,7 +132,9 @@ def parse(String description) {
}
def handleMeterReport(cmd){
log.debug("handleMeterReport")
if (cmd.meterType == 1) {
if(cmd.scaledMeterValue >= 0 ){
if (cmd.scale == 0) {
createEvent(name: "energy", value: cmd.scaledMeterValue, unit: "kWh")
} else if (cmd.scale == 1) {
@ -149,6 +144,7 @@ def handleMeterReport(cmd){
}
}
}
}
def zwaveEvent(physicalgraph.zwave.commands.meterv3.MeterReport cmd) {
log.debug "v3 Meter report: "+cmd