The problem is that the sensor occasionally reports lux as temperature. That means either freezing at night or burning hot at day.
However at the same time this error occurs the sensor also switches the units from °C to F. This can be used to decide if you want to use the values or not. The next update of the sensor will reset this error. I just do this for every FMS and use the variable.
2015-06-07 08:12:13.740 Z-Wave received "Temperature 1" sensor update to 473 °F
2015-06-07 08:12:13.747 Z-Wave received "Temperature 1" units changed to °F
"Fire Alarm"
2015-06-07 08:22:04.920 Z-Wave received "Temperature 1" sensor update to 25.0 °C
2015-06-07 08:22:04.927 Z-Wave received "Temperature 1" units changed to °C
Please note: I'm not sure how or if this error can occur if you are using F.
- Code: Select all
dev = indigo.devices[IDDEVICE] # Temperature Sensor
check = dev.states["sensorValue.ui"]
value = dev.states["sensorValue"]
if "C" in check:
indigo.variable.updateValue(IDVAR, str(value))
indigo.server.log("°C")
else:
indigo.server.log("F")