From 327a947844bc46887657debd43fffca9833c6c4f Mon Sep 17 00:00:00 2001 From: Przemyslaw Kacprowicz Date: Fri, 28 Aug 2020 16:41:25 +0200 Subject: [PATCH 1/2] Schedule energy usage poll once a day --- .../qubino-flush-shutter.src/qubino-flush-shutter.groovy | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/devicetypes/qubino/qubino-flush-shutter.src/qubino-flush-shutter.groovy b/devicetypes/qubino/qubino-flush-shutter.src/qubino-flush-shutter.groovy index 22cd56f40f1..6507f231d96 100644 --- a/devicetypes/qubino/qubino-flush-shutter.src/qubino-flush-shutter.groovy +++ b/devicetypes/qubino/qubino-flush-shutter.src/qubino-flush-shutter.groovy @@ -82,6 +82,7 @@ def installed() { state.temperatureSensorDni = null sendHubCommand(encap(zwave.configurationV2.configurationGet(parameterNumber: 71))) sendEvent(name: "checkInterval", value: 2 * 60 * 60, displayed: false, data: [protocol: "zwave", hubHardwareId: device.hub.hardwareID]) + schedule(new Date(), getEnergyUsage) // Preferences template begin state.currentPreferencesState = [:] parameterMap.each { @@ -448,6 +449,10 @@ private createVenetianBlindsChildDeviceIfNeeded() { } } +private getEnergyUsage() { + sendHubCommand(encap(zwave.meterV3.meterGet(scale: 0x00))) +} + private getParameterMap() {[ [ name: "Operating modes", key: "operatingModes", type: "enum", From 87d932d5a2bbb0b621abd80db2e57c9e6b1de09f Mon Sep 17 00:00:00 2001 From: PKacprowiczS Date: Fri, 18 Sep 2020 17:29:18 +0200 Subject: [PATCH 2/2] Moved to querying energy usage after power report --- .../qubino-flush-shutter.groovy | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/devicetypes/qubino/qubino-flush-shutter.src/qubino-flush-shutter.groovy b/devicetypes/qubino/qubino-flush-shutter.src/qubino-flush-shutter.groovy index 6507f231d96..13845b2c378 100644 --- a/devicetypes/qubino/qubino-flush-shutter.src/qubino-flush-shutter.groovy +++ b/devicetypes/qubino/qubino-flush-shutter.src/qubino-flush-shutter.groovy @@ -82,7 +82,6 @@ def installed() { state.temperatureSensorDni = null sendHubCommand(encap(zwave.configurationV2.configurationGet(parameterNumber: 71))) sendEvent(name: "checkInterval", value: 2 * 60 * 60, displayed: false, data: [protocol: "zwave", hubHardwareId: device.hub.hardwareID]) - schedule(new Date(), getEnergyUsage) // Preferences template begin state.currentPreferencesState = [:] parameterMap.each { @@ -369,7 +368,11 @@ def zwaveEvent(physicalgraph.zwave.commands.meterv3.MeterReport cmd, ep = null) events += createEvent([name: "windowShade", value: state.blindsLastCommand]) events += createEvent([name: "shadeLevel", value: state.shadeTarget, displayed: false]) } else { - events += response(encap(zwave.switchMultilevelV3.switchMultilevelGet())) + events += response([ + encap(zwave.switchMultilevelV3.switchMultilevelGet()), + "delay 500", + encap(zwave.meterV3.meterGet(scale: 0x00)) + ]) } } } @@ -449,10 +452,6 @@ private createVenetianBlindsChildDeviceIfNeeded() { } } -private getEnergyUsage() { - sendHubCommand(encap(zwave.meterV3.meterGet(scale: 0x00))) -} - private getParameterMap() {[ [ name: "Operating modes", key: "operatingModes", type: "enum",