Closed daroga0002 closed 6 months ago
Ok, so this is difficult.
I tested this while having two windows open: one with HA dashboard with thermostat, and emodul.pl site. In such view, after changing set temperature from HA frontend thermostat, it remained as set. emodul.pl updated itself after a couple seconds. So no user-perceived issue here.
But indeed, when I opened the thermostat entity in a popup, it had the old value, and for that I needed to wait for SCAN_INTERVAL
(which is 60s now) to get updated.
So clearly HA frontend itself just caches the set value for what it is displaying currently.
For the other scenario, we need to wait at most 2xSCAN_INTERVAL
for everything to be correct.
The problem is that we don't do any caching in the integration or API (no local cache). Everything is left to HA coordinator to just fetch data every SCAN_INTERVAL
. With that, I don't think it is worth the effort to implement that local cache for this case, although I will gladly accept a PR.
yup, I just noticed that during refactor local cache was removed and moved to HA coordinator 💯
The logic which I see is to avoid updating values in coordinator when duringChange: true
. I will try to play with it in some free time.
The problem
Integration have problem with consistency under thermostat. So to replicate:
What version of Tech Controllers integration has the issue?
v2.0.1
What version of Home Assistant Core has the issue?
doesnt matter
What was the last working version of Tech Controller integration?
No response
Diagnostics information
Log:
this is caused because tech API is asynchronous and during zone temp change is setting:
duringChange: true
Until this value is
true
setTemperature configuration is not changed to temperature which was set on thermostat.Solution which can be potencially usefull here is to after sending POST request to tech API also update local cache with requested value, additionally during receiving new update on GET requests with values check does duringChange value is
true
or false. If true then just dont update it in cache and hold until it will becomefalse
Anything in the logs that might be useful for us?
No response
Additional information
No response