-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sensor reports multiple times #1264
Comments
This is expected behaviour, they come in separate zigbee messages. |
And you add the last known value for each of the missing parameters? |
Yes, last know values are added When pressing the button, or on a interval of 1 hour, the values are reported in one message trough the |
I see. So the device definition and all of its properties include the Does the device send always all three values one after another or only sometimes? Because I see that it always returned three for me, even if they are not updated. If that's the case, then it makes sense to either combine them in one package and post a single mqtt payload, or post each one the way it comes without adding other last known values. The reason behind it is that if you are storing the reports in a database for future use, those three values in short amount of time skew the results when you try to do calculations. I've added logic in my Node-Red to start a window of 5 seconds, and import any new data from the same sensor as overwrite of the initial payload. This way I basically keep only the last packet. similar logic can be added I hope in the report function for the devices - |
That would be good, are you comfortable with implementing such a mechanism? |
I am not familiar with node.js programming - I just write pure JS functions for my NodeRed needs. That being said - I was looking through the files to see if I can do it myself, but I'd appreciate if you point me where exactly should I start the testing - is it in publishEntityState? |
Actually there should be a thread somewhere that starts a timer whenever a new report from a device with this parameter comes. This initial report and all incoming reports during this timer should only be overwriting the state, and not be published. Once the timer expires, the state for the device should be published |
There is If you can point me where would be the best place for implementing this, I can give it a try. |
I expect that only changes in zigbee-shepherd-conveters are required.
|
I understand what you want me to do, but I don't understand how the linked code works and more precisely - which part is handling the publishing and the updating of the store. As I said I am not really familiar with the latest JS code structs so I might be missing how those section works. My understanding is that they only handle the precision manipulation, but then return it for posting to another function. |
Thinking about this again, your Documentation: https://github.com/Koenkk/zigbee2mqtt.io/blob/dev/configuration/device_specific_configuration.md You can test this feature in the dev branch. |
Confirming that it works as expected - with |
What about debouncing PIR sensors, too ?! I observe the following ...
Getting the change of illuminance first, when being triggered by a movement is somehow wired. I am almost sure, that the movement is the basis for the state-change. |
@davekr8 that is already possible using the current implementation (it's not device type specific) |
I have set debounce: 1 in the yaml, but the result is a double message. |
Just to emphasis the problem (here such a pair from the my logs): We have the situation, that triggered by a movement, the first msg contains the following pair of states (illuminance x, occupancy:false), the second (bounce) message switches (occupancy:false -> true). From my point of view the intermediate state occupancy:false is misleading, or even wrong ! |
I can tell you this should work - I have the same config and debounce works for motion sensors:
|
Ah ... I see the difference in my (wrong) config item: Edit: |
I am using 1.2.1 with 20190223 and I have three WSDCGQ11LM Aqara sensors. When they report, I see update for each of their measured values consequently for under a second like this:
as you can see the temperature is updated first, then the humidity and finally the pressure. I've noticed similar behavior in the report for #684.
When I press the button though, I get only one report with all three values updated.
Is this expected behavior?
Is the device actually sending three separate packets in the span of a second with each of the values and you just send a full report using previous data?
Is this limitation of the device, the protocol or the Zigbee2mqtt?
Can this be somehow fixed and all three reports be combined into one?
The text was updated successfully, but these errors were encountered: