briis / hass-weatherflow

Home Assistant Integration for WeatherFlow Stations
MIT License
68 stars 11 forks source link

Configuration of the Integration #18

Closed ciairmi closed 2 years ago

ciairmi commented 2 years ago

Hi, I've installed WeatherFlow Weather for Home Assistant through Hacs on my Raspberry Pi 4B. I've got my personal token from https://tempestwx.com/settings/tokens. After configuring a web station, I get the error "Nuovo tentativo di configurazione: 'obs'" that in English seams to be something like "New configuration attempt: 'obs'" or "Re-attempt to configure: 'obs'. Can you help me solving that issue, please? Thanks bye

Schermata 2021-12-20 alle 18 39 10 "

briis commented 2 years ago

It is hard to say what exactly is wrong. Is there anything in the Home Assistant Log file? Could you give me your Station ID, and I will try and check the data for your station.

ciairmi commented 2 years ago

I've found that log: " Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 187, in _async_refresh self.data = await self._async_update_data() File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 147, in _async_update_data return await self.update_method() File "/config/custom_components/weatherflow/init.py", line 108, in async_update_data data: ObservationDescription = await weatherflowapi.update_observations() File "/usr/local/lib/python3.9/site-packages/pyweatherflowrest/api.py", line 202, in update_observations obervations: dict = data['obs'][0] KeyError: 'obs' Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 187, in _async_refresh self.data = await self._async_update_data() File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 147, in _async_update_data return await self.update_method() File "/config/custom_components/weatherflow/init.py", line 108, in async_update_data data: ObservationDescription = await weatherflowapi.update_observations() File "/usr/local/lib/python3.9/site-packages/pyweatherflowrest/api.py", line 202, in update_observations obervations: dict = data['obs'][0] KeyError: 'obs' "

Station ID: Milan, Piazza dei Daini, 32613 Milano, Via Friuli GASJ, 39572

Thanks so much Andrea

briis commented 2 years ago

Thanks Andrea. The Station id is only a number, which you can see if you go here https://tempestwx.com/settings/stations and then click on your station. The station id will then be the number that shows after the last / in url. F.ex. my line looks like this:

https://tempestwx.com/settings/station/2777

So my station id is 2777. This is the number you must use in station id when you set up the Integration:

Skærmbillede 2021-12-20 kl  19 24 55

Is that how you set it up?

ciairmi commented 2 years ago

Yes of course, just the id number and the Personal Api Token

briis commented 2 years ago

Good. Can you write the number here, then I can check the data

briis commented 2 years ago

Or is it one of the two numbers in the address?

ciairmi commented 2 years ago

32613 or 39572

briis commented 2 years ago

Got it, thanks. I will check in the morning.

briis commented 2 years ago

I just released V0.1.17 and tried loading both your stations. This now works fine at my end. Could you test it, and report back?

ciairmi commented 2 years ago

Hi briis and thanks for your support. Unfortunatelly, even after the update of the package in Hacs, even after some reboot, even after deleting the integration - re-booting - re-adding the integration, the result is always the same. Still the same error

briis commented 2 years ago

There is something wrong with your stations or the hub. This morning both stations worked, and I got data fine. When I try it now the station Piazza dei Daini works but the other station gives this error:

Config entry 'Via Friuli GASJ' for weatherflow integration not ready yet: Error while retreiving data: Empty dataset returned from WeatherFlow. Make sure the station is online.; Retrying in background

This tells that the data returned from WeatherFlow is either empty or does not contain a full set of data, that is needed and this happens typical when there is some kind of HW or Network error.

What is recorded in your log file?

I would try to to pull the power from both the Hub and the Tempest station, and then let them start again, to see if that helps.

ciairmi commented 2 years ago

I'll try. In the meanwhile can you give me the id number of a station that you are sure it works so I can double check if it works also for me?

briis commented 2 years ago

You can use my station: 51146, but then you need to use old developer key and not your own: So use this: 20c70eae-e62f-4d3b-b3a4-8586e90f3ac8

ciairmi commented 2 years ago

Thanks. The Id Station that you gave me works correctly.

Otherwise, when I try to configure the station in the area of Milan, it gave me error and reports that logs:

Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 187, in _async_refresh self.data = await self._async_update_data() File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 147, in _async_update_data return await self.update_method() File "/config/custom_components/weatherflow/init.py", line 108, in async_update_data data: ObservationDescription = await weatherflowapi.update_observations() File "/usr/local/lib/python3.9/site-packages/pyweatherflowrest/api.py", line 202, in update_observations obervations: dict = data['obs'][0] KeyError: 'obs'

briis commented 2 years ago

What is the station Id for that station in Milan?

briis commented 2 years ago

The error above is somewhat the same issue as you have with your station. The data we get back is incomplete, and therefore we cannot process it. I have now implemented better error handling so the program will not crash, but keep retrying (Will be in the next release). However there is still a HW problem of some sorts with the station that needs to be fixed and has nothing to do with this integration.

ciairmi commented 2 years ago

What is the station Id for that station in Milan?

still them 32613 or 39572 ;o)

ciairmi commented 2 years ago

The error above is somewhat the same issue as you have with your station. The data we get back is incomplete, and therefore we cannot process it. I have now implemented better error handling so the program will not crash, but keep retrying (Will be in the next release). However there is still a HW problem of some sorts with the station that needs to be fixed and has nothing to do with this integration.

However is really strange, because I've always used those station to gather information on weather in Milan.

briis commented 2 years ago

But they are not your stations? If you do not own the stations, then you cannot create a Personal Token for them. You can only use the code I posted above, but WeatherFlow has said that this will stop working.

Do you have your own Tempest station?

ciairmi commented 2 years ago

But they are not your stations? If you do not own the stations, then you cannot create a Personal Token for them. You can only use the code I posted above, but WeatherFlow has said that this will stop working.

Do you have your own Tempest station?

No I don't have my personal Tempest Station, I just gather information from the one's I can find on the map in the Tempest website.

Now I've tried to configure the id station 32613 with the Api token 20c70eae-e62f-4d3b-b3a4-8586e90f3ac8 that you gave me and it worked correctly.

So that, even if I've created my personal API Token into Tempest website I won't be able to use public stations?

briis commented 2 years ago

The personal token will only work for stations that are linked to your WeatherFlow account. So if no stations are linked then that token cannot be used for anything.

The code above is the old public developer token - WeatherFlow have announced that it will stop working, but that was a year ago, and it still works. So use that as long as you can.

ciairmi commented 2 years ago

The personal token will only work for stations that are linked to your WeatherFlow account. So if no stations are linked then that token cannot be used for anything.

The code above is the old public developer token - WeatherFlow have announced that it will stop working, but that was a year ago, and it still works. So use that as long as you can.

Thank you so much and sorry if I complicated your week. I'll do as you suggest. Best regards Andrea

briis commented 2 years ago

No problem Andrea. It helped in doing better error handling in the code, and that is always good.

Bjarne