Closed durd closed 1 month ago
I'm still unsure about sliding_window_moving_average filter, I've commented it out for the time being.
thx, i will test it later:)
Changed ">" to ">=" for time comparison, else Clearance and Movement time would be 1s more than set intervals.
Also added "update_interval" to Distance sensor, this replaces heartbeat filter but the value is still subject to delta filter.
Also made binary sensors publish initial state. Now HA isn't "unknown" after reset device.
An unintended effect is I think the sensor is quicker now. Before we started troubleshooting the issue of false detection I usually had a "cool down", after the Movement sensor went "Clear", of about 20-25s. Now it's down to ~5-6s. I've also noticed that if the sensor doesn't detect occupancy and immediately clears it also clears the "Occupancy or Movement" sensor and the "Occupancy Status" sensor. I don't recall noticing this before as well. I might be wrong and my testing is incomplete, but I think this is better and will be leaving it as it is.
An unintended effect is I think the sensor is quicker now. Before we started troubleshooting the issue of false detection I usually had a "cool down", after the Movement sensor went "Clear", of about 20-25s. Now it's down to ~5-6s. I've also noticed that if the sensor doesn't detect occupancy and immediately clears it also clears the "Occupancy or Movement" sensor and the "Occupancy Status" sensor. I don't recall noticing this before as well. I might be wrong and my testing is incomplete, but I think this is better and will be leaving it as it is.
Can confirm that this became a new side effect, caused by reading the null state to clear all properties. This requires removing some of the null code. As we've had a bit too much on our hands in the last couple of days, we're hoping to find some time to clean them up completely and then integrate your code. Some of the functionality we'll put in the beta firmware, but for basic dis=0.00 cases like this, I think they can be merged into the stable firmware (they're a completely irrational behaviour).
Thank you very much for your submission, these cleanups of extra spaces and quotes can be a nice improve.
Hi! I've tried it, works good! It doesn't have my changes to it's very chatty ;)
The refresh rate is nice!
When you change the beta to stable I will update my code to fit your new code.
Hi, we merged some of the changes into the new beta, and later changes can be made based on the beta.
This PR adds dedup of logs so the device isn't as chatty when viewing logs. This means that the same value will not be published or printed twice. The BH1750 sensor follows the log-level of "logger" which defaults to DEBUG, I changed only the sensors log-level to INFO.
The result is a less chatty log, and probably some power improvements as only new data is sent over WiFi. It's still very chatty when movement is detected, but that is "legitimate" data.
I added your fix for the self-detect, if you push your change to the repo I will make sure mine doesn't contain it.
Also cleaned up some whitespace and corrected strs to ints.