I’m loving the new Alexa capabilities, but I’m trying to get something working I thought should be easy, but isn’t as simple as I first thought apparently.
(Solved) I’m trying to test flipping the state of a virtual sensor with webcore (so that Alexa can work from it) and can’t even get that far.
(Solved) The Alexa Routine is paying no attention to the state of the changing virtual device (see post below).
I have a virtual device I’ve created called Contact Sensor and it’s set as a Simulated Contact Sensor.
Then in Webcore I have the following simple code:
execute
if
Office Light changes to ON
then
with
Contact Sensor
do
Turn on;
Wait 20 seconds;
Turn off;
end with;
end if;
end execute;
Pretty simple. However the virtual Contact Sensor refuses to change state. It stays “Closed”.
Thanks Kevin. I guess I’m confused as I see no option in Webscore for this device to set it to open and close. Under Do in the webcore UI I see “Commands available to all devices” and open/close isn’t one of them.
(Also, thanks JD. I’d have posted this to Webcore, but suspected once past this it may evolve to more Alexa and ST than webcore.)
Double check that the device type is "Simulated Contact Sensor’ in ST IDE. Then in WebCoRE that sensor just has 3 commands for me at least: open, close, and ping() .
Thanks. I’d made the changes in ST IDE and didn’t push it to Webcore so Webcore still saw the device as a switch and not a sensor. Doh. Your post triggered me to go there to check. That did it. The Contact Sensor is now switching between Open and Closed which I believe is all we want.
Testing the Routine in Alexa causes it to speak the desired phrase, but I can’t seem to get Alexa to pay attention to it.
My Routine there says:
Enabled
WHEN
Contact Sensor opens
Set volume to 10
Say “Test”
Set volume to 5
So it turns out that ANY changes made to the simulated sensor REQUIRE (as far as I can tell) that you got into the Alexa app, Skill and Disable the SmartThings skill, re-Enable it and then re-log in and re-Discover all the devices. It shouldn’t be that complicated, but perhaps down the line it’ll get easier.
FYI I was just trying to do the same thing and couldn’t get it to work. I found this thread and figured I would give your solution a try and it worked. So it has not gotten any easier.