Read the statement by Michael Teeuw here.
Header missing for Current weather (MMM_OpenMapWeather)
-
Incredibly new to coding but really enjoying the process of compiling a magic mirror on a raspberry pi4.
For the most part it’s been pretty smooth sailing aside from a few small things.
One of the issues I’ve been having was with the default current weather app. Weather forecast works great. But not the current weather.
I found that the MMM-Openmapweather module works great in place of it. However, with the OpenmapWeather module,
there isn’t a header for the city above the current weatherCan anyone assist me with amending a header to this module?
-
Hi. Just a little confused as to which module but if you’re asking about OpenMapWeather by default in the .js file appendLocationNameToHeader: true, so in the config/config.js you can look at adding the location or locationID options.
The location used for weather information.
Example: ‘Phoenix,USA’
Default value: falseNote: When the location and locationID are both not set, the location will be based on the information provided by the calendar module. The first upcoming event with location data will be used.
Location ID from OpenWeatherMap This will override anything you put in location.
Leave blank if you want to use location.
Example: 1234567
Default value: falseNote: When the location and locationID are both not set, the location will be based on the information provided by the calendar module. The first upcoming event with location data will be used.
If you are asking about the currentweather module you can do the same or use the header option in the config.js file.
I hope this is what you were looking for.
Cheers.
-
Here’s my currentweather example …
{
module: “currentweather”,
position: “top_right”,
header: “blah blah City”,
config: {
location: “City”,
// locationID: “XXXXXX”, //ID from http://bulk.openweathermap.org/sample/; unzip the gz file and find your city
appid: “wholelottanumbers”,
appendLocationNameToHeader: false,
degreeLabel: true,
useBeaufort: false,
useKMPHwind: true,
showHumidity: true
}
}, -
Thank you so much for the reply. I’m a bit confused myself.
I was having issues getting the default weather modules to work. More specifically, the current weather module. The default weather forecast module works beautifully. I have added the OpenMapWeather module to my config.js and I now have current weather displayed. However, I would like to add a header to this module. Unfortunately, I have tried your suggestions with no luck(assuming I did them correctly). Here is my js file for reference if you have a second to look at it.Here is the weather portion config containing my weather modules
{
module: “MMM-OpenmapWeather”,
position: “top_right”, // This can be any of the regions.
// Best results in left or right regions.
config: {
// See ‘Configuration options’ for more information.
location: “New York,USA”,
locationID: “5128581”, //Location ID from http://openweathermap.org/help/city_list.txt
appid: “xxxxxxxx”, //openweathermap.org API key
colorIcon: false
}
},
{
module: “weatherforecast”,
position: “top_right”,
header: “Weather Forecast”,
config: {
location: “New York”,
locationID: “5128581”, //ID from http://bulk.openweathermap.org/sample/city.list.json.gz; unzip the gz file and find your city
appid: “xxxxxxxxxxx”
}
},It’s a small thing, but driving me crazy. Really appreciate you taking the time to deal with a noob.
-
@nneuland https://forum.magicmirror.builders/assets/uploads/files/1616691041491-weather_header.png
To clarify. I am looking to include “Atlanta” header
only New York
-
Sorry, my example was not explained properly. It was basically how not to put the Location/LocationID name in the header. In my example you would just edit the header to say header: “Weather Forecast for New York”, or in your case just “New York, USA”. With the appendLocationNameToHeader: false, I put this in to stop the the appid city ID being populated as my location because it wasn’t my village name but a nearby city. So in your instance, if I remember correctly, your don’t need header: it should be fine with appendLocationNameToHeader: true,
The default config for openmapweather
modules: [
{
module: “MMM-OpenmapWeather”,
position: “top_left”, // This can be any of the regions.
// Best results in left or right regions.
config: {
// See ‘Configuration options’ for more information.
location: “Phoenix,USA”,
locationID: “”, //Location ID from http://openweathermap.org/help/city_list.txt
appid: “abcde12345abcde12345abcde12345ab”, //openweathermap.org API key
colorIcon: true
}
}
]should just be location:“New York”,
locationID: “5128581”,
appid: “xxxxxxxxxxx”,If you want the USA, location “New York, USA” that might work. It may not like the USA part because it might conflict with the returned locationID of just New York - I can’t remember. If you want USA you’ll have to create the header “New York, USA” using my example. I hope your config.js file has a comma at the end of your appid".
Cheers, hope this helps.
-
Thank you so much for your time. Doing research on this, I never see a header on the openmapweather mmm. Only with the default current weather module is there a header.
Perhaps I should investigate why the default current weather mmm wont work. Thanks again for your help
-
Just figured I would let you know. I nixed the openmapweather mmm, and found a way to get the default current weather module working AND displaying a New York header. Thanks again for the support.
-
@nneuland said in Header missing for Current weather (MMM_OpenMapWeather):
Just figured I would let you know. I nixed the openmapweather mmm, and found a way to get the default current weather module working AND displaying a New York header. Thanks again for the support.
how did u solve this?
-
@eltonnascimento
Hi. Apologize for the late response.
Not sure I would call this a fix. I reverted back to the default Current Weather module and avoided the Openmapweather module all together. For the life of me I couldn’t figure a way to show a header with the Openmapweather. However, the default Current weather worked.Hope this helps