naofireblade / homebridge-weather-plus

A comprehensive weather plugin for homebridge.
MIT License
314 stars 63 forks source link

wrong conditions after update #85

Closed divemasterjm closed 4 years ago

divemasterjm commented 4 years ago

after updating the weather conditions doesn't correspond to my locations tried changing location geo and locationname but still wrong conditions

naofireblade commented 4 years ago

Hi, can you provide some more info? What weather service are you using? Detailed or simple categories? What category do you get, what did you expect?

divemasterjm commented 4 years ago

Im using openweathermap, i tríes with another location close to me and works, dont know why now my location is not working, i use “Lloret de Mar, ES” and doesn’t work while worked before, now using Blanes works

naofireblade commented 4 years ago

What condition did the plugin show and what condition did you expect to see?

divemasterjm commented 4 years ago

Basically I’ve got wrong conditions, temperature, weather etc, but I solved setting another village close to me. Strange because my town was working ok till update.

Saludos Juan Manuel

El 27 nov 2019, a las 9:12, Arne notifications@github.com escribió:

 What condition did the app show and what condition did you expect?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

tooh commented 4 years ago

I encounter the same problem Code 404 city not found. Was working ok before Update Using OpenWeatherMap

naofireblade commented 4 years ago

@tooh could you post your config (without apikey) please?

tooh commented 4 years ago

{ "platform": "WeatherPlus", "name": "WeatherPlus", "interval": 5, "forecast": [ 1, 2 ], "service": "openweathermap", "key": "xxxxxxxxxxxxxxxxxxxxxxxxxxx", "locationCity": "Hapert, NL", "displayName": "Nu buiten", "language": "nl", "displayNameForecast": "Verwachting OWM", "fakegatoParameters": { "storage": "fs" }

tooh commented 4 years ago

Can i do more to help you debug this ?

naofireblade commented 4 years ago

That's strange. I tested your exact config and the location works for me. I have no clue why you get "city not found". As a workaround, you can use the id in the url as locationId after searching your city on https://openweathermap.org . I already found your cityId, it should be 2756252.

Also the location "Lloret de Mar, ES" gives me the exact same conditions as displayed on https://openweathermap.org/city/3118212

tooh commented 4 years ago

Thanks for looking into this. I changed the setting to locationID as you suggested. Now I get some values. The forecasts seem OK, but the current temperatures are way off. (indicating -11,8 C when they should be around 1 C.

divemasterjm commented 4 years ago

Same issue to me

JuanMa

El 1 dic 2019, a las 10:04, Peter Florijn notifications@github.com escribió:

 Thanks for looking in to this. I changed the setting to locatioID as you suggested. Now I some values. The forecasts seem OK, but the current tempertures are waoy off. (indicating -11,8 C when they should be around 1 C.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

tooh commented 4 years ago

I'm willing to put some time in debugging this. I'm not very into node.js but I can put some logging in the code to try to pinpoint the bug. I notice that in your code there are some debug("...."); statements. How can I activate these ? I already established that the locationCity is read OK from the config.

Perhaps it helps to give some more info about the environment

Raspberry Pi
Linux raspberrypi 4.19.66-v7+ #1253 SMP
Node
v12.13.1

@divemasterjm Can we team up to help @naofireblade ?

naofireblade commented 4 years ago

That would be awesome. I already tried to find the issue but your config and also the location of @divemasterjm works perfect for me. You can debug the plugin when you start homebridge with this option: Windows: DEBUG=homebridge-weather-plus homebridge -D Linux: set DEBUG=homebridge-weather-plus & homebridge -D

tooh commented 4 years ago

Switched on DEBUG (had to do it in my service file) Put some extra debug info in index.js and in openweathermapi.js. This gave me some extra insight in the code.

The trigger that solved it was looking at the code of https://github.com/CICCIOSGAMINO/openweather-apis/blob/master/index.js

Especially this snippet at lines 31-33

weather.setCity = function(city){
    config.city = encodeURIComponent(city.toLowerCase());
  };

When I changed my city name in my config from Hapert,NL to hapert

I got the correct results. Also the Eve integration works OK.

Adding the country code kills it again.

divemasterjm commented 4 years ago

I’ve tried again with my location coordinates and is working.

JuanMa

El 6 dic 2019, a las 11:33, Peter Florijn notifications@github.com escribió:

 Switched on DEBUG (had to do it in my service file) Put some extra debug info in index.js and and in openweatherapi.js. This gave me some extra insight in the code.

The trigger that solved it was looking at the code of https://github.com/CICCIOSGAMINO/openweather-apis/blob/master/index.js

Especially this snippet at lines 31-33

weather.setCity = function(city){ config.city = encodeURIComponent(city.toLowerCase()); }; When I changed my city name in my config from Hapert,NL to hapert I got the correct results as far as I have tested for now. Also the Eve integration works OK.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

naofireblade commented 4 years ago

In version 3.1.2 I updated openweather-apis to the latest version. Does the problem still exist?

naofireblade commented 4 years ago

I created this more specific issue and currently investigate the problem: #113

naofireblade commented 4 years ago

Fixed in latest beta. You can install the beta with:

npm install -g homebridge-weather-plus@beta