smartboxchannel / SONOFF-SNZB-02-Temperature-and-humidity-sensor

An alternative firmware version for the SONOFF SNZB-02 temperature and humidity sensor. Adjustable sleep interval via zigbee network, thermostat and hydrostat functionality, standard temperature and humidity clusters, binding support.
74 stars 18 forks source link

Humidity Control does not work a expected #7

Open obrain17 opened 1 year ago

obrain17 commented 1 year ago

I have installed _SNZB-02_EFEKTAH.hex and am just doing some tests. Control of temperature works as expected but there seems to be an issue with humidity control. My settings:

Now I am alternately breathing or blowing to the sensor so the humidity changes between 40 and 60 what is also shown in the measured humidity value. But the linked (cluster on/off) zigbee device does not react accordingly.

I took a look to the code which however seems to be for the old version but there is a wrong statement in line 426:

if(zclApp_Config.EnableHum == 1){
      if(zclApp_HumiditySensor_MeasuredValue >= zclApp_Config.HighHum*100){
      zclGeneral_SendOnOff_CmdOn(zclApp_FirstEP.EndPoint, &inderect_DstAddr, TRUE, bdb_getZCLFrameCounter());
    }else if(zclApp_HumiditySensor_MeasuredValue <= zclApp_Config.HighHum*100){
      zclGeneral_SendOnOff_CmdOff(zclApp_FirstEP.EndPoint, &inderect_DstAddr, TRUE, bdb_getZCLFrameCounter());
    }
   }
}

both "if statements" compare with zclApp_Config.HighHum but in line 426 it should be zclApp_Config.LowHum in my opinion. Maybe this is still in the new version. Do you mind to check it and fix it if so?