I have an Aqara Temperature/Humidity/Pressure sensor in my bathroom.
I use it to detect if someone is taking a shower and if so I start a ventilation script that enables the ventilation for a period of time.
I detect a shower by a steep increase in humidity using a binary trend sensor.
This worked fine but I recently switched from the official Aqara gateway to Zigbee2Mqtt
I updated the sensor config and the humidity values it reads are fine. (also in the log)
But the binary trend sensor detects steep increases out of nowhere.
I have seen gradients of 50 or higher. (which to me must be impossible)
With the Aqara gateway setup I never experienced any false triggers.
Because of the recent switch I suspect the combination between the two components.
At user-level I can’t find anything that is going wrong
Thanks, this was my approach before the trend-detection.
The issue i found with that is when it is very humid weather the fan also turns on (having no effect on humidity because the outside air is also humid)
I think I found the culprit. My theory is that Zigbee2mqtt only updates the value when the sensor sends a new value.
Because the sensor only sends a new value when the value has changed with a certain threshold the time between messages can be more that one hour.
I think the aqara API repeats the last received value every once in a while.
I had a time limit on my samples resulting in no samples at all, and when a sample did arrive it would trigger the trend sensor.
I changed my configuration to this and now it works as before: