muppet3000 / growatt-weather-based-charger

A tool for configuring overnight charging (i.e. during off-peak periods) for Growatt inverters that have storage capacity (batteries) based on the predicted solar generation for the day
MIT License
16 stars 4 forks source link

OpenStreetMap url format change #5

Closed jimwormold closed 1 year ago

jimwormold commented 1 year ago

OpenStreetMap have changed the request url format

I think get_lat_long() needs to change from:

url = 'https://nominatim.openstreetmap.org/search/' + urllib.parse.quote(address) +'?format=json'

to

url = 'https://nominatim.openstreetmap.org/search?q=' + urllib.parse.quote(address) +'&format=json'

============================== Screen scrape from browser:

File not found: API no longer accessible via this URL Using the URL /search/ and /reverse/ (with slashes) is no longer supported. Please use URLs as given in the documentation.

Examples how to change the URL:

You use: https://nominatim.openstreetmap.org/search/?q=Berlin Change to: https://nominatim.openstreetmap.org/search?q=Berlin

You use: https://nominatim.openstreetmap.org/search/US/Texas/Huston Change to: https://nominatim.openstreetmap.org/search?q=Huston, Texas, US

See github issue #3134 for more details.

muppet3000 commented 1 year ago

Fixed and pushed - now on main (also pushed into Docker hub)