SmartThings Community

Programmatically Close Simulated Contact Sensor?


#1

Is there a way to programmatically close a Simulated Contact Sensor? e.g. via a Routine.

I want the contact sensor to close whenever a Simulated Switch is turned off.

Thx


#2

Super easy: you just have to use a DTH for the contact sensor which also includes capability.switch. That way when the switch is turned on, the contact sensor is open. When the switch is turned off, the contact sensor is closed. :sunglasses: See the FAQ on the new echo routines: it uses that kind of device.


(Ron Talley) #3

I know I am getting lazy and you know that I know how to cook this up but I am actually a little confused here…

Are you suggesting that there is a way to directly tie this in without the use of an app like webCoRE or SmartLighting? I see how adding the capability.switch in a simulated contact will allow it to be controlled locally via SmartLighting but would’t that be a custom DTH that forces it to the cloud?

I am super curious here.

Thanks as always @JDRoberts


#4

Yeah, it’s not going to run local, but I don’t see anything in the first post that says local. Did I miss it? Because it mentions routines, and those don’t run locally either.


(Ron Talley) #5

No, I was just thinking out loud and had an ah-ha moment. Was seeing if it was a way to mirror open/close with switches locally for my own stuff. :thinking:

Also still curious if its a way to directly associate this without the need of an app. I believe you inadvertently taught me how to do this with physical switches using a minimote.


#6

“Z wave direct association“ is limited to physical Z wave devices, you can’t use virtual devices because the message is sent directly from one device to another without going through the hub.


(Ron Talley) #7

Dang, I though you were going to make my day! :disappointed_relieved:

@ucdscott, I use webCoRE and setup a rule like such:

If simulated switch changes to on
Then with simulated contact
Open

If simulated switch changes to off
Then with simulated contact
Close

You can use webCoRE to cook up whatever rule you like to open/close the simulated contact.

Changing to a DTH with capability.switch as @JDRoberts stated, you should be able to mirror the simulated switch with the simulated contact because SmartLighting would see it as a switch. Smart @JDRoberts!