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

Error while setting up mindergas platform #3

Open
olafvs opened this issue Mar 7, 2021 · 9 comments
Open

Error while setting up mindergas platform #3

olafvs opened this issue Mar 7, 2021 · 9 comments

Comments

@olafvs
Copy link

olafvs commented Mar 7, 2021

Hey,

Trying to set this up, bumping into this error:

2021-03-07 20:01:45 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up mindergas platform for sensor
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 200, in async_setup_platform
await asyncio.shield(task)
File "/usr/local/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
File "/config/custom_components/mindergas/sensor.py", line 35, in setup_platform
add_entities([GasPrognose(username, password, name)], True)
File "/config/custom_components/mindergas/sensor.py", line 47, in init
self.update()
File "/config/custom_components/mindergas/sensor.py", line 109, in update
div = data.find_all("div", class
="table_cell")[9]
IndexError: list index out of range

I only have two entries in mindergas. Maybe this has something to do with it? When I go into the site itself it also mensions this:

Prognose gasverbruik 2021
Er zijn te weinig verbruiksgegevens of het energieverbruik voor verwarming is te laag om een prognose te kunnen geven.

I guess the code needs an extra line or two.

One more thing. In the installation guide underneath Manual Installation you mention:

In the custom_components directory (folder) create a new folder called ziggonext.

I guess it shouldn't be ziggonext ;)

Thanks and keep up the good work.

@nelbs
Copy link
Owner

nelbs commented Mar 7, 2021

Thanks you are right about the ziggonext 😄

Because there isn't a prognose available in your case the script cant scrape it and throws an error. If i have time I will add some error handling. So I think you have to keep upload your energy consumption to mindergas so it will calculate your prognose.

@olafvs
Copy link
Author

olafvs commented Mar 7, 2021

Thanks. I don't know how many entries it needs, can't find anything on the site about it. Anyway it's good for other people to know this in case they bump into the same problem.

@olafvs
Copy link
Author

olafvs commented May 7, 2021

Hi still no go. So I guess it needs maybe a year of data.

I felt lucky and commented out line 35 of sensor.py in the mindergas directory:

#add_entities([GasPrognose(username, password, name)], True)

Now I can use the component. This is not a perfect solution but I can use it. Just for reference of other people having the same issue.

@nelbs
Copy link
Owner

nelbs commented May 7, 2021

Thats strange, do you see the prognose in the dashboard on mindergas?

@olafvs
Copy link
Author

olafvs commented May 7, 2021

No I don't, it's says not enough data.

@nelbs
Copy link
Owner

nelbs commented May 8, 2021

Okay, then you will have to upload more frequently I guess. I do this once a day (automatically of course :)) and I never had problems to calculate the prognose.

@olafvs
Copy link
Author

olafvs commented May 8, 2021

Did you have a progonose the first year? I started 3 months ago.

@nelbs
Copy link
Owner

nelbs commented May 8, 2021

Yes as far i can remember i have

@Squixx
Copy link
Contributor

Squixx commented Dec 11, 2021

I still don't have a prognose.

However if you wrap the parsing in a try catch block it'll work just fine. See
#5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants