Closed emiliosic closed 2 years ago
I think it works if you just flip the order of the code so you round to two digits first, then do the min / max analysis.:
var newLightLevel = Math.round( newHSValue * 100) / 100
newLightLevel = Math.min(Math.max( newLightLevel, ambientLight.props.minValue), ambientLight.props.maxValue )
Then you don't need the added "if" block. Can you give it a try and let me know if this works.
Actually, I went ahead and made that change, so try the update to version 1.0.35.
Getting this error when reading a Z-Wave light sensor at night:
[homebridge-homeseer4] This plugin generated a warning from the characteristic 'Current Ambient Light Level': characteristic was supplied illegal value: number 0 exceeded minimum of 0.0001. See https://homebridge.io/w/JtMGR for more info.
A simple hack to resolve this issue is this: