plugwise / plugwise-beta

Custom-component / development version of the Plugwise Home Assistant platform
MIT License
24 stars 9 forks source link

[BUG]: KeyError: 'modulation_level' with Anna #340

Closed ElianKars closed 1 year ago

ElianKars commented 1 year ago

Describe the bug.

I get a Unexpected error fetching plugwise data: 'modulation_level' with plugwise-beta (v0.34.3).

My boiler (Intergas Kombi Kompakt HR 36/30) doesn't support the OpenTherm 'relative modulation level' message. Therefore, the modulation level is not available in the graph, in the Smile-T html-interface. Also no <type>modulation_level</type> tag in the XML dump can be found.

graph

This situation looks a bit like this problem in Core: https://github.com/home-assistant/core/issues/79708

What version of Home Assistant Core has the issue?

2023.1.7

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant OS

How did you install plugwise-beta?

HACS

What kind of Plugwise device is having issues?

Smile: Anna

What firmware version is your Plugwise product at?

4.3.13

Logging


2023-01-30 14:26:26.990 WARNING (SyncWorker_3) [homeassistant.loader] We found a custom integration hacs which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2023-01-30 14:26:26.990 WARNING (SyncWorker_3) [homeassistant.loader] We found a custom integration plugwise which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2023-01-30 14:26:32.446 DEBUG (MainThread) [custom_components.plugwise] DUC cooldown interval: 1.5
2023-01-30 14:26:33.255 ERROR (MainThread) [custom_components.plugwise] Unexpected error fetching plugwise data: 'modulation_level'
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 "/config/custom_components/plugwise/coordinator.py", line 97, in _async_update_data
    await self._connect()
  File "/config/custom_components/plugwise/coordinator.py", line 79, in _connect
    self.api.get_all_devices()
  File "/usr/local/lib/python3.10/site-packages/plugwise/smile.py", line 149, in get_all_devices
    self._all_device_data()
  File "/usr/local/lib/python3.10/site-packages/plugwise/smile.py", line 98, in _all_device_data
    data = self._get_device_data(device_id)
  File "/usr/local/lib/python3.10/site-packages/plugwise/smile.py", line 274, in _get_device_data
    device_data = self._get_appliance_data(dev_id)
  File "/usr/local/lib/python3.10/site-packages/plugwise/helper.py", line 1064, in _get_appliance_data
    self._cooling_active = data["modulation_level"] == 100
KeyError: 'modulation_level'
2023-01-30 14:26:33.256 DEBUG (MainThread) [custom_components.plugwise] Finished fetching plugwise data in 0.809 seconds (success: False)
2023-01-30 14:26:33.256 WARNING (MainThread) [homeassistant.config_entries] Config entry 'Smile Anna' for plugwise integration not ready yet: 'modulation_level'; Retrying in background
2023-01-30 14:26:33.280 DEBUG (MainThread) [custom_components.plugwise] DUC cooldown interval: 1.5
[...]

### Diagnostics information

Not available in this state.

### Additional information

I successfully used the Plugwise integration from Home-Assistant Core with Anna. However, I would also very much like to use my old USB stick with Circles. I then removed the Plugwise Core integration and switched to plugwise beta v0.34.3.
bouwew commented 1 year ago

Thanks for reporting the bug. I'll have a look at it later tonight.

bouwew commented 1 year ago

@ElianKars can you please upgrade to plugwise-beta v0.34.4a0 and test?

ElianKars commented 1 year ago

Yes, it works! Error is gone and Anna integration is working. You are fantastic! Thank you very much for your speedy help, @bouwew :)

bouwew commented 1 year ago

Very good, thanks for testing and reporting! I'll release the related updates.

bouwew commented 1 year ago

Solved via https://github.com/plugwise/plugwise-beta/pull/341