Virtual Contact Sensor with Switch activating in Alexa app but not triggering routines?

As per title, I use the Virtual Contact Sensor with Switch DTH to add virtual switches into Alexa to act as a contact sensor to trigger routines. It seems to be very hit and miss lately and at this point in time has stopped working entirely...

The strange thing is, the Alexa app sees the switch turn on, but yet the routine isn't triggered by it - I seem to remeber something like this happening back in the Smartthings days and the issue was with Smartthings and not Alexa?

Does anyone have any ideas/workarounds? This used to all work ok, but now it is very hit and miss or just does not work at all. If I disable and re-link my Hubitat skill in Alexa, I assume that won't cause any issues and previously added devices will just return?

Many thanks in advance

Just disabled and reenabled and now the skill won't link stating 'unable to link at this time' jeez...

Other people have had issues authing apps recently as well, seems to be an issue with the HE OAuth server. Once logging in though that issue would not cause the main problem you are having. Just keep trying periodically with the login and others have said it worked eventually.

For your original issue, did you confirm if the state of the switch and contact atrributes changed on the device in HE? Possibly only the change of the switch made it to Alexa and not the contact state? That would explain the routines not triggering.

Are you trying to build a lot of automations in Alexa or just control some devices that you cannot bring into HE? Any devices you have available in HE I would put all the rules directly in HE.

1 Like

Many thanks @jtp10181 yes I kept trying and it did work when I forced closed and reopened the Alexa app.

Re. The main issues, logs show that the contact is also closing when pressed (closed being the on state in my configuration) and yes, I'm using it to trigger a 'Blisslight' Sky Lite Evolve which does not have a Hubitat integration as far as I can tell.

It's a strange scenario, as mentioned Alexa sees the switch state change, but only intermittently will register the 'close' part of it.

Again, I recall a similar problem back in the day with smart things and it was to do with a platform update that caused issues with the DTH, no idea if that could be the case again here. As technically I don't need the switch part(though it's very useful when testing!), maybe I'll switch it to a virtual contact sensor DTH and see if that works...

Yeah true you only need the switch part if you want to be able to turn on/off from Alexa, otherwise just a virtual contact sensor would work if you only need to pass the info one way from HE to Alexa.

If we had some sort of logging options on the Alexa integration it would make troubleshooting easier but its basically a black box, no one knows what it is doing internally and it doesn't give you any feedback :frowning:

Using a virtual contact (or motion) with switch combo to allow Hubitat to trigger a routine in Alexa has been that standard procedure for years. However, about a year ago some of us started observing it isn't as reliable as it used to be.

When I encounter that problem, I convert the virtual device to simply virtual contact with trigger on open/close, and it works 100% of the time going forward. I can't explain why, and also note that I still have some dual capability devices in place that I haven't caught not working. With Alexa, there's always a function of randomness in how she behaves.

2 Likes

Thanks for this, @HAL9000 I'm about to try the same thing as I don't technically need the switch side for this particular automation and I can get WebCore to push the 'close' (for 'on') command I need. Will feedback!

1 Like

...yup, it works well with a virtual contact sensor only. No idea, what's going on with the sensor with switch DTH. :+1:

2 Likes

Sorry .. dumb question what driver is that ?

The built-in virtual contact sensor which I then on the Alexa routine side trigger on open/close.

Typically, on the HE side, when I want to tell Alexa something, I "open" the contact, and wait 8 seconds and then close it. The open triggers her routine to do whatever, like start my vacuum cleaner.

I use this driver seems to work .. Alexa seems to see it .. and is usable.

image

1 Like

As I said, that driver or the similar one that combines contact with switch is what many of us have used for years, and I continue to have some in use. But in the past year or so, they have become less reliable whereas the single capability driver always works.

1 Like

Yup, same experience here, some work, some don't - alexa always sees the device, but for some reason, routines often won't trigger after the devices activation, even though Alexa sees the device state change - it's very strange.

I'm in the process of updating all of my 'with switch' virtual sensors to the single capability virtual sensors for this reason.

Ah .. I see .. same one I use ?
Because I could not get alexa to "see" or "use" a virtual driver.
So I found this and it worked .. weirdness how some devices act so different ¯\(ツ)

Alexa will see a virtual contact or virtual motion sensor just fine. Just remember to add it to the Amazon Echo Skill on the Hubitat side and ask Alexa to discover devices.

If what you have is working for you, though, I'd leave it.

I am having the same issue and I'm trying to convert my "with switch" to a contact sensor and using the Mirror app to change that contact sensor. The mirror app will not change the contact sensor even though the event on the source switch shows that it's triggering the mirror app. There is nothing in the logs (nor any settings for logging on the mirror app). Anyone run into this issue?

I created a manual rule to do this mirroring and that is working but would be nice if the mirror app worked as it's an awful lot of work to get one switch working in Alexa as is.

Maybe you are trying to solve a different scenario than I, but I just changed the driver virtual contact with switch to virtual contact. If there are any places on the Hubitat side that addresses the device as on/off, I changed to custom command open/close. On the Alexa side, I think things stayed the same as it was always treated as a contact in routines.

I am solving the same issue, I just still wanted a switch so I can also expose that to Alexa and control it with voice commands. Therefore, I needed a way to keep the switch and contact in sync, hence I was going to use Mirror as suggested in another thread. Since that seems to not work per its design, I created my own rule to do exactly what you said, change the contact when the switch changes - it's just one more thing to mess around with creating another custom rule.

Therefore, I have both a switch and contact, both exposed to alexa. To make everything stay in sync, when I give the voice command to alexa, it's to the virtual switch, which then via custom rule flips the virtual contact, which then triggers alexa. It's quite the Rube Goldberg approach but it seems to be the only way that works now given the contact+switch stopped working.

I think the mirror app is only designed to mirror like states from one device to another. I have never heard of it used to mirror a switch to over to a contact sensor. A custom rule, as you found, is the way to go.

Custom mirrors were introduced in platform 2.3.6. This should work, but I think there's a problem, and I have an idea of what it is. Mike will investigate.

2 Likes