Read the statement by Michael Teeuw here.
MMM-WeatherAlerts
-
@JohnGalt unable to replicate this issue. I setup my computer as MagicMirror server and then I am able to access the server from my computer’s web-browser and from my raspberry pi acting as a client with both displays showing as expected.
Am I misunderstanding your current configuration? Did you happen to set the ‘alertDateFormat’ parameter in your configuration as well?
-
@Gjones93 said in MMM-WeatherAlerts:
@croc_dad72 I tried that lat and lon and I am seeing the winter weather advisory.
Let me ask this: For the other weather modules (e.g. forecast), are you setting an apiVersion parameter in your config file? If yes, to what?
Lastly, are you able to share your config layout for the MMM-WeatherAlerts module, minus your apiKey? I’m expecting something like this:
Im just using the default weather from MM, and I have changed any of those parameters at all, just added my api key, and city id.
My config:
{ module: "MMM-WeatherAlerts", position: "top_right", // top_right header: "Weather Alerts", config: { // See 'Configuration options' for more information. lat: "42.4604", lon: "-71.3489", apiKey: "", colored: true } },
-
@croc_dad72 please use code block markers for config info
paste your text into the message editor,
select the text you just pasted
and hit the button above the editor that looks like </>that module config is not from MagicMirror
that would be
{ module:'weather'
-
@sdetweil my apologies, thank you for fixing it!
-
@Gjones93 Well it seems to be working now, I guess I just needed to give the api time to start working, thanks for all the help!
-
@Gjones93 - I am unable to replicate this today, too. It appears to be working as designed today. [There is no active alert at my location, so I changed the lat/lon to the same location in Alaska as before, and a Winter Weather Advisory displays. Both the local and Alaska work on the display and when accessing via a browser at port 8080 on my desktop.] For completeness, no - I did not set or change alertDateFormat from the default in the config.js.
Related but separate query: Does the module take up any space or affect existing modules when it is not actively displaying an alert? I ask because I have several instances of the default weather module stacked in the top_right region, and this module appears to affect their placement.
-
@JohnGalt appreciate the update.
For the module interference while no alerts are active, good eye. This is caused by the default “margin-bottom” that MagicMirror gives to each module. The result is that when no alerts are visible, the module takes up no space, but its margin is still pushing surrounding modules to create the undesired effect that you observed.
I have a quick (slightly-hacky) solution. In your “custom.css” file, add the following:
.MMM-WeatherAlerts { margin-bottom: 0px; }
That should clean up the impact on your default weather modules. The side effect of this is that when there are alerts active, they will be stacked more tightly on-top of one another. I will look and see if I can find a robust way of handling this styling issue so that the spacing is included when the alerts are active and the spacing is “off” when there are no alerts to show. The trick here is that the spacing (margin-bottom) is set by the main app, and not by my module so it may take some work to implement a good solution.
FYI, on my mirror I have the alert module at the bottom of my default weather modules so it avoids this issue all together. Just another option…
-
@Gjones93 - Humm, this is interesting. Thanks for the update. While I might just try moving the alert module to the bottom of the stack of weather modules, the core issue I have with it is it appears to also hold on to horizontal real estate when not actively displaying an alert - with the effect of carrying all the modules in that region with it. In my case, I have the weather modules down the right side of the display, narrowed to 82% in custom.css. Sadly, when running your alerts module, I cannot get custom.css to narrow it using the same code, and it also pads out the other modules from the side of the monitor… FWIW, I also tried controlling the alert module width using an absolute number of pixels, but that also had no effect.
The weather css code follows:
.module.weather { background-color:rgba(255,255,255,0.1); border-radius:8px; padding:8px; text-align: left !important; width: 82%; max-width: 82%; min-width: 82%; }
-
@Gjones93 - Would there be any reason for this module to stop working? We are currently under an excessive heat warning, but nothing displays… I also tried locating another place under a warning, but it is not triggered by that warning either. Interestingly, when I run 'pm2 logs I don’t see any reference to this module at all. Following is my config:
{ module: "MMM-WeatherAlerts", disabled: false, position: "top_left", // top_right header: "Weather Alerts", config: { // lat: "36.131148", //Las Vegas = 36.131148 // lon: "-115.241867", // Las Vegas = -115.241867 // lat: "62.037360", //Alaska - for testing // lon: "-163.272301", // Alaska - for testing lat: "36.753342", // Alfalfa County, Oklahoma - for testing lon: "-98.355930", // Alfalfa County, Oklahoma - for testing weatherAlertProvider: "openweathermapalerts", weatherEndpoint: "/onecall", type: "alerts", apiKey: "xxxx", animationSpeed: 10000, // Default = 1000 (1 second) alertTimeFormat: "absolute", alertDateFormat: "llll", alertDescriptionScrollDelay: 100, // Default = 85, Lower = faster alert description will move colored: true }, },
-
@Gjones93 + @sdetweil – Is there any reason why openweathermap.org would not be returning alerts with the rest of the weather data? I have seen this behavior for some weeks/months now, and wonder whether it might be connected to the new API ver 3.0.
I currently am running both MMM-WeatherAlerts and MMM-OpenWeatherMapForecast. Both used to deliver alerts and neither currently do. I am currently under a wind warning, but no warning displays on either module. I have also found a location in Utah that is currently under a winter storm warning [22 inches of snow falling!], and set the lon/lat there in one MM instance, still with no alert output.
I see no errors in pm2 logs, and do see various other modules showing successful fetching of weather and news - so it looks like this is not a lack of network connection.
Since multiple modules are failing to fetch alerts, it feels like the problem is at the source - openweathermap - or the operation of its API.
Config code for the dev instance follows. Any thoughts?
{module: "MMM-WeatherAlerts", disabled: false, position: "top_left", // top_right // header: "Weather Alerts", config: { appendLocationNameToHeader: false, calendarClass: "calendar", tableClass: "small", // small // lat: "36.131148", lon: "-115.241867", //Las Vegas = 36.131148 lat: "38.549194", lon: "-111.709464", // Fish Lk, Ut - For testing // lat: "42.295568", lon: "-83.782281",// Ann Arbor, Mi - for testing // lat: "35.152661", lon: "-114.456767", // Lake Mead Rec Area - For testing // lat: "36.753342", lon: "-98.355930", // Alfalfa County, Oklahoma - for testing // lat: "40.924102", lon: "-115.122002", // Northern Nevada - for testing weatherAlertProvider: "openweathermapalerts", weatherEndpoint: "/onecall", type: "alerts", updateInterval: 10800000, // Fetch content every 3 hours apiKey: "xxxx", // 19 Sep 2024 Ver 3 animationSpeed: 10000, // Default = 1000 (1 second) alertTimeFormat: "relative", // absolute alertDateFormat: "llll", alertDescriptionScrollDelay: 100, // Default = 85, Lower = faster alert description will move colored: false }, }, // true