Setting a contact sensor's value

Hi all! I was wondering how do you set the value of a contact sensor like “open” or “closed” from a smartapp?

You can’t. The sensor reports its value to the hub. Most sensors don’t accept any incoming commands except a request to report their status. Or reconfigure their timing parameters and sensitivity.

However…

You can use Mike Maxwell’s universal device type to have a switch appear to be an open/close sensor so you can create a virtual contact sensor that you can control, if that’s of any help.

1 Like

thanks that is exactly what I was looking for!

2 Likes