glanceapp / glance

A self-hosted dashboard that puts all your feeds in one place
GNU Affero General Public License v3.0
8.48k stars 295 forks source link

Weather widget preventing startup #31

Closed mikesellt closed 6 months ago

mikesellt commented 6 months ago

Hello there. I'm having an issue getting a different weather location to work. So far I have just spun up the pre-built page, and all I did was change the weather from "London, United Kingdom" to "Ogden, Utah." I also tried "Ogden, Utah, USA" and "United States (instead of USA)." When I do this, Glance doesn't start up at all. I'm running it in CasaOS, and I'm not sure how to get logs from it, so I'm not quite sure what error I'm getting. If I change back to "London, United Kingdom," It works again. I also tried Berlin, Germany, and that seems to work as well. I looked through the docs to find anything specific about weather locations, and I also checked out the linked site where the weather data is retrieved from. Is this just an issue where a state/province is needed? Any ideas?

svilenmarkov commented 6 months ago

Hey! Have you tried Ogden, United States? That one seems to work for me.

As for the logs, I'm not very familiar with CasaOS but if you're running Glance using the Docker container and have access to the terminal it should be as simple as:

docker logs <container id or name>`

To find the container id or name you can run:

docker ps -a

which will show all containers, running and stopped.

mikesellt commented 6 months ago

Thanks! I'll try your suggestion to check the logs when I get back home. As for Ogden, United States, there are 16 cities in the US that are named Ogden, so I'm not sure which one it would pick.

mikesellt commented 6 months ago

I was able to look at the logs this morning, and it simply says "failed parsing config file: failed fetching data for Ogden, Utah, United States: no places found for Ogden, Utah, United States"

I did take out the state name, Utah, and it did work, but again I'm not sure which Ogden it is pulling data for. The forecast for today is lower than the forecast for my area. Thanks for looking at this! Good work on Glance as a whole. I've been looking for a solution that is a bit more cookie-cutter than just a blank config file, and so far this has been better than others I've tried.

svilenmarkov commented 6 months ago

Thanks for providing more information!

I think I came up with a reasonable solution to this, I'll have to do some magic behind the scenes to allow you to specify the "administrative area", so you'd be able to enter the location as Ogden, Utah, United States, which will then select the correct state. I'll try and get this done for the next release as other people have had this issue as well.

As for which city it's currently selecting, it'll always be the first one on the list here:

https://open-meteo.com/en/docs/geocoding-api#name=Ogden,+United+States

Which does appear to be Utah, though maybe wait until the change is released so that we can be sure.

Keep in mind that the data from Open Meteo may vary from other weather sources as weather data is based largely on estimates. At some point in the future I might add the ability to choose different sources for the data.