[UPDATED] - Weather Switch - Turn on a switch in response to weather

The Parent is V1.1.0. The Child is V1.2.1. The Driver you have on GitHub is V1.4.0 even though you have “Driver v1.5.0” listed at the top of the thread.

I just removed all of the child and parent apps and will start from scratch. Give me a few to test through.

Yep… the driver version is wrong.
Give me a few minutes… it should be v1.5.0 on Github


I added capability "Temperature Measurement" into the driver and now it's showing up in SmartTiles but there are a few "null" displays"

I’ve uploaded a driver with the capabilities included to the same folder as the other one on GitHub
Also updated other driver to 1.5.0

Please try these


Just loaded the 1.5.0 SmartTiles and now the humidity shows a percentage, but the other “null” fields in the above graphic are still null.

Creating the Apps now.

That’s probably because I changed a few names and some capitalisation

I’ve uploaded my original driver for you to use with smarttiles - this should work ok.

For Weather Switch you’ll need to use the latest driver as the names etc match

I would suggest a virtual for smarttiles and another for weather switch


Here are the steps:

  1. Turned Forecast Hi virtual switch off
  2. Loaded the latest WU driver (without SmartTiles)
  3. Loaded Weather Switch Parent App and then clicked "done"
  4. Went back into WS and created new virtual switch app

Switch is still off even though WU is saying it's 81.


I've got to be doing something wrong, I just can't figure out what.


The app needs a new report for it to action anything…
In other words, something needs to change before it reports (then performs an action)

The quickest way to test is to change from F to C and back again (you might need to force poll)
This will give you two very different numbers and you can try different thresholds to test

Have a look at the log while you are doing it.


Did my original driver work ok for SmartTiles?

Alright, here’s the latest:
SmartTiles - For some unknown reason, when I created a second virtual switch and selected that in SmartTiles, it wouldn’t work. I would get a blank screen with some message error. So I went back to my original WU device, loaded the default driver and SmartTiles is working fine.

WeatherSwitchApp - I followed the same process as above, only I created a second virtual switch using your custom 1.5 non-SmartTiles driver. It seems to be working now. The switch turns on and off based on the programed behavior. I’m going to lay back for a bit so I don’t blow over my number of polls based on my api etc.

So far so good though!

1 Like

So far the app is working for forecast high and low. I'll update you in a few days to make sure it's going well.

Strangely the SmartTiles code won't work:


At some point, my ADD will get the better of me and I'll need to see if I can hack the drivers so I only have one WeatherUnderground device but that'll have to wait.

Great to hear it’s working for you now.

The driver just needs the capabilities put back in with prehaps some ‘sendevent’ statements to use the old variables.
I removed them because they are not being used for WS and my attributes have different names
I use ‘Forecast_Low’ instead of ‘forecastLow’

You can easily make a driver to do both but it would show duplicate reading on the ‘device’ page
(Which is one of the reasons I removed the capabilities)

If you decide to add the capabilities then make sure you still have the version number and namespace intact or it won’t work with WS (the app checks for them)

Actually, you could make it switchable so if not using Smarttiles it would not show the duplicate entries… hmmm… I might think about that when I have some more time


Ok. So later came sooner than I expected. I started playing with the driver and now I have one driver with both SmartThings and Weather Switch. Here's where my ignorance has really gotten the best of me. All I did was add the following:

        //added in for SmartTiles
        capability "Temperature Measurement"
        attribute "city", "string"
        attribute "feelsLike", "number"
        attribute "percentPrecip", "number"
        attribute "weatherIcon", "string"
        attribute "weather", "string"
        attribute "temperature", "number"
        attribute "humidity", "number"

I didn't need to add any sendEvents or any other code. How is this working?


It’s PFM. :wink:

1 Like

I suspect that Smarttiles is querying the driver…

The sendevents are needed for WS to ‘subscribe’ to the events (and therefore act upon them)
Do you have duplicate entries on the ‘device’ page now?


That would explain it. I learn something new every day. Here's a screen shot. And, point-of-fact, the SmartTiles are reading the lower case temperature which isn't accurate.

Back to the drawing board.

As you don’t have the sendEvent statements for the lower case info, it won’t update correctly (if at all)
What you are seeing is probably legacy data

If you don’t mind the duplicate entries then I can probably get this to work for SmartTiles as well as WS

It’s 1am in the UK now so I’ll have a look tomorrow for you.


Get some sleep! This is a fantastic app and I’m so happy you wrote it. I think there are really only 4 items that need a bit of nudging:


I need to step off and get some food and grog. I’ll take a swing at it a bit later (I’m -8 hours from you). I was just focusing on the driver. Now that I’ve taken a bit of a look at the child-class code, it doesn’t seem insurmountable.

I am working on the driver and app anyway tomorrow
I’m going to try to get the driver to compile a sort of “report” so I can get WS to send via SMS or pushover (until we have TTS then I’ll get Sonos to speak it)
I can’t use the built in report (fcctext or fcctext_metric) because I prefer to use a mixture of imperial and metric
In WS I plan to trigger the report with a virtual momentary switch so I can get it any time.


I had a 'play' this morning...

I have added the following lowercase attributes and events

  • feelsLike
  • humidity
  • temperature
  • weather
  • weatherIcon

See how this works for you :slight_smile:



If there is anything still missing, please let me know (and if it works OK or not)


Download the Hubitat app