Comments (13)
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.
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.
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.
Mine has just started working again as well, but it did take about an hour after re adding integration.
from ha-hildebrandglow-dcc.
Please see here: https://community.home-assistant.io/t/hildebrandglow-smart-meters-smets2/267603/77
from ha-hildebrandglow-dcc.
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.
@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.
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.
Unfortunately mine didn't refresh the token correctly after a week. Same error.
from ha-hildebrandglow-dcc.
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.
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.
I now have the reconnection working both on restart and “in flight”.
The pull request above (#39)
from ha-hildebrandglow-dcc.
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)
- sensor state class 'total_increasing' is invalid for 'monetary' values HOT 1
- No gas usage since 28th March HOT 23
- Is this integration working at all these days for anyone. HOT 19
- Update of pyglowmarkt to 0.5.5 broke ha-hildebrandglow-dcc due to change of timezone handling HOT 18
- Handling of data update delay via DCC is broken HOT 2
- Feed through from Bright HOT 10
- Usage Today doesn't reset at midnight
- Implement rounding support
- Add support for non-cummulated kWh
- Cannot even get it installed or intergrated now HOT 3
- Multiple Sites in bright app, way to select which one to use HOT 1
- Integration No Longer Working HOT 1
- Release v1.0.4 HOT 6
- Only getting data for parts of the day HOT 11
- No or Incomplete Data showing in Home Assistant HOT 8
- Support for two rate meters
- Readings obtained twice in six minutes
- Suggestion: Delay readings to get accurate data HOT 1
- Glow MQTT platform not found with Core 2023.9.2
- Gas usage showing unknown HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ha-hildebrandglow-dcc.