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

Plugwise Index out of range #85910

Closed
markblokpoel opened this issue Jan 15, 2023 · 29 comments · Fixed by #86812
Closed

Plugwise Index out of range #85910

markblokpoel opened this issue Jan 15, 2023 · 29 comments · Fixed by #86812
Assignees

Comments

@markblokpoel
Copy link

The problem

Integration was working correctly, woke up this morning and it doesn't load giving the error below. I'm using it with Lisa zones, radiator valves and a Loria Duo heatpump. Plugwise app is working fine.

Logger: homeassistant.components.plugwise
Source: components/plugwise/coordinator.py:67
Integration: Plugwise (documentation, issues)
First occurred: 07:49:59 (8 occurrences)
Last logged: 07:55:33

Unexpected error fetching plugwise data: list index out of range
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 225, in _async_refresh
    self.data = await self._async_update_data()
  File "/usr/src/homeassistant/homeassistant/components/plugwise/coordinator.py", line 77, in _async_update_data
    await self._connect()
  File "/usr/src/homeassistant/homeassistant/components/plugwise/coordinator.py", line 67, in _connect
    self.api.get_all_devices()
  File "/usr/local/lib/python3.10/site-packages/plugwise/smile.py", line 160, in get_all_devices
    self._all_device_data()
  File "/usr/local/lib/python3.10/site-packages/plugwise/smile.py", line 113, in _all_device_data
    self.update_for_cooling(self.gw_devices[device_id])
  File "/usr/local/lib/python3.10/site-packages/plugwise/smile.py", line 79, in update_for_cooling
    max_setpoint = self._sched_setpoints[1]
IndexError: list index out of range

What version of Home Assistant Core has the issue?

core-2022.12.4

What was the last working version of Home Assistant Core?

core-2022.12.4

What type of installation are you running?

Home Assistant Core

Integration causing the issue

Plugwise

Link to integration documentation on our website

https://www.home-assistant.io/integrations/plugwise

Diagnostics information

No response

Example YAML snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

@home-assistant
Copy link

Hey there @CoMPaTech, @bouwew, @brefra, @frenck, mind taking a look at this issue as it has been labeled with an integration (plugwise) you are listed as a code owner for? Thanks!

Code owner commands

Code owners of plugwise can trigger bot actions by commenting:

  • @home-assistant close Closes the issue.
  • @home-assistant rename Awesome new title Change the title of the issue.
  • @home-assistant reopen Reopen the issue.
  • @home-assistant unassign plugwise Removes the current integration label and assignees on the issue, add the integration domain after the command.

(message by CodeOwnersMention)


plugwise documentation
plugwise source
(message by IssueLinks)

@markblokpoel
Copy link
Author

Updated to 2023.1.4 but the same error occurs.

@bouwew
Copy link
Contributor

bouwew commented Jan 15, 2023

Did you recently change a setting related to the Loria? Maybe switch off the cooling function?

@markblokpoel
Copy link
Author

markblokpoel commented Jan 15, 2023

Did you recently change a setting related to the Loria? Maybe switch off the cooling function?

No nothing has changed since September. At least not by my hand
Also no firmware updates recently. Only possible change might be the "keterprotocol" but the Plugwise app does not give any feedback when it has last updated this.

Anything else I can check? Would it be safe to reinstall the integration, or do I loose all my custom entity names?

@bouwew
Copy link
Contributor

bouwew commented Jan 15, 2023

Do you have/use the Loria cooling-function during summer?

@markblokpoel
Copy link
Author

Do you have/use the Loria cooling-function during summer?

Yes, I did use it during the summer. It hasn't been a problem. Switched to heating around September and it worked up until last night. Thanks for helping me explore this issue. 🙏

@bouwew
Copy link
Contributor

bouwew commented Jan 15, 2023

FYI, there will be some updates for Plugwise related to the Loria in HA 2023.2 (I would expect).

You might try deleting the Plugwise integration and re-adding it, maybe that will help. But yes, you will loose your custom entity names. Unless they are located in the file customize.yaml.

If that doesn't work, I will have to time dive into this problem at the end of the week/next weekend.
I would be good to understand why this happens.

@markblokpoel
Copy link
Author

FYI, there will be some updates for Plugwise related to the Loria in HA 2023.2 (I would expect).

You might try deleting the Plugwise integration and re-adding it, maybe that will help. But yes, you will loose your custom entity names. Unless they are located in the file customize.yaml.

If that doesn't work, I will have to time dive into this problem at the end of the week/next weekend.
I would be good to understand why this happens.

Looking forward to the Loria updates. So far the integration has given me so many more nice features beyond the plugwise app, it's amazing!

I'll see if I can find some time this week to reinstall. Will let you know when I do. I'll try to collect more detailed logs along the way. The cooling / heating with dual setpoints doesn't work with a heat pump that cannot switch HVAC mode on the fly, so I have some custom cards hiding the "other" mode.

@markblokpoel
Copy link
Author

Today everything is back to normal, no error message, the integration loads correctly. I did not do anything. Very strange. Will keep an eye out if it happens again I'll try to report.

@markblokpoel
Copy link
Author

The error happened again this morning. I don't know what else to report, the error message is the same. What is peculiar is that is has happened on the same week day and the same time. Could it have to do with a schedule?

Logger: homeassistant.components.plugwise
Source: components/plugwise/coordinator.py:78
Integration: Plugwise (documentation, issues)
First occurred: 07:01:31 (31 occurrences)
Last logged: 07:32:01

Unexpected error fetching Adam data: list index out of range
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 225, in _async_refresh
    self.data = await self._async_update_data()
  File "/usr/src/homeassistant/homeassistant/components/plugwise/coordinator.py", line 78, in _async_update_data
    data = await self.api.async_update()
  File "/usr/local/lib/python3.10/site-packages/plugwise/smile.py", line 556, in async_update
    self.update_for_cooling(dev_dict)
  File "/usr/local/lib/python3.10/site-packages/plugwise/smile.py", line 79, in update_for_cooling
    max_setpoint = self._sched_setpoints[1]
IndexError: list index out of range

@bouwew
Copy link
Contributor

bouwew commented Jan 22, 2023

Yes, it's related to a schedule. Please see my request below.

@bouwew
Copy link
Contributor

bouwew commented Jan 22, 2023

Can you please capture some xml-data from your Adam?
Browse to http://<ip-address-of-your-adam>/core/domain_objects, right-click on the page, select Save as... and save the page as an XML-file.
By looking at this data I can probably find out what is causing this issue.

Please send the captured xml-file to my email: bouwe (at) westerdijk (point) info - change to a real email address :)

@MartijnDisse
Copy link

MartijnDisse commented Jan 22, 2023

I have exactly the same issue since this morning 04:31 without doing any update on my end. Any way I can help solve the issue by providing data? I am using the Plugwise integration to optimize my heat pump (Mercuria 11tr) so help is greatly appreaciated.

@bouwew
Copy link
Contributor

bouwew commented Jan 22, 2023

@MartijnDisse please send me the data from your system. Instructions are in my previous message.

@MartijnDisse
Copy link

MartijnDisse commented Jan 22, 2023

@bouwew ; Done.

Here is additional information that maybe helps. I also used the cooling feature during the summer. I do not use HA to control Adam, rather I use it to control other parts of my heating system directly. I use ON/OFF communication between Adam and the heatpump (not Opentherm).

