Give Device Handler a second Auto/Manual switch?


(Chris) #1

As does likely everyone, I have multiple devices in the house that are acted upon based on other devices or conditions, like closing garage if its been open too long or turning off a light if there’s no motion. We are, more and more, finding that we need a way to disable the automation. For example, mowing the yard and want to leave the garage open. For each of these circumstances I have made a Virtual Switch and added conditional statements to check if the Virtual Switch is on before action. This Virtual Switch is essentially a Auto/Manual switch for each switch. This has become cumbersome, and 2 devices for every one.

I would like to build a Device Handler for each device with a separate switch capability or some other way to toggle auto/manual for that device. I’m envisioning a second toggle tile under the device to toggle Auto/Manual. Then I could just check status of that second switch capability in my apps, rather than needing a seperate device.

Is that possible? I’m doing okay at cobbling together custom smart apps, but device handles appear quite vexing. Any help would be appreciated.

Chris


(ActionTiles.com co-founder Terry @ActionTiles; GitHub: @cosmicpuppy) #2

It is definitely possible, but I think it would be great to come up with a “platform standard” way of doing this.

Take a Contact (open/close) Sensor, for example; rather than adding Capability Switch to it, I think it makes more sense for the options to be: auto, override as closed, override as open". That way any SmartApp that already knows how to handle a Contact Sensor wouldn’t need to have it’s code modified!

This would equally apply to any Sensor (Motion … override as motion detected, override as no motion, …, Shock, Leak, etc.).

Some thought would have to be put in place as to how SmartApps are affected by sensors reporting the same value all the time when normally they tend to transition (e.g., it is rare to have an “always active” motion sensor), but I think that this general example actually works fine.

And finally, when the device is set back to “auto” mode, should it or should it not do a “sendEvent()” with the current state of the sensor if it differs from the override value?


(Ben W) #3

You could probably set up a value tile and have the Device handler to check for if is true/false before it runs commands like on/off. It will be more like an ignore commands switch.

You will need to do that for each and every device handler.


(Chris) #4

Agreed, this definitely should exist. However, I’m not sure the options would meet my use case. When toggled to Manual, I need that base device to function manually as normal and kick off any downstream devices that are using it as a trigger. I don’t want to change the state of the device itself, just stop my SmartApps from affecting it.


(ActionTiles.com co-founder Terry @ActionTiles; GitHub: @cosmicpuppy) #5

What?!? :confused:

I’m afraid I don’t understand what you are trying to accomplish. Can you describe an example in detail? Thanks!


#6

Isn’t this possible with modes? Some SmartApps have a condition “Only when mode is…”.


(Chris) #7

Problem with Modes is they are single dimension only. If I want modes for Home/Away, its difficult to have them also for Night/Day, and then even more so to also have Auto/Manual. We really need multiple modes, and then yes, it could be a solution.


(ActionTiles.com co-founder Terry @ActionTiles; GitHub: @cosmicpuppy) #8

Virtual Switches are currently the best way to implement “multiple-modes”. Each virtual switch indicates the state of a mode (day/night, home/away, vacation/stay, … etc.).

We’ve asked SmartThings many, many times to enhance modes, but … no luck.


(Chris) #9

Okay example for a single device. Garage Door. I have smartapps that subscribe to a motion sensor, if there’s been no motion for X minutes, it triggers the door to close. I have another smartapp that subscribes to the garage door, and triggers a light switch or sends a notification.

I want to toggle on/off the automatic closure of the door. However I still want the door to function normally, and its subscribed state should be correct. Allowing smartapps subscribed to it to see the correct state/change, and act accordingly.

Your suggestion of a options to override would accomplish the first, but would keep subscribing smartapps from seeing (and triggering on) the door state.


(ActionTiles.com co-founder Terry @ActionTiles; GitHub: @cosmicpuppy) #10

I’m confused as there are two conflicting statements in the Quote above:

  1. You want to be able to toggle on/off the automatic closure of the door: This is done via a SmartApp.

  2. You SmartApps subscribed to the door or sensor or ? to “act accordingly” … which, in the case of the SmartApp referenced in point #1, is to close the door automatically, no?

##In other words:
Please don’t just say “accordingly”, etc., etc… I’m confused unless you give me the simplest possible answer with the most precision possible. The fewest Devices and SmartApps and conditions. Then we can expand on the scenario / use cases and I can offer my perspective or prospective solutions. Thanks!!!


(Chris) #11
  1. SmartApp1 subscribes to Motion, and closes Door after X minutes of no motion.
  2. SmartApp2 subscribes to Door, and turns on Light on open and sends notification on open/close

I’m looking for a way to toggle 1, but not interfere with 2. Your suggestion of override options as a platform standard would likely accomplish 1 because Door is overridden to open/close. However, it would likely break SmartApp2 because SmartApp2 would not trigger on actual Door open/close change if its overridden.

I accomplish this today with a separate virtual switch called ToggleDoor for Door. ToggleDoor ON tells SmartApp1 that I want it to leave Door open. My current solution, while effective, means I need 25 virtual switches for my 25 devices, or 50 objects when I really only have 25. It gets messy fast.

I’d like to build that toggle into the device handler. Just unsure of how.


(ActionTiles.com co-founder Terry @ActionTiles; GitHub: @cosmicpuppy) #12

If this is the only use case, then my original suggestion would work: i.e., have the motion sensor override always report “active” and then the Door will never be closed by SmartApp1 in this override condition; SmartApp2 is completely unaffected.


(Tim Slagle) #13

Checkout Routine Director (Shameless plug)


(Chris) #14

Not the only use case. In other cases, the automation on the switch is based on non-device variables such as time. Like rearm frontdoor lock after 5 minutes.

I believe my initial approach of adding a distinct auto/manual toggle into the device handler is still correct for my use case. However, I’m not sure how to do that. Does anyone have an example of something similar added to a device handler?

Chris


(ActionTiles.com co-founder Terry @ActionTiles; GitHub: @cosmicpuppy) #15

I can help if you give more specific detailed use cases one at a time…