New Alexa Routines - Using Simulated Contact Sensor w/Webcore


(Rich Heimlich) #1

Guys,

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.

  1. (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.

  2. (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”.

What am I overlooking?


(Kevin) #2

That should be open; and close; for a contact sensor.


#3

Webcore has their own forum and most of the experts hang out there, so in the future you might want to try asking questions of this type over there. :sunglasses:


(Rich Heimlich) #4

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.)


(Kevin) #5

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() .


(Rich Heimlich) #6

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.