Vacation Mode / Randomize Lights?

I am new to Smartthings, but am struggling to how to randomize lights during a specific time period when i leave the house. I am using Leviton lights and Leviton app has a home and away toggle. Ideally, it would be great to have that switch toggle back and forth based on my location with smartthings, but this is not an option. How to i randomize certain lights when i’m gone. Any help would be appreciated.

Hi @mike5256 ,
I’m adapting a smartapp to run one or more selected lights on-off randomly.
It is executed manually, programmed or from an automation that triggers it when the desired conditions are met, location mode, presence, in a specified period of time … and stops when other conditions are met with another automation or shutdown time delay from the automation itself.
It’s almost done, but I still have to debug it and test a little more.
In a few days I will tell you something

1 Like

Do you have an Alexa device? Guard will randomly turn on and off lights when you’re away.

2 Likes

I"m sorry, as I am still a little new to this. What exactly is guard? Do i install with Alexa? Or with smartthings? or both. sorry…really still new at this

Still new at this, but how does this get incorporated into Smartthings? I thought they stopped all non approved add ons?

If you live in the United States, it’s a built-in feature with Alexa. There’s a free tier and then paid tiers if you want more features. It doesn’t have anything to do with smartthings, it will work with any lights which are controlled by Alexa. It figures out your normal usage patterns and then re-produces those with some randomness thrown in.

Here’s a good how to article. For further questions, contact Alexa support.

Not yet available in all countries.

You can still write your own custom code for yourself, and even share it with other people. There’s just no longer a “marketplace“ section in the app.

There’s a whole section in the forum for people writing custom smart apps and device type handlers:

@mike5256 , It is not difficult and with the help of people from the community we all learn what we need.
You can start by entering in the smartthings page (IDE), with your samsung account and enter to Developer tools:

https://account.smartthings.com/

You will access to your devices, Hub, … in “Documentation” you have very useful information about what this page is, what can be done and what are the Device Handlers (DH or DTH), smartApps …
If it serves as a reference, I discovered it last October, reading in the community. Although it is said in the forums that this year it will disappear and hopefully replaced by another, it is incredible how easy to use and useful it is.
The links of the forums, which @JDRoberts put, will be very useful.
If you are interested, as soon as I have the app well debugged, I will tell you all the steps you have to do to install the app in smartthings and use it.
So far it works very well.

2 Likes

Awesome. Thank you!

Curious. I was able to add vacation light director from something I found, but not sure it is working? Is there a more current code? Or is it scrapped

@mike5256 ,
SmartApp “Random lights on-off” turns ON and OFF at random Intervals, one random device in every random Interval. You can select one or various lights or devices with “swicth capability” of your location.
This APP was created as modification of the original code of public SmartThing, SmartApp “Gentle Wake Up”

I put the link to a pdf guide when explain how to use the app:
https://github.com/Mariano-Github/Smartthings-smartapp/blob/main/SmartApp%20Random%20Lights%20on-off%20guide.pdf

If you are interested, I put the links to the smartApp at end of the steps to install the App in IDE:

  1. Copy the SamarApp code of the link
  2. Open your IDE page
  3. click on “My SmartApps”
  4. Click in “+ New SmartApp”
  5. Click in “From Code”
  6. Paste the copied code in the link into the blank app
  7. Click “Create”
  8. Click “Publish” and "For Me"
    (If the device handle “Gentle Wake Up Controller” has already been published for you, the following steps are not necessary)
  9. Click in “My Device Handlers”
  10. Click in “+ Create New Device Handler”
  11. Click in “From Code”
  12. Copy code from link “Gentle Wake Up Controller”
    https://github.com/Mariano-Github/Smartthings-smartapp/blob/main/Gentle%20Wake%20Up%20Controller.groovy
  13. Paste code and Click in “Create”
  14. Click “Publish” and "For Me"
    You are now ready to install the SmartApp in the SmartThings App as explained in the pdf guide.

In IDE “live logging” can see how calculate the next random interval and device controlled.

I have tested it a lot and it works well, if this is worth it, I’m glad.

1 Like

I installed your smart app and the “Gentle Wake Up Controller” DTH. I was able to create a randomized automation. A virtual switch showed up in the android mobile app but I can not open it. I get and error [Can’t connect to device. Check device and try again] when I try to open the device. Also t! here no on-off button on the tile like I see in you screen shot.
I can create and automation with the randomized virtual switch and operate it from the automation.

@Paul_Oliver ,
I don’t know what happened, it’s good for me, I have 2 now and I did several in the tests.


the controller is created in the cloud assigned to your location, it does not have to be assigned to the hub.
Open the Virtual Controller in IDE, it has to be like this.


Check that the DTH is published for you and the assigned DTH type is the one you created, the one at the bottom of the list. There is an identical one in the official list of Smartthings, with that it doesn’t even work.
Try change the versión of DTH to “Draft”, this do that DTH allways is the created by You.

I will see more things

My entries looked just like yours, but I had no control button and was getting errors when I tried to open a tile.
I tried toggling to different device handlers as you suggested, and I was able to get rid of the errors, and temporarily added an on/off button. But when I closed and reopened the ST mobile app the on/off button were gone.
So I started to look at DTH for virtual switches and I saw some differences. So I did some minor copying out of the virtual switch DTH and pasted them into the GWUC DTH, and that fixed my problem after toggling the DTH again. I created a new random switch after the changes and it also works.
The following screen shot shows my changes.


I know nothing about coding and this was just stab in the dark that worked. I suspect that 2 or 3 of the items I pasted in the DTH were not needed, but I works, so I did not make any further changes.
Thanks for your help.

1 Like

I’m glad it works for you!
I think if you delete all changes in DTH, it will work too.
Now I’ve seen that you already created it other virtual controller. :+1:
When you use it, if you see something that can be improved in the app let me know and we will try to do it.
regards

Fantastic…i will try this tomorrow. Anything i need to be aware of? Any issues with this as of yet?

@mike5256 ,
To me, works perfectly.
In the previous posts, @Paul_Oliver he had some trouble creating the virtual controller, but then it worked fine.
if you have any problem tell me.
Important, do not forget click on publish for You.

I think i have it setup. I am using an automation to control the devices named Random Lights. A few questions. If I add my if and then statements, how do i do only from sunset until let’s say midnight? I just need to test this now.

Hi @mike5256 If you edit the previous post, it doesn’t tell me the answer and I didn’t see it until now. Click reply better.
You have 2 ways to do it:

  1. In the same automation you can put automatic shutdown after the time you want.


  2. Creating another automation with a shutdown conditions at the time you want.

    Regards

@mike5256, if you are from the US, UK or South Korea and using an Android phone, then you can have a look at this:

It is a revamp of some of the old Groovy SmartApps.

Especially the “No worries while away” and “Gentle wake up”

1 Like