Code Monkey home page Code Monkey logo

Comments (51)

ollo69 avatar ollo69 commented on June 25, 2024 2

Please try last release, should work properly with Python 3.12 and HA 2024.2

from ha-smartthinq-sensors.

ollo69 avatar ollo69 commented on June 25, 2024 1

Think that I found the issue. Is new versions of PyCountry library that fail to install with Python 3.12. I have fixed this and will be available with next release.

from ha-smartthinq-sensors.

mbalug7 avatar mbalug7 commented on June 25, 2024 1

It works in HA docker container as well. Tnx

from ha-smartthinq-sensors.

ollo69 avatar ollo69 commented on June 25, 2024 1

@mbalug7,

good to know that it works, but my suspect is that there is another integration that force installation of newer pycountry version that cause the problem, and so the result can be random.
If you will have again the issue, you could try to disable other custom integration to try to identify the one that is causing the problem.

from ha-smartthinq-sensors.

RobertoCravallo avatar RobertoCravallo commented on June 25, 2024 1

With todays update to 2024.2.2 it is working again...

Unfortunately not!! Worked and then gone again...

from ha-smartthinq-sensors.

RobertoCravallo avatar RobertoCravallo commented on June 25, 2024 1

Just wanted to let you know, that I found the problem and it was SOLARFOCUS.

This is what I wrote the developer:
"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."

from ha-smartthinq-sensors.

ollo69 avatar ollo69 commented on June 25, 2024

Please check and provide error log

from ha-smartthinq-sensors.

RobertoCravallo avatar RobertoCravallo commented on June 25, 2024

Sorry, not very firm with the LOG thingy, this helpful?

home-assistant_smartthinq_sensors_2024-02-08T08-40-38.299Z.log

from ha-smartthinq-sensors.

ollo69 avatar ollo69 commented on June 25, 2024

Seems that there are something wrong in your env that cause the config flow to not load.
The error is connected to Python 3.12, as reported in this thread: https://stackoverflow.com/questions/77364550/attributeerror-module-pkgutil-has-no-attribute-impimporter-did-you-mean
This is not an integration error but something related to HA environment.
I still do not upgrade HA to last version but I'm already using Python 3.12 from some days without any issue. I will upgrade it later today and report here if it works for me, in the meantime I suggest you to check in HA forum for similar error and possible solution.

from ha-smartthinq-sensors.

mbalug7 avatar mbalug7 commented on June 25, 2024

I got the same problem.
HA 2024.2 docker
Ubuntu Server 22.04
Rollback to 2021.6 version has fixed my issue, so I don't have additional logs (there was some error with pkgutil module), but it should be reproduceable in docker container as well.

from ha-smartthinq-sensors.

RobertoCravallo avatar RobertoCravallo commented on June 25, 2024

Uninstalled LG and reinstalled. Still getting this message.

Settings – Home Assistant 2024-02-08 14-56-48

from ha-smartthinq-sensors.

ollo69 avatar ollo69 commented on June 25, 2024

Again, as I explain at the beginning of this thread this problem is related to outdated version of pip, not the integration. You need to fix this or the config flow will never start.

from ha-smartthinq-sensors.

RobertoCravallo avatar RobertoCravallo commented on June 25, 2024

I reverted to 2024.1.6 and all is well again...

So how do I update PIP?

from ha-smartthinq-sensors.

ollo69 avatar ollo69 commented on June 25, 2024

Depend on the environment that you have. In the link that I provide there are the instruction for venv, I don't know which king of HA envirnoment you re using

from ha-smartthinq-sensors.

RobertoCravallo avatar RobertoCravallo commented on June 25, 2024

I am running HA in a PROXMOX VM.

from ha-smartthinq-sensors.

RobertoCravallo avatar RobertoCravallo commented on June 25, 2024

2024 2: More voice, more icons, more integrations, more  everything! - Blog - Home Assistant Community 2024-02-08 15-44-02

This is what HA moderator has to say about this.

from ha-smartthinq-sensors.

ollo69 avatar ollo69 commented on June 25, 2024

Ok, I will take a deeper look to the version of PYCountry used and if exist new version

from ha-smartthinq-sensors.

RobertoCravallo avatar RobertoCravallo commented on June 25, 2024

Hello ollo69,
perfection, with your update of LG, it is now functioning. My GARMIN integration was also not working, but after your fix, that is now working also. Thank you very much for your work.
Regards from Germany,
Robert

from ha-smartthinq-sensors.

ollo69 avatar ollo69 commented on June 25, 2024

My GARMIN integration was also not working, but after your fix, that is now working also

I do not exactly understand the relation, unless also that integration is using PyCountry (and so should implement same fix that I did).

I close this.

from ha-smartthinq-sensors.

mbalug7 avatar mbalug7 commented on June 25, 2024

It works in HA docker container as well. Tnx

Initially it worked fine (I tried to change the temperature, and it was updated in LG app as well), but then I rebooted my server, and now I have this:

2024-02-09 13:41:51.439 ERROR (MainThread) [homeassistant.loader] Unexpected exception importing platform custom_components.smartthinq_sensors.config_flow
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/loader.py", line 847, in get_platform
    cache[full_name] = self._import_platform(platform_name)
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/loader.py", line 864, in _import_platform
    return importlib.import_module(f"{self.pkg_path}.{platform_name}")
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/importlib/__init__.py", line 90, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<frozen importlib._bootstrap>", line 1387, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1360, in _find_and_load
  File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 935, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 994, in exec_module
  File "<frozen importlib._bootstrap>", line 488, in _call_with_frames_removed
  File "/config/custom_components/smartthinq_sensors/config_flow.py", line 9, in <module>
    from pycountry import countries as py_countries, languages as py_languages
  File "/usr/local/lib/python3.12/site-packages/pycountry/__init__.py", line 10, in <module>
    import pkg_resources
  File "/usr/local/lib/python3.12/site-packages/pkg_resources/__init__.py", line 2191, in <module>
    register_finder(pkgutil.ImpImporter, find_on_path)
                    ^^^^^^^^^^^^^^^^^^^
AttributeError: module 'pkgutil' has no attribute 'ImpImporter'. Did you mean: 'zipimporter'?
2024-02-09 13:41:51.441 ERROR (MainThread) [homeassistant.config_entries] Error importing platform config_flow from integration smartthinq_sensors to set up smartthinq_sensors configuration entry: Exception importing custom_components.smartthinq_sensors.config_flow

EDIT:
I restarted it again several times, and now it works without any error.

from ha-smartthinq-sensors.

RobertoCravallo avatar RobertoCravallo commented on June 25, 2024

You where right, the problem is back as of today. I did not install or update anything, but still...

from ha-smartthinq-sensors.

ollo69 avatar ollo69 commented on June 25, 2024

You where right, the problem is back as of today. I did not install or update anything, but still...

Because you said that my change also fix Garmin integration, you could try to disable that to see if it is the cause.

from ha-smartthinq-sensors.

RobertoCravallo avatar RobertoCravallo commented on June 25, 2024

I disabled GARMIN, no change. Uninstalled GARMIN, no change. For me, LGE-Sensors is still not working...

from ha-smartthinq-sensors.

ollo69 avatar ollo69 commented on June 25, 2024

Try disabling also other integration, quite sure that this is not an issue on this integration.
Eventually, if you can open a terminal on your HA server, try to run the command pip show pycountry and report here the returned values.

from ha-smartthinq-sensors.

RobertoCravallo avatar RobertoCravallo commented on June 25, 2024

Terminal – Home Assistant 2024-02-11 17-20-19

from ha-smartthinq-sensors.

ollo69 avatar ollo69 commented on June 25, 2024

Uhm, quite strange that pycountry is not installed at all. And if you install it with command pip install pycountry<23.0.0,>=22.1.10 and that reboot HA? This could solve the issue...

from ha-smartthinq-sensors.

RobertoCravallo avatar RobertoCravallo commented on June 25, 2024

Terminal – Home Assistant 2024-02-11 17-32-25
Guess I am doing something wrong. I am using the HA TERMINAL.

image

https://www.home-assistant.io/faq/pip/

from ha-smartthinq-sensors.

ollo69 avatar ollo69 commented on June 25, 2024

pip install pycountry"<23.0.0,>=22.1.10"

from ha-smartthinq-sensors.

RobertoCravallo avatar RobertoCravallo commented on June 25, 2024

That worked...
Terminal – Home Assistant 2024-02-11 17-46-12
Rebooted HA, no change. Reinstalled SmartThinQ LGE Sensors, no change.

from ha-smartthinq-sensors.

ollo69 avatar ollo69 commented on June 25, 2024

Uhm, I suspect that HA is running inside a venv, so you are not installing in the right place. You must understand how to activate the correct venv and perform the same check inside it.

from ha-smartthinq-sensors.

RobertoCravallo avatar RobertoCravallo commented on June 25, 2024

HA is running in a PROXMOX VM. I'm an old guy (68) and am just a user. I guess I will just wait and see what happens. I am very surprised, that there are not more people that have this problem. Thank you for your time!!!

from ha-smartthinq-sensors.

mbalug7 avatar mbalug7 commented on June 25, 2024

I executed the following commands inside my HA docker container: https://stackoverflow.com/a/77364602

Now it works after every reboot. Since I have dockerized version of Home Assistant, I would expect that all changes I make in the Docker container disappear after a restart, but for some reason it works.

Currently, I really don't have time to delve deeper into this, but after I implemented the suggestions provided in the Stack Overflow answer, things started working correctly.

from ha-smartthinq-sensors.

RobertoCravallo avatar RobertoCravallo commented on June 25, 2024

.. unfortunately, my knowledge is nowhere close to even try to implement this!!!

from ha-smartthinq-sensors.

mbalug7 avatar mbalug7 commented on June 25, 2024

.. unfortunately, my knowledge is nowhere close to even try to implement this!!!

try to run these commands in terminal here:
image

from ha-smartthinq-sensors.

RobertoCravallo avatar RobertoCravallo commented on June 25, 2024

That is my screenshot... Did not work.

from ha-smartthinq-sensors.

mbalug7 avatar mbalug7 commented on June 25, 2024

That is my screenshot... Did not work.

yes, I just used is as a reference to show where to run the commands from stack overflow answer.
Have you tried to reboot?
As I said, I don't know why it works now for me, but it just does.
Also, I think I reinstalled this integration as a last step before reboot:

  • I removed custom_components/smartthinq_sensors directory and installed it again with HACS, so that might be the step that actually fixed my problem

from ha-smartthinq-sensors.

ollo69 avatar ollo69 commented on June 25, 2024

Sorry but I really have no idea on what could be the problem. I have Python 3.12 and HA 2024.2.1 and everything work properly.

@RobertoCravallo,

are you sure that the problem is the same reported at beginning of this thread? As last option you could try to install the native component Radio Browser that should force installation of right version of pycountry

from ha-smartthinq-sensors.

ollo69 avatar ollo69 commented on June 25, 2024

I reopen this issue, let's see if others have same issue.

from ha-smartthinq-sensors.

upthinkweb avatar upthinkweb commented on June 25, 2024

Have the same issue. Running on HASSOS/VM on TrueNAS Scale.

from ha-smartthinq-sensors.

RobertoCravallo avatar RobertoCravallo commented on June 25, 2024

Settings – Home Assistant 2024-02-12 07-14-55

Trying to load radio browser I get this. Maybe my whole HA is broken somehow!!

I had radio browser installed before the HA update and it was broke after....

e16f12ab9297fe8923842d64afe6d3bdbd689a94

from ha-smartthinq-sensors.

ollo69 avatar ollo69 commented on June 25, 2024

I suggest you to disable all custom integration and try again. If still doesn't work, you can ask support to HA team because this is a native integration. But probably something is broken in your HA installation.

from ha-smartthinq-sensors.

RobertoCravallo avatar RobertoCravallo commented on June 25, 2024

Very, very strange. I installed HA on PROXMOX and then installed my back-up. After all was said and done, the error is gone. After restarting HA, it is back.... I am going crazy!!!!

I set up HA from scratch and started adding add-ons. All was well for hours and then it was not. The error is back. LQ does not like something, do not know hat. Went back and uninstalled one add-on at a time and did a boot (PROXMOX). I guess once the error shows, nothing seems to make it go away.

from ha-smartthinq-sensors.

countrock avatar countrock commented on June 25, 2024

Mine was broken! But it's fixed now by itself! Not sure what fixed it!

from ha-smartthinq-sensors.

RobertoCravallo avatar RobertoCravallo commented on June 25, 2024

I have a integration that is called TANKERKÖNIG (checks gasoline prices) which gives me a "internal server 500 error" most of the day. In the morning, it works just fine. Still have not figured out why this is so. Maybe it does not like a HA restart / boot?

I am hoping, just as it happened for countrock, that it will go away by itself at some point...

from ha-smartthinq-sensors.

ollo69 avatar ollo69 commented on June 25, 2024

So at the end was not integration issue.😉.
I suppose that some library used by HA was causing the issue and in last update this has been fixed.
I close this, hoping that this issue do not come back again.

from ha-smartthinq-sensors.

ollo69 avatar ollo69 commented on June 25, 2024

@RobertoCravallo ,

good catch!
May be this should also be sent to the attention of HA team. They should not allow to break some functionality (included native integration) due to a custom integration.

from ha-smartthinq-sensors.

FreyrPL avatar FreyrPL commented on June 25, 2024

Hi,
With HA Core update 2024.2.4 everything is back to normal. Addon works as it should ;)

from ha-smartthinq-sensors.

pcartwright81 avatar pcartwright81 commented on June 25, 2024

Updated to 2024.4.0.dev20240319 and the issue is back. I'm using Home Assistant Operating System 12.2.dev20240313.
I have tried the following:
Reinstalled Smarthinq Sensors
Installing Radio Browser
From the logs 2024-03-19 23:07:27.676 ERROR (SyncWorker_1) [homeassistant.util.package] Unable to install package pycountry<23.0.0,>=22.1.10: ERROR: Cannot install pycountry<23.0.0 and >=22.1.10 because these package versions have conflicting dependencies.

Looking at the screenshots above, wouldn't we need to be inside of the docker container that core is running in to install pycountry?

from ha-smartthinq-sensors.

FreyrPL avatar FreyrPL commented on June 25, 2024

Problem is back. The thing is, after updating HA core to next version problem is gone untill HA restart. After restart problem is back untill next core update. Looks like some dependencies regarding 'pycountry ' are being reinstalled every restart.
I have no clue how to resolve this.

from ha-smartthinq-sensors.

pcartwright81 avatar pcartwright81 commented on June 25, 2024

This is being tracked in issue 725. I edited manifest.json at the location \\homeassistant.local\config\homeassistant\custom_components\smartthinq_sensors to say pycountry>23.0.0 and it seems to be working now. The version has to be greater than 23.0.0 for the new beta versions.

from ha-smartthinq-sensors.

nickrout avatar nickrout commented on June 25, 2024

Home assistant seems to have constrained pycountry to >23.12.11 two weeks ago.

home-assistant/core@f3984a9

This custom integration constrains pycountry to pycountry<23.0.0,>=22.1.10

You can't be >23.12.11 and <23.0.0. I suspect that is the problem.

from ha-smartthinq-sensors.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.