My log from HA:
`2023-01-22 11:47:02.429 ERROR (MainThread) [homeassistant.components.plugwise] Unexpected error fetching plugwise data: list index out of range
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 225, in _async_refresh
self.data = await self._async_update_data()
File "/usr/src/homeassistant/homeassistant/components/plugwise/coordinator.py", line 77, in _async_update_data
await self._connect()
File "/usr/src/homeassistant/homeassistant/components/plugwise/coordinator.py", line 67, in _connect
self.api.get_all_devices()
File "/usr/local/lib/python3.10/site-packages/plugwise/smile.py", line 160, in get_all_devices
self._all_device_data()
File "/usr/local/lib/python3.10/site-packages/plugwise/smile.py", line 113, in _all_device_data
self.update_for_cooling(self.gw_devices[device_id])
File "/usr/local/lib/python3.10/site-packages/plugwise/smile.py", line 79, in update_for_cooling
max_setpoint = self._sched_setpoints[1]
IndexError: list index out of range
2023-01-22 11:47:02.431 WARNING (MainThread) [homeassistant.config_entries] Config entry 'Adam' for plugwise integration not ready yet: list index out of range; Retrying in background

2023-01-22 11:47:15.084 ERROR (MainThread) [homeassistant.components.plugwise] Unexpected error fetching plugwise data: list index out of range
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 225, in _async_refresh
self.data = await self._async_update_data()
File "/usr/src/homeassistant/homeassistant/components/plugwise/coordinator.py", line 77, in _async_update_data
await self._connect()
File "/usr/src/homeassistant/homeassistant/components/plugwise/coordinator.py", line 67, in _connect
self.api.get_all_devices()
File "/usr/local/lib/python3.10/site-packages/plugwise/smile.py", line 160, in get_all_devices
self._all_device_data()
File "/usr/local/lib/python3.10/site-packages/plugwise/smile.py", line 113, in _all_device_data
self.update_for_cooling(self.gw_devices[device_id])
File "/usr/local/lib/python3.10/site-packages/plugwise/smile.py", line 79, in update_for_cooling
max_setpoint = self._sched_setpoints[1]
IndexError: list index out of range'

Using HA version:
Home Assistant 2023.1.6
Supervisor 2022.12.1
Operating System 9.4

Using Adam firmware 3.7.3 (auto update on)

@bouwew
Copy link
Contributor

bouwew commented Jan 22, 2023

@MartijnDisse you write that the problem started today, Sunday, at 04:31 hrs. How did you come to this conclusion?

I don't see any schedule-change at that specific time. Maybe you have a relevant automation that fires at that specific time?

@MartijnDisse
Copy link

@bouwew ; this was the latest time I have history on values. After that the became unavailable.

@bouwew
Copy link
Contributor

bouwew commented Jan 22, 2023

@markblokpoel please reopen this issue.

@markblokpoel markblokpoel reopened this Jan 22, 2023
@markblokpoel
Copy link
Author

I reopened it. I was mobile all day so couldn't download the data. I did try to restart the plugwise gateway and then reinitialise the integration. Still the same error, so it might be a setting that survives a reboot.

@bouwew
Copy link
Contributor

bouwew commented Jan 22, 2023

@MartijnDisse do you have any automations that change the climate schedules?

@MartijnDisse
Copy link

@bouwew ; no I have an automation thats turns of a plug (which has a waterpump on it) and a koen (for underfloor heating) to stop the pump and close the underfloor heating when the electric element of my heatpump turns on.

@MartijnDisse
Copy link

@bouwew ; I noticed I do have a schedule active on Adam itself. It increased the temperature setpoint on Monday 04:30. Although I got the error today Sunday at 04:30, maybe its related, because the same time seems too much as a coincidence.

Screenshot_20230122_212928_Plugwise Home

@markblokpoel
Copy link
Author

I also just switched off a schedule for one of my zones and thought: let's try to reload agin. And now the integration loads perfectly fine. Not sure if it's the cause, but might be further evidence that a schedule might be the problem.

@MartijnDisse
Copy link

@markblokpoel; Same here! Before reading your message I turned off the schedule I had setup on Adam and the integration works again!

So surely it had something to do with the schedules.

But still weird that it stopped working at exactly on 430 on sunday, while the schedule would change the setpoint on 430 on Monday. Cannot be a coincidence. i guess.

@bouwew
Copy link
Contributor

bouwew commented Jan 23, 2023

@markblokpoel @MartijnDisse Yes correct, the problem is related to schedules.
I'm trying to reproduce the problem in our software test-environment, so far I have not been able to.
Will keep trying.

@bouwew
Copy link
Contributor

bouwew commented Jan 25, 2023

@markblokpoel @MartijnDisse I've located the bug and I think I've found a fix.
Will do some more testing and after good results will release a new version of the plugwise backend.
And release that new version into Core.

@MartijnDisse
Copy link

@bouwew ; good news! Well done and thank you.

@markblokpoel
Copy link
Author

@markblokpoel @MartijnDisse I've located the bug and I think I've found a fix.
Will do some more testing and after good results will release a new version of the plugwise backend.
And release that new version into Core.

That's great news, well done! If I can test let me know. If I remember, I'll report back after a few weeks with the new version.

@bouwew
Copy link
Contributor

bouwew commented Jan 28, 2023

@markblokpoel @MartijnDisse the problem should be fixed in HA Core version 2023.2.0.
Please upgrade and test when this version is available.

@github-actions github-actions bot locked and limited conversation to collaborators Feb 27, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants