Read the statement by Michael Teeuw here.
MMM-MyWeather not working with Southern Hemisphere co-ordinates
-
Hi all!
Need help with an odd one. Is anyone else running into issues using MMM-MyWeather for Southern Hemisphere co-ordinates? The module gets stuck on āloadingā if lat has a negative value, but works fine for negative value in longitude (eg New York with lat = 40.69 and lon = -74.25).
The response from the API as provided in the logs is fine in both instances, but it just looks like the module cant parse the json correctly and i canāt figure out why.
Sample of my config below.
modules: [ { module: 'MMM-MyWeather', position: 'top_right', config: { apikey: 'xxxxxxxxxxxxx', lat: "-22.27", // lon: "133.77" , // hourly: '1', fctext: '1', fcdaycount: "5", fcdaystart: "0", hourlyinterval: "3", hourlycount: "2", UseCardinals: 0, layout: "horizontal", debug : 1 } }, ]
-
@jolt02 remove the quotes from all the numbers
-
@sdetweil thatās not the issue though. using lat = ā22.27ā and ā133.77ā work even if the rest of numbers are in quotes.
the code above were copied and pasted the config from the module documentation. iāve just changed the co-ordinates to be southern hemisphere co-ordinates
-
@jolt02 said in MMM-MyWeather not working with Southern Hemisphere co-ordinates:
fcdaycount: "5", fcdaystart: "0", hourlyinterval: "3", hourlycount: "2",
but i donāt care what the author postedā¦ those are strings, that need to be converted to numbersā¦
anyhow
-
@sdetweil š¤·āāļø thatās how they built the module and iām not familiar enough with JS to go through and fix it. Thanks for trying anyways.
for what itās worth, I ended up learning to use the console more and figured out something in the moon direction logic was broken because it was looking for there was a condition for lat >= 0. Iāve just gone through and deleted all references to moon phases in the MMM-MyWeather.js file and itās working fine now.
probably not the most elegant of solutions, but at least it gives me way more information than āloadingā¦ā
-
@jolt02 said in MMM-MyWeather not working with Southern Hemisphere co-ordinates:
a condition for lat >= 0
so, to add to the prior discussion
if the user had coded lat:ā-16ā in config.js
the comparison would always be true comparing a string to a 0 (all āstringā objects would be non-zero, regardless of their content)
-
try taking out the Lon And Lat and use a PWS like for me would beā¦ Perth (IPERTH921). This usually happens when the site canāt match a co-ordinate to a location.
I have tried various modules that require Lon and Lat or area and found this happens a lot ādown underā as there seems to be less active locations than in the northern hemisphere.
for my mirror I used default weatherforecast and MMM-OpenmapWeather . Both of these use Open Weather map that has locations rather than co-ordinates.
MMM-MyWeather also uses locations (PWS)
-
@harney hello from Perth as well! how are you finding the accuracy of the OpenWeather data? I was using that initially, but found that it was telling me something different to the results from Google.
i used lat long in OpenWeather though and didnt try using the PWS so that might be the difference
-
@sdetweil from my very basic understanding of how it was developed, i think it was stored it as a string so that it could be concatenated? again, this is based on 5 minutes of Google-fu and no understanding of JS here
-
@jolt02 js will convert in either direction automatically, except if u ask, is this a number or a string
temp: 1234 is a number
temp ā1234ā is a string
temp: ānullā is string
temp: null is undefinedprint temp from above will do 1234, or 1234, or null, or undefined