phifogg / ioBroker.sainlogic

An IoBroker Adapter for Sainlogic based weather stations
MIT License
20 stars 11 forks source link

Solar radtion is 0 if sainlogic is set to W/m2 #144

Closed bw1faeh0 closed 1 year ago

bw1faeh0 commented 1 year ago

Describe the bug
If I configure sainlogic to use W/m2 instead of lx for the solar radiation, the object value is always set to 0. When set to W/m2 the log tells Target for solarradiation unit is set: W/m2, using conversion: roundTo(x / 126.7, 1) every time data arrives from the weather station.

To Reproduce
Steps to reproduce the behavior:

  1. Go to instance settings of sainloigc
  2. Click on 'device settings'
  3. Set solar radiation to 'W/m2'

Expected behavior
correct calculation

Versions:

Output, if set to lx: image

Output, if set to W/m2: image

oelison commented 1 year ago

I had the same issue. Push the edit button and set the unit to W/m2. It is cyclicly calling the checkUnit function and divide it to zero and stops then. I think the function need to set the unit of the state correct and then this will disapear also on such change.

phifogg commented 1 year ago

Added to release 0.10.1