jobvk / Home-Assistant-Windcentrale

Provides Home Assistant sensors for multiple wind turbines from the Windcentrale
https://jobvankoeveringe.com/projects/windcentrale/
Apache License 2.0
14 stars 3 forks source link

Id in live url is sometimes different from the windmill id #22

Closed blieven1 closed 2 years ago

blieven1 commented 2 years ago

Checklist

The problem

I noticed I didn't get complete data for the Boerenzwaluw.

Apperently the id is 191 so the main url is : https://zep-api.windcentrale.nl/production/191 but the live url is https://zep-api.windcentrale.nl/production/201/live for some reason

https://zep-api.windcentrale.nl/production/201 looks like it gives the same data as https://zep-api.windcentrale.nl/production/191 so maybe it's just an update from 191 tot 201 as the id.

complete list: https://github.com/damonnk/windcentrale/blob/master/molens.xml

What is version of Home Assistant Core did you recieve the bug?

2022.6.4

What is version of Home Assistant Supervisor did you recieve the bug?

None

What is version of Home Assistant Supervisor?

2022.6.4

What is version of the Windcentrale integration?

1.4

Example Code snippet

No response

Anything in the logs that might be useful for us?

No response

Additional information

No response

blieven1 commented 2 years ago

Verified with the data on https://mijnmolen.windcentrale.nl/#/

Boerenzwaluw should have 201 as the id

jobvk commented 2 years ago

I made a beta release, please check if in this beta the problem still occurs.

You update to this beta through HACS

blieven1 commented 2 years ago

Hi, It is working.

I also tried yesterday evening by just changing the id from 191 tot 201 in https://github.com/jobvk/Home-Assistant-Windcentrale/blob/c3490e4352b80bd0cfc92b356b4df0df69415173/custom_components/windcentrale/const.py#L39

"De Boerenzwaluw": [201, "Enercon", "E-44", "Burum", 53.265376, 6.214152, dt.datetime(2016, 8, 1)],

Maybe that's a cleaner solution than having the if statement :)

Kind regards, Bjorn

jobvk commented 2 years ago

Yes, it would be nicer. But the problem is there are two API's working for production data:

And the problem is the data is a little bit different.

Also the news api uses the id of 191 image So if i change the id of the windturbine to 201 the news filter doesn't work anymore

blieven1 commented 2 years ago

Ok, thanx, didn't know about the news feed.

Great work!