From 1744269e8111d46c5e9b35b8ec80327529f8aa85 Mon Sep 17 00:00:00 2001 From: Konrad Klimczuk Date: Wed, 15 Jul 2020 18:20:18 +0200 Subject: [PATCH 1/6] fixes: ICP-13322, ICP-13326, ICP-13355 --- .../qubino-dimmer.src/qubino-dimmer.groovy | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/devicetypes/qubino/qubino-dimmer.src/qubino-dimmer.groovy b/devicetypes/qubino/qubino-dimmer.src/qubino-dimmer.groovy index f364229a214..a4aaa40b596 100644 --- a/devicetypes/qubino/qubino-dimmer.src/qubino-dimmer.groovy +++ b/devicetypes/qubino/qubino-dimmer.src/qubino-dimmer.groovy @@ -114,7 +114,7 @@ private getINPUT_TYPE_TEMPERATURE_SENSOR() {3} def installed() { // Device-Watch simply pings if no device events received for 32min(checkInterval) sendEvent(name: "checkInterval", value: 2 * 15 * 60 + 2 * 60, displayed: false, data: [protocol: "zwave", hubHardwareId: device.hub.hardwareID]) - + setInitialConfiguration() // Preferences template begin state.currentPreferencesState = [:] parameterMap.each { @@ -176,6 +176,19 @@ private readConfigurationFromTheDevice() { sendHubCommand(encapCommands(commands)) } +private setInitialConfiguration() { + // 1% is default Minimum dimming value for dimmers, + // when device is set to 1% - it turns off and device does not send any level reports + // Minimum dimming value has to be set to 2%, so the device's internal range would be 2-100% + // Still, for users it will relatively be 1-100% on the UI and device will report it. + + def commands = [] + // Parameter no. 60 – Minimum dimming value + commands << zwave.configurationV2.configurationSet(scaledConfigurationValue: 2, parameterNumber: 60, size: 1) + + sendHubCommand(encapCommands(commands)) +} + private syncConfiguration() { def commands = [] parameterMap.each { @@ -334,7 +347,7 @@ def zwaveEvent(physicalgraph.zwave.commands.basicv1.BasicSet cmd, ep = null) { if(input1SwitchType == INPUT_TYPE_POTENTIOMETER) { log.debug "BasicSet: ${cmd} / INPUT_TYPE_POTENTfIOMETER" - response(zwave.switchMultilevelV3.switchMultilevelGet()) + sendHubCommand(encap(zwave.switchMultilevelV3.switchMultilevelGet())) } else if (input1SwitchType == INPUT_TYPE_BI_STABLE_SWITCH) { log.debug "BasicSet: ${cmd} / INPUT_TYPE_BI_STABLE_SWITCH" dimmerEvents(cmd) From 655ce920dc9e8dbcd3701a495811761942f904df Mon Sep 17 00:00:00 2001 From: Konrad Klimczuk Date: Wed, 15 Jul 2020 19:44:40 +0200 Subject: [PATCH 2/6] fixes2: ICP-13322, ICP-13326, ICP-13355 --- .../qubino-dimmer.src/qubino-dimmer.groovy | 22 +++++++------------ 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/devicetypes/qubino/qubino-dimmer.src/qubino-dimmer.groovy b/devicetypes/qubino/qubino-dimmer.src/qubino-dimmer.groovy index a4aaa40b596..664c410847e 100644 --- a/devicetypes/qubino/qubino-dimmer.src/qubino-dimmer.groovy +++ b/devicetypes/qubino/qubino-dimmer.src/qubino-dimmer.groovy @@ -114,7 +114,7 @@ private getINPUT_TYPE_TEMPERATURE_SENSOR() {3} def installed() { // Device-Watch simply pings if no device events received for 32min(checkInterval) sendEvent(name: "checkInterval", value: 2 * 15 * 60 + 2 * 60, displayed: false, data: [protocol: "zwave", hubHardwareId: device.hub.hardwareID]) - setInitialConfiguration() + // Preferences template begin state.currentPreferencesState = [:] parameterMap.each { @@ -176,19 +176,6 @@ private readConfigurationFromTheDevice() { sendHubCommand(encapCommands(commands)) } -private setInitialConfiguration() { - // 1% is default Minimum dimming value for dimmers, - // when device is set to 1% - it turns off and device does not send any level reports - // Minimum dimming value has to be set to 2%, so the device's internal range would be 2-100% - // Still, for users it will relatively be 1-100% on the UI and device will report it. - - def commands = [] - // Parameter no. 60 – Minimum dimming value - commands << zwave.configurationV2.configurationSet(scaledConfigurationValue: 2, parameterNumber: 60, size: 1) - - sendHubCommand(encapCommands(commands)) -} - private syncConfiguration() { def commands = [] parameterMap.each { @@ -247,6 +234,13 @@ def configure() { commands << zwave.multiChannelV3.multiChannelEndPointGet() commands + getRefreshCommands() + // 1% is default Minimum dimming value for dimmers, + // when device is set to 1% - it turns off and device does not send any level reports + // Minimum dimming value has to be set to 2%, so the device's internal range would be 2-100% + // Still, for users it will relatively be 1-100% on the UI and device will report it. + // Parameter no. 60 – Minimum dimming value + commands << zwave.configurationV2.configurationSet(scaledConfigurationValue: 2, parameterNumber: 60, size: 1) + encapCommands(commands) } From fdb6cb5d5feb22e6b5332526b222f99fdd836b07 Mon Sep 17 00:00:00 2001 From: Konrad Klimczuk Date: Fri, 17 Jul 2020 13:46:19 +0200 Subject: [PATCH 3/6] fixes3: ICP-13322, ICP-13326, ICP-13355 --- devicetypes/qubino/qubino-dimmer.src/qubino-dimmer.groovy | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/devicetypes/qubino/qubino-dimmer.src/qubino-dimmer.groovy b/devicetypes/qubino/qubino-dimmer.src/qubino-dimmer.groovy index 664c410847e..cfbaf13cfbb 100644 --- a/devicetypes/qubino/qubino-dimmer.src/qubino-dimmer.groovy +++ b/devicetypes/qubino/qubino-dimmer.src/qubino-dimmer.groovy @@ -167,13 +167,13 @@ def excludeParameterFromSync(preference){ return exclude } -private readConfigurationFromTheDevice() { +private getReadConfigurationFromTheDeviceCommands() { def commands = [] parameterMap.each { state.currentPreferencesState."$it.key".status = "reverseSyncPending" commands += zwave.configurationV2.configurationGet(parameterNumber: it.parameterNumber) } - sendHubCommand(encapCommands(commands)) + commands } private syncConfiguration() { @@ -240,6 +240,7 @@ def configure() { // Still, for users it will relatively be 1-100% on the UI and device will report it. // Parameter no. 60 – Minimum dimming value commands << zwave.configurationV2.configurationSet(scaledConfigurationValue: 2, parameterNumber: 60, size: 1) + commands + getReadConfigurationFromTheDeviceCommands() encapCommands(commands) } From de5a9b3f9e28e3019d1919a368ae209b0c755411 Mon Sep 17 00:00:00 2001 From: Konrad Klimczuk Date: Tue, 21 Jul 2020 12:52:59 +0200 Subject: [PATCH 4/6] fix for ICP-13345 - add meterGet commands --- devicetypes/qubino/qubino-dimmer.src/qubino-dimmer.groovy | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/devicetypes/qubino/qubino-dimmer.src/qubino-dimmer.groovy b/devicetypes/qubino/qubino-dimmer.src/qubino-dimmer.groovy index cfbaf13cfbb..860f981fcbd 100644 --- a/devicetypes/qubino/qubino-dimmer.src/qubino-dimmer.groovy +++ b/devicetypes/qubino/qubino-dimmer.src/qubino-dimmer.groovy @@ -490,6 +490,11 @@ def setLevel(value, duration = null) { commands << zwave.switchMultilevelV3.switchMultilevelSet(value: level, dimmingDuration: dimmingDuration) commands << zwave.switchMultilevelV3.switchMultilevelGet() + if(supportsPowerMeter()){ + commands << zwave.meterV2.meterGet(scale: 0) + commands << zwave.meterV2.meterGet(scale: 2) + } + encapCommands(commands, getStatusDelay) } From f5307902188268d4a54f8a6426e3157a90737205 Mon Sep 17 00:00:00 2001 From: Konrad Klimczuk Date: Wed, 22 Jul 2020 14:45:31 +0200 Subject: [PATCH 5/6] Fix for adding elements to commands collection --- devicetypes/qubino/qubino-dimmer.src/qubino-dimmer.groovy | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/devicetypes/qubino/qubino-dimmer.src/qubino-dimmer.groovy b/devicetypes/qubino/qubino-dimmer.src/qubino-dimmer.groovy index 860f981fcbd..10d236c9aa8 100644 --- a/devicetypes/qubino/qubino-dimmer.src/qubino-dimmer.groovy +++ b/devicetypes/qubino/qubino-dimmer.src/qubino-dimmer.groovy @@ -122,7 +122,6 @@ def installed() { state.currentPreferencesState."$it.key".value = getPreferenceValue(it) state.currentPreferencesState."$it.key".status = "synced" } - readConfigurationFromTheDevice() // Preferences template end } @@ -232,7 +231,7 @@ def configure() { commands << zwave.associationV1.associationSet(groupingIdentifier:5, nodeId:[zwaveHubNodeId]) commands << zwave.associationV1.associationSet(groupingIdentifier:6, nodeId:[zwaveHubNodeId]) commands << zwave.multiChannelV3.multiChannelEndPointGet() - commands + getRefreshCommands() + commands += getRefreshCommands() // 1% is default Minimum dimming value for dimmers, // when device is set to 1% - it turns off and device does not send any level reports @@ -240,7 +239,7 @@ def configure() { // Still, for users it will relatively be 1-100% on the UI and device will report it. // Parameter no. 60 – Minimum dimming value commands << zwave.configurationV2.configurationSet(scaledConfigurationValue: 2, parameterNumber: 60, size: 1) - commands + getReadConfigurationFromTheDeviceCommands() + commands += getReadConfigurationFromTheDeviceCommands() encapCommands(commands) } From 3e254612cd2d58c19445f7632e7b4f4b09c396a1 Mon Sep 17 00:00:00 2001 From: Konrad Klimczuk Date: Wed, 22 Jul 2020 16:09:34 +0200 Subject: [PATCH 6/6] ICP-13336 - Removed option 3, because it does not apply to Qubino Temperature Sensor ZMNHEA1. --- devicetypes/qubino/qubino-dimmer.src/qubino-dimmer.groovy | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/devicetypes/qubino/qubino-dimmer.src/qubino-dimmer.groovy b/devicetypes/qubino/qubino-dimmer.src/qubino-dimmer.groovy index 10d236c9aa8..8cea8b62461 100644 --- a/devicetypes/qubino/qubino-dimmer.src/qubino-dimmer.groovy +++ b/devicetypes/qubino/qubino-dimmer.src/qubino-dimmer.groovy @@ -582,11 +582,9 @@ private getParameterMap() {[ values: [ 0: "Default value - Mono-stable switch type (push button) – button quick press turns between previous set dimmer value and zero)", 1: "Bi-stable switch type (on/off toggle switch)", - 2: "Potentiometer (applies to Flush Dimmer 0-10V only, dimmer is using set value the last received from potentiometer or from z-wave controller)", - 3: "0-10V Temperature sensor (regulated output, applies to Flush Dimmer 0-10V only)" + 2: "Potentiometer (applies to Flush Dimmer 0-10V only, dimmer is using set value the last received from potentiometer or from z-wave controller)" ], - description: "Set input based on device type (switch, potentiometer, temperature sensor,..)." + - "After parameter change to value 3 first exclude module (without setting parameters to default value) then wait at least 30s and then re include the module! " + description: "Set input based on device type (mono-stable switch, bi-stable switch, potentiometer)." ], [ name: "Input 2 switch type (applies to Qubino Flush Dimmer only)", key: "inputsSwitchTypes", type: "enum",