LavermanJJ / home-assistant-solarfocus

🏡 Solarfocus eco manager touch integration for Home Assistant
Apache License 2.0
15 stars 6 forks source link

SOLARFOCUS breaks my HA #99

Closed RobertoCravallo closed 7 months ago

RobertoCravallo commented 7 months ago

Describe the bug I was searching for weeks for this. So today I installed a new HA VM in PROXMOX and just started adding integrations to try and see when it breaks!!! Success!!!!

As soon as I add the SOLARFOCUS integration, it breaks RADIO Browser!! Tankerkönig, GARMIN and LG ThinQ get broken in my regular installation and where not as yet added to this instance.

I remember you writing about a "workaround" for HA 2024.x.x. But that can not be the actual problem, because the rror occurred right after the installation of 2024.x.x. So the problem lies deeper I guess. I think you might be installing the wrong version of Python.

Another interesting effect. Installed a new HA via script in PROXMOX and then installed my backup. Everything was fine and I was happy. Until I booted HA. Then the error is back right away. So I am assuming, that installing the back-up overwrites functional code in HA, but everything seems fine until HA is restarted!!!

To Reproduce Steps to reproduce the behavior:

  1. install SOLARFOCUS via HACS
  2. Add the entity
  3. IMPORTANT!!! Restart HA. There is no problem after the configuration, until HA restarts!!
  4. See error

Expected behavior Other integrations should continue to work properly and no more server 500 errors

Screenshots 305651760-a556c587-3def-471e-ab9b-812585219fea 305651771-0984c4eb-3007-4dca-a97b-34afe5f32c73 305651795-96c6eb4f-9f72-4b2a-823b-27c08b933189

Desktop (please complete the following information):

Additional context SOLARFOCUS works fine, but breaks other integrations. Below text from the developer of the GARMIN integration, which I suspected first.

As far as I can tell, the problem is related to Python 3.12 and SOLARFOCUS seems to install an older library.

"There are several of these breaking errors in the log, for multiple packages, with the result that the needed underlaying libraries cannot be installed and the integration(s) fail to install. AttributeError: module 'pkgutil' has no attribute 'ImpImporter'. Did you mean: 'zipimporter'?

If you google that those errors are related to Python 3.12 (which 2024 is started to use) this should not be an issue with Garmin, or most other integrations, but it could be that one or more of them (or backup/ha itself) installs an older version of a tools called setuptools. This may cause these issues, so HA needs to be completely uptodate and no integration may downgrade setuptools or other python setup ralated tools. I know this issue was present and fixed in older builds of HA, but maybe there is still a bug hidden somewhere. "

RobertoCravallo commented 7 months ago

home-assistant_solarfocus_2024-02-19T09-09-09.369Z.log

mleck28 commented 7 months ago

Hello, I can confirm the behavior. The Radio.Browser and Yamaha's MusicCast are also not working for me anymore. Attached are the error messages. HA_Solarfocus_2024-02-19b HA_Solarfocus_2024-02-19a

LavermanJJ commented 7 months ago

Thanks for reporting - I can confirm that I have a similar issue with another integration. I'll look into it

RobertoCravallo commented 7 months ago

I just installed a new HA VM under PROXMOX. From my running system I deinstalled SOLARFOCUS and made a back-up. Installed the back-up in the new VM HA and everything is fine. So I am very sure the problem lies with SOLARFOCUS.

Thank you for your troubles. Hope you find the problem soon!!!

LavermanJJ commented 7 months ago

Thanks for debugging and isolating the problem

RobertoCravallo commented 7 months ago

No problem. This was a pain in the you know where, since the first 2024.2.x update.

Regards from Mannheim, Germany

LavermanJJ commented 7 months ago

@RobertoCravallo would you be able to test the 4.1.0 release, if it fixes the issue for you? https://github.com/LavermanJJ/home-assistant-solarfocus/releases/tag/v4.1.0

RobertoCravallo commented 7 months ago

I can check tomorrow. Regards

RobertoCravallo commented 7 months ago

Looking good!!! As far as I can tell, your update works, it does for me. One small thing: IdAW – Home Assistant 2024-02-22 09-50-16 Door is actually closed, but maybe it just has not sent the new status yet!!

LavermanJJ commented 7 months ago

@mleck28 Can you also confirm? If so, I'd resolve the issue afterwards.

RobertoCravallo commented 7 months ago

War eben im Keller und habe mal die Tür meines Gerätes auf und zu gemacht. No change...

Tür ist seit 4 Stunden "offen"!

mleck28 commented 7 months ago

HA_Yamaha_2024-02-22a

@mleck28 Can you also confirm? If so, I'd resolve the issue afterwards.

Ich kann die fehlerhaften "Integrationen" nicht löschen / I cannot delete the faulty 'integrations'.

RobertoCravallo commented 7 months ago

Geht es jetzt um YAMAHA? Das kannst Du lassen, wird wohl wieder funktionieren, wenn Du SOLARFOCUS neu einspielst.

Einstellungen – Home Assistant 2024-02-22 15-19-18 Zuerst das Teil löschen und dann unter HACS. Neu starten und bei HACS / SOLF dann BETA-Versionen erlauben und die 4.1.0 installieren. HACS – Home Assistant 2024-02-22 15-21-35 Danach lief es bei mir wieder. Nach Installation / Konfiguration der Integration HA neu starten.

mleck28 commented 7 months ago

Vielen Dank für den Hinweis. Bei mir kam automatisch ein Update. Habe aber Solarfocus nun deinstalliert und wieder neu installiert und eingerichtet. Habe nach mehrmaligen Neustarts von HA auch den PI neu gestartet. Bei mir ist der Fehler leider immernoch da: HA_Yamaha_2024-02-22c HA_Yamaha_2024-02-22b

RobertoCravallo commented 7 months ago

Bin mit PROXMOX unterwegs und kenne mich mit den RASPBERRY nicht aus.

Hast Du YAMAHA mal deinstalliert? Nach jeder Installation / Deinstallation würde ich neu starten...

An den lieben LavermanJJ, die "Tür" ist noch immer offen! ;-)

mleck28 commented 7 months ago

Ich kann beides leider nicht deinstallieren. Ich kann zwar den Knopf drücken, aber da passiert nichts. Das ist die Fehlermeldung, die beim Löschen auftritt. HA_Yamaha_2024-02-22d

RobertoCravallo commented 7 months ago

Versuch mal HA im "abgesicherten Modus" hochzufahren.

mleck28 commented 7 months ago

Es hilft leider alles nichts. Habe auch die Solarfocus Integration nochmals gelöscht und neu angelegt. Wenn ich die Yamaha Integration löschen möchte, bekomme ich die folgenden Fehler: HA_Yamaha_2024-02-22e

RobertoCravallo commented 7 months ago

Entwicklerwerkzeuge – Home Assistant 2024-02-22 17-29-13 Du hast HA also so gestartet, richtig? Wenn Du SOLARFOCUS deinstalliert hast, hast Du dann mal versucht YAMAHA los zu werden. Bevor Du SoFo wieder installierts.

mleck28 commented 7 months ago

Das habe ich gemacht und nun auch zur Kontrolle noch einmal.

Gibt es mit der Konsole bzw. Terminal noch ne Möglichkeit diese beiden Integrationen zu löschen?

RobertoCravallo commented 7 months ago

Sorry, da bin ich jetzt leider raus...

LavermanJJ commented 7 months ago

You need to access to /config folder of home-assistant (e.g. via the visual studio code add-on) and browse to custom_components. There you'll find the folder of the integration. Now remove that and restart the overall system. That's how it worked for me.