Rudd-O / homeassistant-meteoswiss

:sun_behind_rain_cloud: :switzerland: Meteo Swiss Integration for Home Assistant (forked from websylv)
86 stars 10 forks source link

Impossible to setup #44

Closed stefanoklett closed 1 month ago

stefanoklett commented 3 months ago

Hi,

when I install this MeteoSwiss fork version. it appears popup asking the Location.

Then I will get: Unknown error occurred !!!

Unusable 2024-06-16 11_39_25-Impostazioni – Home Assistant

regards Stefano

bedeberger commented 3 months ago

same here

viertch commented 3 months ago

Same here, looks like it's an issue with the request sent to openstreetmap. Getting this error in the logs. Also setup works if I provide a valid post code and skip the lookup based on geodata.

> 2024-06-18 21:33:49.097 DEBUG (SyncWorker_7) [hamsclientfork.client] Got data from OpenStreetMap: <html>
> <head>
> <title>Access blocked</title>
> </head>
> <body>
> <h1>Access blocked</h1>
> 
> <p>You have been blocked because you have violated the
> <a href="https://operations.osmfoundation.org/policies/nominatim/">usage policy</a>
> of OSM's Nominatim geocoding service. Please be aware that OSM's resources are
> limited and shared between many users. The usage policy is there to ensure that
> the service remains usable for everybody.</p>
> 
> <p>Please review the terms and make sure that your
> software adheres to the terms. You should in particular verify that you have set a
> <b>custom HTTP referrer or HTTP user agent</b> that identifies your application, and
> that you are not overusing the service with massive bulk requests.</p>
> 
> <p>If you feel that this block is unjustified or remains after you have adopted
> your usage, you may contact the Nominatim system administrator at
> nominatim@openstreetmap.org to have this block lifted.</p>
> </body>
> </head>
mousaka20 commented 3 months ago

Same here

@viertch How did you manage to bypass the location dialog so that you can enter the post code?

HansjoergC commented 3 months ago

Same here

Extract of log:

You have been blocked because you have violated the usage policy of OSM's Nominatim geocoding service. Please be aware that OSM's resources are limited and shared between many users. The usage policy is there to ensure that the service remains usable for everybody.

Please review the terms and make sure that your software adheres to the terms. You should in particular verify that you have set a custom HTTP referrer or HTTP user agent that identifies your application, and that you are not overusing the service with massive bulk requests.

If you feel that this block is unjustified or remains after you have adopted your usage, you may contact the Nominatim system administrator at nominatim@openstreetmap.org to have this block lifted.

See attached log home-assistant_2024-06-25_Meteo_Swiss_OSM_Usage_Policy_Violation.txt

dgalli1 commented 3 months ago

@viertch How did you manage to bypass the location dialog so that you can enter the post code?

@mousaka20

Don't know how viertch did it, but you can remove the lines which request the geodata to get your postal code and address in the file /config/custom_components/meteoswiss/config_flow.py

My modified file looks like this: https://gist.github.com/dgalli1/19e345bd728cc13316b931168972006c

CD-Nitrox commented 3 months ago

Same issue, overwriting the code with the one provided by @dgalli1 worked fine. Thanks!

HansjoergC commented 3 months ago

Confirm the the workaround from @dgalli1 works well. Danke Damian

michaelherger commented 2 months ago

@dgalli1 did you consider submitting a pull request? This got me past the setup, too. Thanks!

andreasbuff commented 2 months ago

Confirm the the workaround from @dgalli1 works well. Danke Andreas

daes10 commented 2 months ago

I had the same problem. Thank you @dgalli1 and @HansjoergC for your solution. It works great!

DreadN commented 2 months ago

Thanks @dgalli1 it worked!

Haifi58 commented 2 months ago

Same Issue - tried fix, but no success :-(

zieb-a commented 2 months ago

The workaround from @dgalli1 did not work. However, using @dgalli1 code, I commented out

if errors or user_input is None:
  return self.async_show_form(
    step_id="user_two", data_schema=schema, errors=errors
   )

and hardcoded:

self._post_code = int(user_input[CONF_POSTCODE])
self._forecast_name = user_input[CONF_FORECAST_NAME].strip()
self._update_interval = int(user_input[CONF_UPDATE_INTERVAL])

eg

self._post_code = 8000
self._forecast_name = 'ZURICH' 
self._update_interval = DEFAULT_UPDATE_INTERVAL
Rudd-O commented 1 month ago

PR #50 should fix this.