I searched through prior posts and there isn’t a clear answer, I’m trying to replace my SmartThings virtual devices (Simulated Alexa Switch/sensors) with HA.
The equivalent to bjpierron’s Simulated Alexa Switch, device class, which uses SmartThings IDE and allows you to create devices that Alexa recognizes as a switch and sensor. So it’s a virtual device on SmarThings side with two entities, an on/off switch, and an open/closed sensor.
The key is that the switch and sensor are virtually synchronized, so that if the switch is on, the sensor reads open, and when the switch is off, the sensor reads closed.
My use cases are for Alexa, but no reason it couldn’t be made compatible with Google Home, and provide a switch which Alexa can turn off or on, and a sensor that can be used to trigger routines.
Example uses:
Any device that can’t be directly integrated into HA, but does have Alexa compatibility.
- I have a Wyze door sensor, when the sensor is opened, I trigger a routine to turn on the virtual switch, and when the sensor is closed, I trigger a routine to turn off the virtual switch.
This automatically changes the state of the virtual devices sensor (switch on → sensor open, switch off → sensor closed).
This would allow the two way control/communication between Alexa and HA, allowing HA to “see” the state of the Wyze door sensor.
- I can use the virtual device to trigger Alexa routines. By exposing the door sensor entity of the virtual device, I can then use the new Alexa sensor as a trigger for any routine. By setting the switch on, the door sensor entity would open, and any Alexa routine using the virtual sensor would be triggered.
The key part is to have the ability to create these virtual switch/sensor devices, and have the state of the switch and sensor be synchronized automatically, no automations needed.
The github repository for the Smartthings device is here: