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

logi_circle_legacy is no longer working with hassio 0.94 #5

Open
Obicom opened this issue Jun 8, 2019 · 36 comments
Open

logi_circle_legacy is no longer working with hassio 0.94 #5

Obicom opened this issue Jun 8, 2019 · 36 comments
Labels
help wanted Extra attention is needed

Comments

@Obicom
Copy link

Obicom commented Jun 8, 2019

First of all thank you that you created the legacy custom component. This was realy helpful for me. Unfortunately the custom component is no longer working since I have updated to hassio 0.94. Do you have any advice how I can fix that?

image

@evanjd
Copy link
Owner

evanjd commented Jun 8, 2019

Someone reported a similar issue and solved it by reconfiguring HA to trust docker's internal network: #4

Is this relevant to you? If not I'll update and see if I can reproduce.

@Obicom
Copy link
Author

Obicom commented Jun 8, 2019

The errors in my log file are the same but where I have to add the lines? If I did that on the end of my configuration.yaml I get an system error:

image

@evanjd
Copy link
Owner

evanjd commented Jun 8, 2019

@Obicom They belong to the http platform: https://www.home-assistant.io/components/http/

eg.

http:
  auth_providers:
    - type: trusted_networks
  trusted_networks:
    - 172.16.0.0/12

@Obicom
Copy link
Author

Obicom commented Jun 8, 2019

Now I found the right place ans syntax but unfortunately it doesn't help in my case :(

image

image

@Obicom
Copy link
Author

Obicom commented Jun 8, 2019

Ok, I treid it here as shown in HA manual:

https://www.home-assistant.io/docs/authentication/providers/

I will try it again with http:

@evanjd
Copy link
Owner

evanjd commented Jun 8, 2019

Are you using docker? Have you changed the trusted network to align with your internal network?

@Obicom
Copy link
Author

Obicom commented Jun 8, 2019

Yes I use docker (hassio) With http: I got again a system config error:

image

image

@evanjd
Copy link
Owner

evanjd commented Jun 8, 2019

My bad, missed the deprecation notice. Your config looks right, assuming the IP range you specified actually matches your internal docker network.

@Obicom
Copy link
Author

Obicom commented Jun 8, 2019

To be honest I do not know the right IP address for this "hack". I tried it know again with the given example:
image

Config check is know ok ... but after a restart the same issue and no success.
It would be great and really kind if you could check it on your dev system if you can reproduce the problem and find a fix for that. If I can help with additional information please let me know. Thank you very much in advance.

@evanjd
Copy link
Owner

evanjd commented Jun 8, 2019

Upgraded my dev env to 0.94.1 - works fine. (I use a venv)

I just pushed a commit to fix the broken error handler - pull that in and you should get a more meaningful error. But this sounds like a hass.io or local network issue, not a problem with this component.

@Obicom
Copy link
Author

Obicom commented Jun 8, 2019

What should I pull in to get a more meaningful error?

@Obicom
Copy link
Author

Obicom commented Jun 8, 2019

Is this nothing to work with it?

image

@Obicom
Copy link
Author

Obicom commented Jun 8, 2019

here all I could found in my log file:

Traceback (most recent call last):
File "/config/custom_components/logi_circle_legacy/init.py", line 40, in async_setup
from logi_circle import Logi
ImportError: cannot import name 'Logi' from 'logi_circle' (/usr/local/lib/python3.7/site-packages/logi_circle/init.py)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/setup.py", line 153, in _async_setup_component
hass, processed_config)
File "/config/custom_components/logi_circle_legacy/init.py", line 53, in async_setup
except (BadLogin, ClientResponseError) as ex:
UnboundLocalError: local variable 'BadLogin' referenced before assignment

@evanjd
Copy link
Owner

evanjd commented Jun 8, 2019

What should I pull in to get a more meaningful error?

The updated component that I pushed to this repo.

@Obicom
Copy link
Author

Obicom commented Jun 8, 2019

I installed it and restarted hassio. This is the outcome from my log file in regards of logi circle:

Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 357, in _async_add_entity
raise HomeAssistantError(msg)
homeassistant.exceptions.HomeAssistantError: Entity id already exists: calendar.contacts
2019-06-08 16:19:54 WARNING (MainThread) [homeassistant.components.sensor] Setup of platform command_line is taking over 10 seconds.
2019-06-08 16:20:34 ERROR (MainThread) [homeassistant.setup] Error during setup of component logi_circle_legacy
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/setup.py", line 153, in _async_setup_component
hass, processed_config)
File "/config/custom_components/logi_circle_legacy/init.py", line 39, in async_setup
from logi_circle import Logi
ImportError: cannot import name 'Logi' from 'logi_circle' (/usr/local/lib/python3.7/site-packages/logi_circle/init.py)

@evanjd
Copy link
Owner

evanjd commented Jun 8, 2019

The logi circle pypi package is missing. This is downloaded by HA on startup prior to initialising the platform.

Check the full log and see if there was an attempt to download the logi_circle package during startup. Also make sure you haven’t configured the built-in logi_circle integration, only configuration for the logi_circle_legacy platform should be present.

@Obicom
Copy link
Author

Obicom commented Jun 9, 2019

All preconditions are fulfilled: "Also make sure you haven’t configured the built-in logi_circle integration, only configuration for the logi_circle_legacy platform should be present."

I did to the the update to hassio 0.94.1 and was hoping that this fix my issue but unfortunately the same problem. Enclosed all error from my log file:

2019-06-09 10:04:56 ERROR (MainThread) [homeassistant.setup] Error during setup of component logi_circle_legacy
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/setup.py", line 153, in _async_setup_component
hass, processed_config)
File "/config/custom_components/logi_circle_legacy/init.py", line 39, in async_setup
from logi_circle import Logi
ImportError: cannot import name 'Logi' from 'logi_circle' (/usr/local/lib/python3.7/site-packages/logi_circle/init.py)
2019-06-09 10:05:52 ERROR (MainThread) [homeassistant.setup] Unable to prepare setup for platform logi_circle_legacy.sensor: Unable to set up component.

2019-06-09 10:06:51 ERROR (MainThread) [homeassistant.setup] Unable to prepare setup for platform logi_circle_legacy.camera: Unable to set up component.
2019-06-09 10:06:54 ERROR (MainThread) [homeassistant.core] Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 225, in async_update_ha_state
self._async_write_ha_state()
File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 255, in _async_write_ha_state
attr.update(self.state_attributes or {})

@evanjd
Copy link
Owner

evanjd commented Jun 9, 2019

Same error as yesterday, so the same advice applies:

The logi circle pypi package is missing. This is downloaded by HA on startup prior to initialising the platform.

Check the full log and see if there was an attempt to download the logi_circle package during startup. Also make sure you haven’t configured the built-in logi_circle integration, only configuration for the logi_circle_legacy platform should be present.

When the pypi package is downloaded, you'll see a message in your log like:

2019-06-09 20:39:17 INFO (SyncWorker_8) [homeassistant.util.package] Attempting install of logi_circle==0.1.7

If it succeeds, there's no further log. If it fails, the subsequent message should provide a clue to your problem.

@Obicom
Copy link
Author

Obicom commented Jun 9, 2019

But how can I force HA to download the missing package? I guess easiest way for me would be to go back to version 0.93.2 ... that was the last one was worked properly ...

@Obicom
Copy link
Author

Obicom commented Jun 9, 2019

Now I am back on 0.93.2 and all working fine ... therefore I would say it has nothing to do with my configuration.

@evanjd
Copy link
Owner

evanjd commented Jun 10, 2019

But how can I force HA to download the missing package?

You don't - but diagnosing why HA isn't downloading the package might reveal the root cause.

Now I am back on 0.93.2 and all working fine ... therefore I would say it has nothing to do with my configuration.

I can't reproduce your problem on 0.94.1 (I have recreated my env from scratch to make sure), so I can't help you any further unless you follow the advice I have already provided:

Check the full log and see if there was an attempt to download the logi_circle package during startup. Also make sure you haven’t configured the built-in logi_circle integration, only configuration for the logi_circle_legacy platform should be present.

Also note in my previous comment where I gave you an example of what the log entry looks like.

@nenadmilano
Copy link

Hello! unfortunately i face this issue again after updating from 0.94.0 to 0.94.3.
Error:
Error during setup of component logi_circle_legacy Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/setup.py", line 153, in _async_setup_component hass, processed_config) File "/config/custom_components/logi_circle_legacy/__init__.py", line 39, in async_setup from logi_circle import Logi ImportError: cannot import name 'Logi' from 'logi_circle' (/usr/local/lib/python3.7/site-packages/logi_circle/__init__.py)

@Obicom
Copy link
Author

Obicom commented Jun 14, 2019

For me the same issue since hassio update 0.94.0 .... so I did a downgrade to 0.93.2. In this version it works last time for me.

@evanjd
Copy link
Owner

evanjd commented Jun 14, 2019

I really need answers to the questions I've asked to help you. I'll summarise them again:

  • What messages if any are you seeing in your log during HA startup when it downloads the logi_circle package from pypi? You should see:
2019-06-09 20:39:17 INFO (SyncWorker_8) [homeassistant.util.package] Attempting install of logi_circle==0.1.7
  • Have you made sure that you haven't defined configuration for logi_circle and logi_circle_legacy in your configuration.yaml?

And a question for @nenadmilano: how are you using HA? via hass.io or a docker image?

@Obicom
Copy link
Author

Obicom commented Jun 14, 2019

I have devently only defined configuration for logi_circle_lagacy and NO logi_circle in my configuration.yaml

@evanjd
Copy link
Owner

evanjd commented Jun 14, 2019

I have devently only defined configuration for logi_circle_lagacy and NO logi_circle in my configuration.yaml

And my first question?

  • What messages if any are you seeing in your log during HA startup when it downloads the logi_circle package from pypi? You should see:
2019-06-09 20:39:17 INFO (SyncWorker_8) [homeassistant.util.package] Attempting install of > logi_circle==0.1.7

@Obicom
Copy link
Author

Obicom commented Jun 14, 2019

Currently I cant't say .. I am back to 0.93.2 but I will check it this evening after worktime ... maybe @nenadmilano can answer quicker

@evanjd
Copy link
Owner

evanjd commented Jun 14, 2019

Currently I cant't say .. I am back to 0.93.2 but I will check it this evening after worktime ... maybe @nenadmilano can answer quicker

Cool, thanks. If @nenadmilano reports being on hass.io as well, I'll see if I can run it on something and test there too. I've tested on docker + venv with no issue.

@nenadmilano
Copy link

i'm running a docker install and used this quide: https://community.home-assistant.io/t/hass-io-via-docker/60720/19?u=tiagoroxo
i will try to get the log entry that you requested but since i moved back to 0.94.0 it will take some time (@work now)

@nenadmilano
Copy link

Ok so i updated to 0.94.3 again and tried to find the log entry that you mentioned but something like that is not shown. The only mention of logi is mentioned in the following error:

2019-06-14 23:09:09 ERROR (MainThread) [homeassistant.setup] Error during setup of component logi_circle_legacy
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/setup.py", line 153, in _async_setup_component
    hass, processed_config)
  File "/config/custom_components/logi_circle_legacy/__init__.py", line 39, in async_setup
    from logi_circle import Logi
ImportError: cannot import name 'Logi' from 'logi_circle' (/usr/local/lib/python3.7/site-packages/logi_circle/__init__.py)

I can't find something like Attempting install of > logi_circle==0.1.7 when i restart the docker container.

@nenadmilano
Copy link

So i did a little bit of testing right now. I set up a new Ubuntu 18.04 server VM and installed hassio & Home Assistant 0.94.3 from scratch using this GUIDE
Afterwards I installed your addon but i get exactly the same error as in my production environment.
For comparism i also set up an additional Ubuntu server and installed the VENV variant with the latest home assistant and also installed the addon - works like a charm.

So it must have something to do with docker & hassio and home assistant above 0.94.0

@evanjd
Copy link
Owner

evanjd commented Jun 20, 2019

I think I know what’s going wrong. I just re-read the release notes for 0.94 and noticed this:

We have been working hard on improving Hass.io builds...
With Python wheels, we will build all the requirements of integrations ahead of time, and so a new version of Home Assistant is now just putting pieces together.

If this means what I think it does, that means the dependencies for the official logi_circle integration is now baked into the image. If that’s the case, the logi_circle_legacy integration will be importing the public API-based version of the Logi Circle API, rather than the older private one.

A simple fix would be to republish the old logi API wrapper under a new name so that it doesn’t conflict with the official integration. When I get some time I’ll do this and prompt you both to test it and try again.

@Obicom
Copy link
Author

Obicom commented Jun 20, 2019

That sounds good evanjd .... please let me know if I can test ... I would be really grateful if the issue would be fixed.

@Obicom
Copy link
Author

Obicom commented Jul 1, 2019

Is there any update in regards to the issue?

@evanjd evanjd added the help wanted Extra attention is needed label Jul 3, 2019
@evanjd
Copy link
Owner

evanjd commented Jul 3, 2019

Sorry, no meaningful update, have had very little spare time.

I will fix it when I can, but I really don't want to support this unofficial workaround long-term. Have you had any success getting an API key from Logitech? I know you were concerned about exposing your HA instance externally, but I've updated the docs with an outline of how you get around that.

@r4nt
Copy link

r4nt commented Dec 3, 2022

Given that logitech isn't handing out API keys any more, is there anything I can do to help get this running?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants