Modes as switches?

modes
shm

#1

Hi, just wanted to see if anybody else is using switches as “Modes” like me. I have just started to refactor from Modes to my “Home Modes” switches.

One problem I have with modes is that I can only choose one at the time.
So one ‘mode’ in our house could be (example):

Kids Sleeping Downstairs + Being outside front yard

Kids Sleeping Downstairs:
Will then inflect how the automatic light control behaves downstairs, eg. the hallway light will never turn off, only dim down to 1 %.

Being outside front yard:
Will inflect when to nofity on motion outside front yard (if we are outside - don’t notify)

If I should use Modes only for this, then I would have to create a Mode named like “OutFrontKidsSleep” (Modes are length restricted!).
But what if we also worked in the backyard? What if we have guests in the house also at the same time? Then the automation in our house should behave a bit differently according to that also.

Thats why I have created simulated switches instead like so:

Then in webCoRE I normally just include the switches in some kind of logic or restriction.

I have then created 3 simple (in built) modes:

Away
Home
Sleeping

So now the mode can be “Away” - but my Home Mode switch “Guests at Home” could still be ON - then that would give one kind of behaviour. (Eg. don’t turn on SHM alarm on)
Or “Away”, but still with Guests at Home and Kids Sleeping Downstairs - would then give another behaviour.

The Home Modes can either be toggled in the Room section or in some of my Routines I have created (turn on/off switches).

That is for me, way more module and scalable than just having a thousand different modes.

Don’t know if anybody else is using it like this.


(Andy - United Kingdom) #2

@SLKDK
I use modes only for morning, evening, afternoon & night
Everything else is using virtual switches!
Guest Mode, Dogs at home, walking Dogs etc - these are all kinds of ‘Modes’ which make ST do things differently.

E.g. ‘Guest Mode’ when this switch is on different lights dim instead of switching off etc.

‘Dogs at home’ means I can’t use some motion sensors and they are ignored

‘Walking Dogs’ is our most secure mode as we are all out and don’t have the added security of the dogs barking and preventing anyone getting in…

When I write a smartapp, I ALWAYS include an enable/disable switch for the app.
(I.e If this switch is off - don’t run)
I use these ‘Mode’ switches to also control these

So… YES!
Virtual switches are MUCH more useful the modes


(Robin) #3

Yup… virtual switches are great!


(Anthony Genovese) #4

How did you get those custom icons?


(Robin) #5

now that would be a trade secret lol

Edit: give me a sec :wink:


(Robin) #6

@agenovese820

This option can be turned on by adding the following code to the main tile on each DH:

canChangeBackground: true

For example:

standardTile(“switch”, “device.switch”, width: 1, height: 1, canChangeIcon: false, canChangeBackground: true) {

Or

multiAttributeTile(name:“switch”, type: “lighting”, width: 6, height: 4, canChangeIcon: false, inactiveLabel: true, canChangeBackground: true){

If you just want to turn on the change icon option then add / edit the following code instead:

canChangeIcon: true

If either canChangeIcon Or canChangeBackground are not stated in your code, Smartthings will defult to ‘false’ and neither option will show in the device preferences page.

An easy shortcut if you’re not planning to change the images very often is to temporarily change the device type to presence sensor, set the image and then revert to your regular handler. The image sticks when changing handler types.




Down side of both methods is that the images wont display within the dashboard favorites view :angry:


(Ron Talley) #7

Um Ron Talley, please leave this page now and don’t look at the code… I said no looking!!! Dammit Ron!!! Arrrggg leave NOW!..But but but…Look how cool @RobinWinbourne icons are!


(Robin) #8

Happy ST cake day lol


(Ron Talley) #9

Dammit, you sucked me back onto this page…Quietly peeking at the code…

Thanks! Saw it this morning and was like, “Well well, what do we have here?” Cake for me!

Now…canChangeBackground: true…


(Robin) #10

What sucks is that most images are too large and you cannot pinch out far enough to avoid cutting off the edges:

You have to put them into paintbrush and add more white space to the borders in order for them to fit.

EDIT: Sorry for the hijacked thread… back to the awesomeness of virtual switches as modes!


(Ron Talley) #11

This will take me forever. I have way too many devices to try and go and redo all the icons. Well…maybe just 1 or 2 in the Bedroom…? :smiling_imp:

Oh so I won’t be too far off-topic, The Bedroom Automation is a Virtual Switch that I use for my Bedroom Automations. Some of my Pistons have the restriction, “If Bedroom Automation is On”. This way, I can simply tell Alexa to turn off Bedroom Automation and things that rely on that switch to be on, stops working until it’s turned back on. Way better than Modes IMHO. Each room in my house has one of these switches as well as the Garage Door and HVAC System…Well Outside too.


(Robin) #12

Btw… won’t work for contact or motion sensors :frowning: