genielabs / HomeGenie

HomeGenie, the programmable automation intelligence
https://homegenie.it
GNU General Public License v3.0
388 stars 154 forks source link

New Open weather Questions #370

Closed tuicemen closed 5 years ago

tuicemen commented 5 years ago

@genemars with the introduction of Open Weather as the default weather app replacing weather underground I'm noticing some strange reporting in the widget. This leads me to think I'm missing something in the setup, so maybe you could explain how to set it up. The temperature and weather conditions seem right but my sunset and sun rise are way off as is the time of day reported at the bottom of the widget. These may be issues but I want to be sure I've got Open Weather configured correctly. I have entered my API Key and city and country and they appear correctly in the widget. I also have the jkUtils OpenWeather widget configured & running to compare values Do I have to initially manually set the Astronomy.Sunrise and Astronomy.Sunset times? What a bout the time setting do I also have to initially set it some where?

tuicemen commented 5 years ago

I've been playing with this and see the time and date displaying is not the actual time of day but time of last update. However this is completely wrong as it always says about 4 hours into the future as the last update time. Also the sunrise sunset is off by 4 hours so the two are somehow related it appears (maybe with the same base time). I thought setting the time and sunset/rise to the correct values would fix things however the next update throws them out of wack again. =(

noliono commented 5 years ago

@tuicemen Can you try this adaptation in program the program ? https://github.com/genielabs/HomeGenie/compare/master...noliono:master

tuicemen commented 5 years ago

I'm not sure how to do that. I'm relatively new to HG and GitHub.

noliono commented 5 years ago

Ok i will send you the hgx tonight :) (I suppose the problem is link to time zone, not sure ...)

tuicemen commented 5 years ago

Thanks. I believe part of the issue may be time zone but also Latitude as it displays sun rise here at 11:15 and sun set as 23:20. I'm not in the Artic or Antartic

tuicemen commented 5 years ago

@noliono I believe the latitude longitude may be coded in reverse. this would put me in a incorrect time zone and also cause my sunset/rise to be the values they are. I just tested looking up my latitude longitude in reverse and that seems to confirm my theory as it put me in the Antarctic. where day light time would be close to what the OpenWeather widget is showing.

noliono commented 5 years ago

34-OpenWeatherMap.zip @tuicemen Are sure you use the openweathermap program (ID 34) ? Because the program didn't permit to add "lat" and "long" ... Like : api.openweathermap.org/data/2.5/weather?lat=35&lon=139 Or How did you do ?

tuicemen commented 5 years ago

I never changed the lat/ long in the program I used a web browser search and reversed my lat/long info. That put my location in a different location and time zone which explains why sunset/rise is off so much as well why my last update time is in the future. the api states you can use lat long for your city but if I do that I get a can't locate data error which makes sense as there are no cities in Antartica. I'll try your program

tuicemen commented 5 years ago

@noliono your modification to the Open weather Program does seem to fix the reported sunrise/set times as well as the last update time. I would have bet money on the lat/long being reversed some how. Good Catch!!