Please
How do I make a virtual device flip the states of a virtual simulated open/ close sensor
I know of two different ways to do this, but there are probably more, so hopefully other people will chime in as well.
Use webcore. You can ask for help getting this set up in the web core forum. This will give you the most options and will allow you to have a separate virtual switch, if you really want that kind of set up.
CoRE (now WebCore) is a very powerful community – created rules engine for SmartThings. It allows you to set up stacked conditionals like “If A then B but only while C and not if D.”
Setting it up can be quite complex, but there are many community members who will be glad to help you.
For example, here is a piston that one member created to notify him if the dog had already been fed twice that day and he picked up the dog bowl for a third time. He needed this because he has a large family and people didn’t always remember whose turn it was to feed the dog.
[image]
The original version of CoRE Has now been replaced by a new version, WebCoRE, which moves the data entry to a web interface. This allows for flexibility and an architecture that requires more memory than is av…
use a custom DTH for a virtual contact sensor which also has capability.switch so it will show up in your list of switches and can be turned on and off.
@bjpierron Has already created one of these. You can find it in the thread which discusses the new Amazon routines feature:
I combined two device handlers into one, so that the device can be triggered like a switch (I used it to turn the switch on when I arrive home, and off when I leave), but is also recognized in alexa as a contact sensor so that it can trigger an alexa routine. I only put this together as a proof of concept, so the code can probably be cleaned up, but it appears to be working.
The two device handlers I combined were the simulated switch:
and joshualyon’s simulated contact sensor:
Result:
/**
* Copyright 2015 SmartThings
*
* Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except
* in compliance with the License. You may obtain a copy of the License at:
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by a…
1 Like
I’ve been trying all day without any luck but eventually found this
erocm123 : Virtual / Physical Switch Sync
and this works perfect for what I want, I can now control unsupported devices such as Broadlink etc.
Thanks for the help
2 Likes