[DEPRECATED] Dark Weather 2.0

NOTE: A later version of this app is now available. Please find the link below this initial post and comment there. Thank you.

A common issue I run into is having my lights work during the day if there’s rain or snow. It’s usually dark during these times and it’s nice to have lights. That’s where Dark Weather comes in.

I released this app a few years ago but the platform security and requirements have changed a lot since then. Also, the old version relied on a weather sensor and most don’t have that. As such, I’ve rewritten this app from the ground up.

Dark Weather monitors a switch for weather conditions. The best way to implement this app is via IFTTT weather monitoring to trigger a virtual switch. When the switch turns on, the mode changes to a “rain mode” that you set up. When the switch is off (rain stopped) then it flips to whatever mode you choose. When that happens, you can choose to have lights turn off. In addition, the app will not leave “rain mode” after sunset. This is a fail-safe so if rain ends during the evening, you’re not taken out of your normal evening / night mode.

The recommended setup is as follows:

  1. Create a virtual switch.
  2. Set up IFTTT to turn the switch on when there’s rain and to turn it off when the skies are clear.
  3. Set up the app to monitor the switch.

To install the app:

  1. Visit the app on GitHub and copy the raw code.
  2. Log into the IDE.
  3. Click My SmartApps, New SmartApp.
  4. Select the “From Code” tab.
  5. Paste the code into the box.
  6. Publish the app and then install it via the app.

I’m happy to hear any feedback or questions on this. I hope you all enjoy it.


interesting app. Any chances this would work with my Bloomsky weather station? The Bloomsky recognizes when it is raining and it has a lux sensor that possibly could be used to trigger your app based on light conditions.

Hello Aaron,

I have been playing with my SmartWeather Station Tile and trying to use Lux to turn on/off my light but haven’t found a nearby weather station that consistently displays Solar Radiation which I am told is required or I can just use my zipcode, which is about 4 miles away and based on my physical location, can be a lot.

Can I use your app w/o my own PWS?
And for the record, I am not sure how to install/setup ITTT

Current using the “Rain is Coming” SmartApp to tell me to shut doors/windows but that is also based on my zipcode

Would be nice to consolidate to 1 app and get something more reliable


Does the Bloomsky integrate with IFTTT? If so, that’s the easiest way to go. Have it trigger the switch to ON.

Hey Rick.

Your best bet is to set up an IFTTT recipe: When conditions are rain, then turn on switch X.
Switch X would be a virtual switch on SmartThings, which is the trigger for Dark Weather. This is all based on your ZIP and not a PWS. But you can use any ZIP code so if you need something closer, go for that.

Hope this helps.

It does work with ifttt but it does not use the lux sensor as a trigger in ifttt. It does work with the rain sensor and I have that set up. The lux would be nice on a cloudy day in which it isn’t necessarily raining.

Thank you for this! Been trying to find a easy interface and this is just what I need!

Hey Aaron,

Can you walk me through all the steps here as I am not a programmer and so far i’m stuck

  • Got the code installed in the IDE as a smart app, no issues, saved and published for me
  • Went into the Android app, market place and in my apps, found dark weather and assigned it to the new VS i created in the IDE

Here is what my SmartApps shows and this is where I am stuck


I created my IFTTT account and setup a recipe based on weather to flip the VS I created. @bamarayne helped me this far, thanks Jason

Now I am trying to understand how the Dark Weather app plays into this. Basically I could use some context around how it works and what else I need to do… like setup new modes or anything else

Sorry to be a pain but I just can’t get my mind around this yet
Thanks, Rick

1 Like

Rick, I’m not Aaron, but I’ll try to help you out the best I can because it took me a little bit to figure out what worked for me also.

Basically, I created a virtual switch that only turns on my outside lights (in my case I did not set the virtual switch to turn off the lights since the Dark Weather app will take care of that when necessary). Next, create two modes that differentiate between rain and no rain; for example, I created a “Rain” mode and a “Clear” mode. In the Dark Weather app, choose your virtual switch as the trigger (in this case for IFTTT) then choose your new “rain” mode for the mode to change to when it rains. Next, choose your “clear” mode to change the mode to when the rain is gone. Optionally, if you want your lights to turn off when it’s “clear” outside then choose which lights you want to turn off (after sunset this option is ignored so your lights stay on after dark). Finally, choose which modes you want the app to work in.

It may not be the most elegant explanation, but I hope I’ve made sense of some of it.

Thanks to @ndavis82 you should have the answers @Toy4Rick. He’s exactly right. Here’s a TL;DR of the recommended setup:

  1. Install virtual switch and link it to go on and off via IFTTT.
  2. Make sure your house has a Rain Mode. This should be a mode where your lights turn on with motion or some other mode where you want things to happen when it’s raining out.
  3. Set Dark Weather to switch to this mode when the virtual switch is triggered, and set it to your normal daytime “home” mode when the switch is off.
  4. In the settings be sure to have it run only in Home / Daytime and in Rain Mode. Add additional modes as you see fit.

That should do it. I hope between the two of us, this makes sense.

Let me know if there’s any other issues.

OK here is where I’m at

  1. I have my IFTTT recipe created to turn on the VS I created in ST
  2. In the IFTTT SmartApp in the ST app, for the “Which Switches?” section, I selected the VS
  3. In the DW app, in the “Choose a switch to trigger the change” section, I chose the VS, is that right?
  4. Set when it rains to Rain mode, when it’s clear to Home mode and I set the lights to turn off as well, then “Set for specific modes” is set to home

Question, what is actually turning on the living room light? I don’t see where that is set yet

Next, how can I test this? Currently it’s night time and tomorrow it’s not supposed to rain

Thanks again


This is an interesting app and I like the concept of it.

I have a couple of request…

First, background. I have my system set up on seven modes. I wanted the system to always change into the correct mode based on when it leaves the away mode. I think this app has the same basic concept.

What I did was set up a rule in CoRE so that when the system leaves away mode it goes into the appropriate mode based on the time and day of the week.

I would like to have the option the following options added.

When rain is coming have the app change into rain mode, or turn on a virtual switch, or run a routine.

When ask clear, have the app either turn on/off a virtual switch or run a routine, or set a mode.

What do you think?

Rick: The lights are being triggered to turn on by motion in the rooms where you are present. Essentially “rain mode” is a mode that should mirror your evening or night modes where lights in rooms turn on when you are there and turn off after X amount of time. When I set up “lights on with motion” rules in my home, I add “rain mode” to the modes where that should work, in addition to “evening mode” and “night mode”. Checking that 1 extra box in the setup of those rules is all that’s needed. :slight_smile:

Jason: that’s surely interesting and a suggestion I can take under consideration. I’m no ace coder so I can’t guarantee I’ll be able to implement all these conditions. However, turning on a switch upon changing modes should be the easiest to implement.

One suggestion in the interim is to link the IFTTT virtual switch (A) to a second virtual switch (B). Then set up a rule where A turns on, B turns on. Then B has a smart app linked to it to execute what you need. I totally understand that it’s a LOT of chaining of triggers and such and it’s far from elegant.

I’ve noted what you’re looking for and see what I can do. Also, the code is freely available on GitHub so feel free to check it out and tinker with modifications.

Thanks for checking out the app!

1 Like

Does this app still work with the current version of SmartThings?

Yes still works great!

Lately when the dark weather switch is getting turned off, its not switching back into my designated mode.

Anyone else having this problem?

This is interesting I have a need to monitor expected frost days. I’m guessing a similar setup will work?

I get this error message when I paste the raw code: “Java.lang.NullPointerException: Cannot get property ‘locationDTO’ on null object” Any idea why that might be?