Giter VIP home page Giter VIP logo

Comments (13)

googanhiem avatar googanhiem commented on May 23, 2024 1

I've been looking at the code and @ColinRobbins is right, its an issue with handle_failed_auth, it looks like its having an issue getting or updating the config_entries information.

This error will happen to everyone using this weekly, as the token has a 7 day expiry on it.

Waiting a bit, deleting the integration and re-adding it is the current workaround (showing the current auth system isn't at fault, its just the reauth calls that aren't working).

from ha-hildebrandglow-dcc.

danmed avatar danmed commented on May 23, 2024

I'm also seeing this.. I've removed and re-added and i'm getting the below in the logs :

2021-08-31 10:55:07 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up hildebrandglow_dcc platform for sensor Traceback (most recent call last): File "/config/custom_components/hildebrandglow_dcc/sensor.py", line 33, in async_setup_entry resources = await hass.async_add_executor_job(glow.retrieve_resources) File "/usr/local/lib/python3.9/concurrent/futures/thread.py", line 52, in run result = self.fn(*self.args, **self.kwargs) File "/config/custom_components/hildebrandglow_dcc/glow.py", line 78, in retrieve_resources raise InvalidAuth custom_components.hildebrandglow_dcc.glow.InvalidAuth During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 249, in _async_setup_platform await asyncio.shield(task) File "/config/custom_components/hildebrandglow_dcc/sensor.py", line 36, in async_setup_entry await Glow.handle_failed_auth(config, hass) TypeError: handle_failed_auth() missing 1 required positional argument: 'hass'

from ha-hildebrandglow-dcc.

danmed avatar danmed commented on May 23, 2024

Interestingly, mine has just started working again...

I removed the integration and re-added it and after abotu 5 minutes it seems to be working again.

from ha-hildebrandglow-dcc.

incarvr6 avatar incarvr6 commented on May 23, 2024

Mine has just started working again as well, but it did take about an hour after re adding integration.

from ha-hildebrandglow-dcc.

HandyHat avatar HandyHat commented on May 23, 2024

Please see here: https://community.home-assistant.io/t/hildebrandglow-smart-meters-smets2/267603/77

from ha-hildebrandglow-dcc.

ColinRobbins avatar ColinRobbins commented on May 23, 2024

I'm seeing this issue too. It seems after a while the authentication times out.
Removing and re-installing the integration seems to fix it.

from ha-hildebrandglow-dcc.

ColinRobbins avatar ColinRobbins commented on May 23, 2024

@googanhiem, @HandyHat I think I have implemented a fix.
In custom_components/hildebrandglow_dcc/glow.py I changed

     async def handle_failed_auth(self, config: ConfigEntry, hass: HomeAssistant) -> None: 

to

      @classmethod
      async def handle_failed_auth(cls, config: ConfigEntry, hass: HomeAssistant) -> None:

and restarted home assistant.
Seems to be working.

Need to wait a week, for it to time out again, and see if it automatically reconnects.
If all goes well, I’ll make a pull request on the github repro in a week or two.
(ColinRobbins@1c22d55#diff-44afaf6cb9c1f06d1df29362986d19bdf271a91551603ddf8ee3fda4781f1f9b)

from ha-hildebrandglow-dcc.

googanhiem avatar googanhiem commented on May 23, 2024

Looks good. You could test it by changing the token expiry in the configentries file (it's in .storage).
I'll try it tonight.

from ha-hildebrandglow-dcc.

googanhiem avatar googanhiem commented on May 23, 2024

Unfortunately mine didn't refresh the token correctly after a week. Same error.

from ha-hildebrandglow-dcc.

ColinRobbins avatar ColinRobbins commented on May 23, 2024

Same here, but a slightly different error (getting a 404 error, not a 401).
With a simple restart of hass it re authenticated OK.
I’ve made another modification to handle the 404 error.
See you here same time next week to see if that works!

from ha-hildebrandglow-dcc.

ColinRobbins avatar ColinRobbins commented on May 23, 2024

Looking at the code, I think there is an issue with updating the "glow" instance in the running sensor.
I've tried a fix...
main...ColinRobbins:main
Will see what happens next time fails.
Some the logging will need removing in time.

from ha-hildebrandglow-dcc.

ColinRobbins avatar ColinRobbins commented on May 23, 2024

I now have the reconnection working both on restart and “in flight”.
The pull request above (#39)

from ha-hildebrandglow-dcc.

chesterflaps avatar chesterflaps commented on May 23, 2024

I have had this integration for a few weeks and not once has it given the correct data. Always saying I have used around 0.50kwh per day. I wish!

from ha-hildebrandglow-dcc.

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.