Vacation Lighting Piston


#7

Here’s how I do it for a truly random result… Radom waits and random toggles for each individual light.

Lights turn off at end of time restriction or if alarm is disarmed.

Last block checks to see if random events have accidentally turned everything off (not very realistic) and turns on my hallway light if that is the case, so at least one light is on all the time.


#8

So if I wanted to modify yours @Robin for a vacation mode, I can change your SHM status to a vacation mode, change your dimmers to my lights and really only need the first IF/THEN/ELSE and don’t really need your second IF block?

Does your first IF block turn off the light/switch by the “random toggle” command?


#9

The first IF block random toggles so yes, it will turn off as well as on, it’s just random in regards to choosing on or off.

The second IF block is just there to reset lights to off when SHM is disarmed.

The ‘on events’ at the end ensures at least one light (I chose the hallway light - dimmer 9) is always on, so if a random toggle turns off the last light, dimmer 9 will turn on… a black house is an empty house.


#10

This is great, but is there any way to group lights together? Most of my fixtures have multiple bulbs so I want them to toggle together.


#11

You should be able to group lights within each ‘with’ statement and have them all toggle together.

Or you could throw the smart bulbs in the bin and get proper switches lol


#12

They are grouped together in the with statement, but the random toggle acts on each light independently.

I do have some, but there are many reasons NOT to use a wall switch.

  1. I am mostly using Hue bulbs and Sylvania Smart+ adjustable color temp bulbs since I want that adjustability. So at best the switch is a waste of money and an added complexity in writing pistons and simply would not work with default SmartThings automations.

  2. Some of my wiring does not have a neutral so would require re-wiring.

  3. Even the best dimmer switches do not always work well. There are a lot of compatibility issues with LED bulbs even those that say they are dimmable.

  4. The switches are often much more expensive than bulbs, so for lights that are only being used for automated task and you never use a physical switch why waste money. I can get a quality Zigbee bulb for $12. A good switch and dimmable bulb is $50+. And that’s assuming you already have the proper wiring or wiring for a switch at all.


Execute Routine at 8 PM +/- 15 minutes
#13

I found a solution.


#14

Robin, doesn’t your program have the potential to leave a light on all night long? If the last Random Toggle for a device before 10:30 pm turns a light on, won’t it will stay on all night until the program resumes the following day at sunset?

I used some of Brandon Pines similar code in dct7c (below) to toggle lights on and off. I “overlaid” this WC logic on top of ST Smart Lighting which turns on some living room lights an hour before sunset. WC starts toggling after the lights have been turned by ST, so I know the first toggle turns them off. A second toggle will turn them on, so it is possible that a light will be on at the end of the execution time window.

To prevent a light from staying on all night, I added a “cleanup” chunk of code at the end (after the expiration of the last possible wait period) that walks through all the WC random controlled devices and turns them all off about a minute apart. It’s just a little bit of insurance to avoid lights on all night long.

dct7c


#15

The ‘else’ section from line 56 is there to prevent lights being on all night.


#16

I see that now - outside the random timing window, turn them off. Thanks. Missed that before.


#17

I tried to import your posted vacation lighting piston eqs6 but it I receive an error. Is this piston no longer available?

Michelle


#18

Works for me… so the backup is alive in the cloud… was worried for a second as @ady624 dumped 26GB of data last week (fuel streams).

What process are you using to import?


#19

I tried again to create from backup code using a laptop vs my ipad and the piston loaded. Seems to be an issue using my ipad. First time that happened to me. Thanks for confirming it worked.


#20

My take on this. Cleaner code!


#21

@Robin, awesome piston sir! Just what I have been looking for. Thank you!


#22

hi, how do I copy this piston when its a png file?
Im just getting into webcore and pistons for Smartthings

/andreas


#23

It is quick and easy:

+ New Piston
pic
Then use the import code found at the top of the PNG


Pro Tip:
Go slow during the import process, because it may prompt a few questions.
(I like to see the current PNG in one window while importing in another)


#24

Super thanx for the Quick reply


#25

I got through installing webcore👍
I have 2 question regarding this piston, is I want the simulation to terminate at 11 pm (23.00 in Denmark), should I change time from 01.00.00 to 00.23.00?

If I change the name fof a light device, vil I have to go into the piston and update every devicegroup or is there a way to do this easier?


#26

HomeAway%20Lighting1

Are you wanting to change the time as above?

If you change the name of the device in ST, then it should automatically update the name in your pistons. I’m not sure how long it takes for the names to update in webcore, but it does eventually happen. At least it does for me (after several minutes).