I think I got it
The timestamp used to compare does not have precision enough, so when both events (press and release) fall into the same second, and the HA update is made in the middle, so it fires a âpressâ event, in the next update it will get a different code (the 4002) but with the same timestamp, and it wonât fire another event, making the âpressâ the last and unique one.
I need to re-check it, but Iâve also experienced it myself, so the bug is real.
EDIT: A proposed fix is ready in Fix missing events for hue remotes by azogue · Pull Request #34340 · home-assistant/core · GitHub
When both events fall into different seconds, then it is working as expected, firing the 2 events:
Evento 22 disparado 14:23:
{
"event_type": "hue_event",
"data": {
"id": "interruptor_dormitorio",
"unique_id": "xxxredactedxxx",
"event": 4002,
"last_updated": "2020-04-17T12:23:38"
},
"origin": "LOCAL",
"time_fired": "2020-04-17T12:23:39.273431+00:00",
"context": {
"id": "0739822965df4c9caf49bf24d237d3be",
"parent_id": null,
"user_id": null
}
}
Evento 21 disparado 14:23:
{
"event_type": "hue_event",
"data": {
"id": "interruptor_dormitorio",
"unique_id": "xxxredactedxxx",
"event": 4000,
"last_updated": "2020-04-17T12:23:37"
},
"origin": "LOCAL",
"time_fired": "2020-04-17T12:23:38.235080+00:00",
"context": {
"id": "c935a9292e29473c9b11850752750922",
"parent_id": null,
"user_id": null
}
}