Read the statement by Michael Teeuw here.
MMM-BM-OW when 'no rain' for forecast undefined message received.
-
@scumbelly said in MMM-BM-OW when 'no rain' for forecast undefined message received.:
MMM-BM-OW
I can take a look at it if you’d like.
-
Sure, thanks.
I tried a bunch of things and was just thinking about “null” being returned and how to handle it. If rain worked completely then I could try snow and that would cover everything ( I think) I’d want the module to do.
-
Just to be clear, the module works but not after you modified it?
-
Hi,
The module works just fine. It’s only when you do not receive a forecasted rain amount . So if Tuesday has 2 returned ( for mm of rain) and Wednesday has no rain then Wednesday displays undefined as a value.
The code is …
moment.unix(forecast.daily[X].sunrise).local().format(‘ddd’) + "  " + “<img class = image src=./modules/MMM-BMW-OW/icons/” + forecast.daily[X].weather[0].main + “.png>” + "  " + Math.round(forecast.daily[X].temp.max) + “/” + Math.round(forecast.daily[X].temp.min) + "          " + forecast.daily[X].rain + “/mm Rain” + “         ”+ until 6 terminates with no + but with ;
Hope that helps.
is 0 to 6. -
That check mark is supposed to be X for 0 to 6.
-
Hi,
I changed the string a bit. I added Math.round to forecast.daily[X].rain + “/mm Rain”
Math.round (forecast.daily[X].rain) + “/mm Rain”
and instead of undefind/mm Rain I now receive NaN/mm Rain.
Cool.
-
@scumbelly this needs some css help but… is this what you’re after?

-
Exceptional. That’s it! What’s the solution? I started to go down an isNAN() rabbit hole but as yet haven’t been successful.
Great job.
-
@scumbelly It takes rewriting parts of the entire module to make it work…
-
I don’t know if I’m headed in the right way but I’ve tried to make showRain a config option - true/false.
Right now it kinda loads - at least I get Openweather data… on the screen instead of a blank “dead zone”.
Gotta play more… Gotta learn more.
Cheers
-
@cowboysdude said in MMM-BM-OW when 'no rain' for forecast undefined message received.:
It takes rewriting parts of the entire module to make it work…
Uhhhh . . .
-
@scumbelly Have at it… it’s how you learn.
-
I’m going to move onto another module for now. I’ll revisit this in the future when I am more experienced. Right now I’m just self immolating.
Thanks for your time and effort.
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login