Skip to content
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

Stored setpoint incorrectly updated when controller goes offline #24

Open
iainlane opened this issue Jan 29, 2024 · 2 comments
Open

Stored setpoint incorrectly updated when controller goes offline #24

iainlane opened this issue Jan 29, 2024 · 2 comments

Comments

@iainlane
Copy link

I just noticed that my system was heating even when no zones were asking for it. I'm using a Nest, and Better Thermostat. zoned-heating is set to control the underlying TRV entities.

I'd previously instrumented zoned-heating with debug logging and turns on debug logging for the Nest integration and zoned-heating. I see these logs:

2024-01-29 09:30:16.878 DEBUG (MainThread) [google_nest_sdm.event] EventMessage raw_data={'eventId': 'b0820f0a-0dfb-4f27-95e2-03833004b514', 'timestamp': '2024-01-29T09:30:09.198Z', 'resourceUpdate': {'name': 'enterprises/mynest', 'traits': {'sdm.devices.traits.Connectivity': {'status': 'OFFLINE'}}}, 'userId': 'myUserId', 'resourceGroup': ['enterprises/mynest']}
2024-01-29 09:30:16.878 DEBUG (MainThread) [google_nest_sdm.device] Processing update b0820f0a-0dfb-4f27-95e2-03833004b514 @ 2024-01-29 09:30:09.198000+00:00
2024-01-29 09:30:16.878 DEBUG (MainThread) [google_nest_sdm.device] Trait update {'sdm.devices.traits.Connectivity': {'status': 'OFFLINE'}, 'name': 'enterprises/mynest'}
2024-01-29 09:30:16.885 DEBUG (MainThread) [custom_components.better_thermostat.utils.watcher] better_thermostat Dining Room: sensor.thermostat_temperature is unavailable. with state unavailable
2024-01-29 09:30:16.886 DEBUG (MainThread) [custom_components.better_thermostat.utils.watcher] better_thermostat Dining Room: sensor.thermostat_temperature is unavailable. with state unavailable
2024-01-29 09:30:16.886 DEBUG (MainThread) [custom_components.zoned_heating.switch] Storing controller setpoint=None
2024-01-29 09:30:21.141 DEBUG (MainThread) [google_nest_sdm.event] EventMessage raw_data={'eventId': '6aecfa88-1a42-4c9b-9645-a3c94d4dc5f2', 'timestamp': '2024-01-29T09:30:17.333Z', 'resourceUpdate': {'name': 'enterprises/mynest', 'traits': {'sdm.devices.traits.Connectivity': {'status': 'ONLINE'}}}, 'userId': 'myUserId', 'resourceGroup': ['enterprises/mynest']}
2024-01-29 09:30:21.141 DEBUG (MainThread) [google_nest_sdm.device] Processing update 6aecfa88-1a42-4c9b-9645-a3c94d4dc5f2 @ 2024-01-29 09:30:17.333000+00:00
2024-01-29 09:30:21.141 DEBUG (MainThread) [google_nest_sdm.device] Trait update {'sdm.devices.traits.Connectivity': {'status': 'ONLINE'}, 'name': 'enterprises/mynest'}
2024-01-29 09:30:21.146 DEBUG (MainThread) [custom_components.zoned_heating.switch] Storing controller setpoint=18.0

So: the Nest goes OFFLINE for 5 seconds, and we clear the stored setpoint. When it comes back online we restore it to what the Nest is set to.

I'd like the stored setpoint to have been remembered in this case. What should we do - ignore the controller becoming unavailable?

iainlane added a commit to iainlane/zoned-heating that referenced this issue Jan 29, 2024
Can happen when the controller goes offline/online. We shouldn't forget
the stored data in that case.

nielsfaber#24

e.g. if the controller goes offline, we don't want to forget what we had
before
@nielsfaber
Copy link
Owner

Looks like a good improvement. I never considered this scenario during implementation/testing.

@nielsfaber
Copy link
Owner

Can you open a PR for merging your code changes?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants