diff --git a/devicetypes/smartthings/child-temperature-sensor.src/child-temperature-sensor.groovy b/devicetypes/smartthings/child-temperature-sensor.src/child-temperature-sensor.groovy index d470ff50208..aedc2a906a2 100644 --- a/devicetypes/smartthings/child-temperature-sensor.src/child-temperature-sensor.groovy +++ b/devicetypes/smartthings/child-temperature-sensor.src/child-temperature-sensor.groovy @@ -47,7 +47,7 @@ def updated() { } def configure() { - sendEvent(name: "checkInterval", value: 2 * 60 * 60 + 2 * 60, displayed: false, data: [protocol: "zwave", hubHardwareId: device.hub.hardwareID, offlinePingable: "1"]) + parent.configureChild() refresh() } diff --git a/devicetypes/smartthings/fibaro-heat-controller.src/fibaro-heat-controller.groovy b/devicetypes/smartthings/fibaro-heat-controller.src/fibaro-heat-controller.groovy index 03630f02333..a1d9fd473cc 100644 --- a/devicetypes/smartthings/fibaro-heat-controller.src/fibaro-heat-controller.groovy +++ b/devicetypes/smartthings/fibaro-heat-controller.src/fibaro-heat-controller.groovy @@ -171,9 +171,16 @@ def zwaveEvent(physicalgraph.zwave.commands.sensormultilevelv5.SensorMultilevelR } def zwaveEvent(physicalgraph.zwave.commands.configurationv2.ConfigurationReport cmd) { - if (cmd.parameterNumber == 3 && cmd.scaledConfigurationValue == 1) { - if(!childDevices) { - addChild() + if (cmd.parameterNumber == 3) { + if (cmd.scaledConfigurationValue == 1) { + if (!childDevices) { + state.isChildOnline = true + addChild() + } else { + changeTemperatureSensorStatus("online") + } + } else if (cmd.scaledConfigurationValue == 0 && childDevices) { + changeTemperatureSensorStatus("offline") } } } @@ -299,7 +306,12 @@ def switchMode() { def sendEventToChild(event) { String childDni = "${device.deviceNetworkId}:2" def child = childDevices.find { it.deviceNetworkId == childDni } - child?.sendEvent(event) + if (state.isChildOnline) + child?.sendEvent(event) +} + +def configureChild() { + sendEventToChild(createEvent([name: "checkInterval", value: 6 * 60 * 60 + 36, displayed: false])) } private refreshChild() { @@ -328,4 +340,10 @@ private getMaxHeatingSetpointTemperature() { private getMinHeatingSetpointTemperature() { temperatureScale == 'C' ? 10 : 50 +} + +private changeTemperatureSensorStatus(status) { + state.isChildOnline = (status == "online") + def map = [name: "DeviceWatch-DeviceStatus", value: status] + sendEventToChild(map) } \ No newline at end of file