[RELEASE] Enhanced Weather Underground Driver

Progress is being made (I got some amazing help from @thebearmay ), Im just seeking some help from one of our CSS Dev Guru's on how to de-uglify it. :smiley:

Screen Shot 2022-09-25 at 4.43.06 pm

1 Like

Argh - the 3 Day Forecast Tile sometimes works and then other times it fails (runs into a 1024 char limit for tile content).

It does look good when it works tho:

Screen Shot 2022-09-25 at 7.03.36 pm

and less good when it fails:

Screen Shot 2022-09-25 at 7.55.00 pm

So I'm going to make a Nice tile for each day - it's the only way to do this reliably.

1 Like

Ok, that works - folks let me know if there are any tweaks you would like to see (eg to the title etc).

3 Likes

Thanks for the updates!

This might be a stupid question, but how do you get it to state the specific day of the week instead of "forecast today", forecast tomorrow", forecastdayaftertomorrow"? Having it say, e.g., "Sunday", "Monday", "Tuesday", as it does with your tiles, looks much better.

1 Like

It’s fairly easy, first i pull the days from the WU tables and populate them into Hubitat attributes.

The the part I needed help with was getting the days and forecast data into the tiles (@thebearmay and @sburke781 helped me understand this process).

This is the code I eventually settled on before being bitten by the 1024 character limit.

def updateTile() {
	log.debug "updateTile called"
	html ="<div style='line-height:1; font-size:1em;'><br>3 Day Forecast<br></div>"
	html +="<div style='line-height:50%;'><br></div>"
	html +="<div style='line-height:0.95; font-size:0.75em; text-align: left;'><br>Forecast for ${device.currentValue('today')}<br></div>"
	html +="<div style='line-height:0.95; font-size:0.75em; text-align: justify;'><br>${device.currentValue('forecastToday')}<br></div>"
	html +="<div style='line-height:50%;'><br></div>"
	html +="<div style='line-height:0.95; font-size:0.75em; text-align: left;'><br>Forecast for ${device.currentValue('tomorrow')}<br></div>"
	html +="<div style='line-height:0.95; font-size:0.75em; text-align: justify'><br>${device.currentValue('forecastTomorrow')}<br></div>"
	html +="<div style='line-height:50%;'><br></div>"
	html +="<div style='line-height:0.95; font-size:0.75em; text-align: left;'><br>Forecast for ${device.currentValue('dayAfterTomorrow')}<br></div>"
	html +="<div style='line-height:0.95; font-size:0.75em; text-align: justify'><br>${device.currentValue('forecastDayAfterTomorrow')}<br></div>"
	sendEvent(name: "html", value: "$html")
	log.debug "html contains ${html}"
	log.debug "${html.length()}"
	}
3 Likes

Got it, and thanks!

1 Like

No worries.

Ok, v6.1.1 has been published.

the Tiles are labelled:

htmlToday
htmlTomorrow
htmlDayAfterTomorrow

I recommend using them like this:

1 Like

If folks are interested, tomorrow I’ll add the station location attribute to the tile title:

station_location : Kilsyth

So in my case it would read
β€œWeather Forecast for Kilsyth”

Instead of just β€œWeather Forecastβ€œ

2 Likes

Sounds great. Here is what I have been working on so far with some more to go. I have added icons as well.
Screenshot 2022-09-25 154936

1 Like

Help! My logs are filling up with all these debug messages. How can I turn this off?
The weather tile's logging is turned off.

Sorry about that, I’ll fix it today.

1 Like

Looks awesome, are you using a custom tile generator to make it?

Ok, v6.2.0 has just been released:

v6.2.0 - Improved formatting, fixed debug logging and added Station Location to the Tiles

Can you please try v6.2.0 - I couldn't replicate your specific issue, but I have fixed the logging so HTML debug logging only occurs when you enable debug logging.

No, just adding to your driver code. Didn't see that you were also making changes so I will take a look at your changes before going further.

1 Like

If you would like me to add your tile into the driver, I'd be happy to. I'm sure others would like it too.

I'm not a developer, just someone with enough knowledge to be dangerous. :rofl:

2 Likes

Updated to latest code but still getting error (at exactly midnight):

What time do you have "new day starts" set to?

I recommend 12:01 am: