-
Notifications
You must be signed in to change notification settings - Fork 3.2k
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
danfoss: Update time regularly to account for loss and drift #8479
Conversation
Danfoss eTRVs will regularly lose their time, such as on battery change, after updates, after hardware resets, etc., which leads to wildly inaccurate date and time of day. Even without these events, clock drift may lead to slowly growing clock errors. This not only breaks scheduling, but also causes the automatic adaption runs which cut off heating to run at inappropriate times such as in the middle of the day when heat is required. Follow the Danfoss recommendations and set time when the device connects, and at a one week interval.
678686b
to
e417faa
Compare
Thanks! |
From what I've been told about this device, I wonder if it might be worth putting the else if (type === 'deviceAnnounce' || type === 'start') {
if (type === 'start') {
setTimeout(async () => await setTime(device), 300000);
} else {
await setTime(device);
}
// rest...
} _Note: first line is just because we shouldn't create an array to check against two values 😉) Though, if the device always CC: @antst |
I have 6 Ally TRVs on my network, and I don't have any logged timeouts from them across several z2m restarts. Maybe open an issue with logs and description?
That's is just following the existing style, which I don't have an opinion on. |
I'm only relaying some observations from a previous debugging session with antst. |
I run 16 of them for 2.5 years in a busy network. They are, in my opinion, the best zigbee TRVs (and I tried most of what market can offer), and part of it is that they are very good on battery life. And part of being good on battery life is to don't rush with communication. From my experience, after anything going wrong with my mesh, due to any reasons, last one to recover are danfoss valves, and it take up to hour for them. Especially if coordinator was offline for quite some time. Everything else tends to go up quite instantly, but not those guys. And I did quite some amount of testing back in time(when spotted for the first time), it is not due to some "unfriendly" devices in my network or something. To me it fills that once they sense a lot of errors in communication with coordinator, they just go into power saving mode with communication. They do something differently, and go back to normal way of communication only some time after network recovered into healthy state. |
In my case it also fly now even with unchanged code. We noticed this issue after my network was down for sometime (due to the flashing and replacing adapters etc), so TRVs went to relaxed mode :) PS: by "old code" here I mean old code of onEvent :) |
Ah well, if you restart z2m while the TRVs are unavailable in an error state where they won't reconnect for an hour, then getting a timeout is expected. You should only get one for the TRV, as the next attempt will be once the device announces or a week later, whichever comes first. You could also have e.g. setpoint automations, load balance, external temp sync attempt to write to the TRVs during this time, which would also time out.
The device is only expected to sleep for a handful of seconds (or as configured in the poll control cluster, which can allow more extreme battery optimizations than what we're doing) in order to stay in spec and have reliable packet delivery. Being down for up to an hour sounds more like weird error handling (exponential backoff on reconnect?). |
Yes, it is the case. I actually run load balancing and external temperature sensors :)
At least this is what I see, if I leave mesh without coordinator for quite some time, and then start coordinator back. |
Danfoss eTRVs will regularly lose their time, such as on battery change, after updates, after hardware resets, etc., which leads to wildly inaccurate date and time of day. Even without these events, clock drift may lead to slowly growing clock errors.
This not only breaks scheduling, but also causes the automatic adaption runs which cut off heating to run at inappropriate times such as in the middle of the day when heat is required.
Follow the Danfoss recommendations and set time when the device connects, and at a one week interval.
/cc @filips