core: Upgrade to 2022.12 breaks Fritzbox integration
The problem
Integration stopped working after upgrade.
What version of Home Assistant Core has the issue?
2022.12.0
What was the last working version of Home Assistant Core?
2022.11.5
What type of installation are you running?
Home Assistant OS
Integration causing the issue
fritz.box
Link to integration documentation on our website
https://www.home-assistant.io/integrations/fritzbox
Diagnostics information
Logger: homeassistant.components.fritzbox
Source: components/fritzbox/coordinator.py:48
Integration: AVM FRITZ!SmartHome (documentation, issues)
First occurred: 15:49:28 (11 occurrences)
Last logged: 15:55:30
Unexpected error fetching *** data: no element found: line 1, column 0
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/fritzbox/coordinator.py", line 87, in _async_update_data
return await self.hass.async_add_executor_job(self._update_fritz_devices)
File "/usr/local/lib/python3.10/concurrent/futures/thread.py", line 58, in run
result = self.fn(*self.args, **self.kwargs)
File "/usr/src/homeassistant/homeassistant/components/fritzbox/coordinator.py", line 48, in _update_fritz_devices
self.fritz.update_templates()
File "/usr/local/lib/python3.10/site-packages/pyfritzhome/fritzhome.py", line 357, in update_templates
for element in self.get_template_elements():
File "/usr/local/lib/python3.10/site-packages/pyfritzhome/fritzhome.py", line 371, in get_template_elements
return self._get_listinfo_elements("template")
File "/usr/local/lib/python3.10/site-packages/pyfritzhome/fritzhome.py", line 144, in _get_listinfo_elements
dom = ElementTree.fromstring(plain)
File "/usr/local/lib/python3.10/xml/etree/ElementTree.py", line 1343, in XML
return parser.close()
xml.etree.ElementTree.ParseError: no element found: line 1, column 0
Example YAML snippet
No response
Anything in the logs that might be useful for us?
In front of the stack trace:
2022-12-08 16:07:32.048 DEBUG (MainThread) [homeassistant.components.fritzbox] Finished fetching *** data in 0.688 seconds (success: False)
2022-12-08 16:07:52.517 INFO (SyncWorker_4) [pyfritzhome.fritzhome] Updating Devices ...
2022-12-08 16:07:52.865 DEBUG (SyncWorker_4) [pyfritzhome.fritzhome] <Element 'devicelist' at 0x7f55360b30>
2022-12-08 16:07:52.866 INFO (SyncWorker_4) [pyfritzhome.fritzhome] Adding new Device 11657 0483368
2022-12-08 16:07:52.867 DEBUG (SyncWorker_4) [pyfritzhome.devicetypes.fritzhomeentitybase] b'<device identifier="11657 0483368" id="16" functionbitmask="2944" fwversion="03.87" manufacturer="AVM" productname="FRITZ!DECT 210"><present>1</present><name>Terasse</name><switch><state>1</state><mode>manuell</mode><lock>0</lock><devicelock>0</devicelock></switch><powermeter><power>960</power><energy>2125005</energy></powermeter><temperature><celsius>45</celsius><offset>20</offset></temperature></device>'
2022-12-08 16:07:52.868 INFO (SyncWorker_4) [pyfritzhome.fritzhome] Adding new Device 11630 0270389
2022-12-08 16:07:52.869 DEBUG (SyncWorker_4) [pyfritzhome.devicetypes.fritzhomeentitybase] b'<device identifier="11630 0270389" id="17" functionbitmask="2944" fwversion="03.87" manufacturer="AVM" productname="FRITZ!DECT 200"><present>1</present><name>Kühlschrank</name><switch><state>0</state><mode>manuell</mode><lock>0</lock><devicelock>0</devicelock></switch><powermeter><power>0</power><energy>82490</energy></powermeter><temperature><celsius>190</celsius><offset>-30</offset></temperature></device>'
2022-12-08 16:07:52.870 INFO (SyncWorker_4) [pyfritzhome.fritzhome] Adding new Device 11630 0286673
2022-12-08 16:07:52.871 DEBUG (SyncWorker_4) [pyfritzhome.devicetypes.fritzhomeentitybase] b'<device identifier="11630 0286673" id="18" functionbitmask="2944" fwversion="03.87" manufacturer="AVM" productname="FRITZ!DECT 200"><present>1</present><name>Wohnzimmer</name><switch><state>0</state><mode>manuell</mode><lock>0</lock><devicelock>0</devicelock></switch><powermeter><power>0</power><energy>212166</energy></powermeter><temperature><celsius>185</celsius><offset>-10</offset></temperature></device>'
2022-12-08 16:07:52.873 INFO (SyncWorker_4) [pyfritzhome.fritzhome] Updating Templates ...
2022-12-08 16:07:53.208 ERROR (MainThread) [homeassistant.components.fritzbox] Unexpected error fetching 3c3b1b62b09edb953257c0b29c74b1a2 data: no element found: line 1, column 0
Additional information
Fritzbox 7390
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 22 (7 by maintainers)
@tobixx @PCDoc0815 @Ventusfahrer @crazyduck @rugosch please test again as soon as 2022.12.2 is available (should be within next few days)
so ist es: gefixt mit 2022.12.4!
Viele Dank an @mib1185 !!!
sorry, should stay in English:
Confirm: fixed with 2022.12.4.
Thanks a lot @mib1185
Just upgraded to 2022.12.4 - and voila - nothing to see there (in the positive way: no tracebacks - everything functional). Thanks @mib1185 - that was fast! And thanks to all others who tried to help him! (while I couldn’t because still waiting for a free moment where no one would be at home - else I would earn some sh*** storm if anything would not work - like kids running into walls in the dark … 😉 )
@rugosch @Ventusfahrer fix will be available with 2022.12.4
Hi @mib1185, the result is empty.
Did it in a live console in a python 3.9 docker container with your explained steps
Thanks a lot! 2022.12.4 working like a charm
I yesterday installed 2022.12 on two of my home-assistant systems. The first one (using an Fritz!Box 6660 with Fritz!OS 7.39 (a beta of the upcoming 7.50) with one connected Fritz!DECT200 switch did not show any problems. The switch continues to work without any problem after the upgrade.
On the second one (an (older) Fritz!Box 7390 with Fritz!OS 6.87 with one Fritz!DECT200 ) I hat the same problem documented above. Meanwhile 2022.12.1 was available and installed, but did not change anything.
The ha logger-configuration was adjusted like described above, here is the output in home-assistant.log