The Vera Community forums have moved!

General => Connected Objects => Amazon Alexa => Topic started by: gabayarden on February 07, 2017, 06:51:36 am

Title: Alexa with virtual switch
Post by: gabayarden on February 07, 2017, 06:51:36 am
Hi,
I have two scences, one will turn off the TV, the other one will turn on the TV. (I am using broadlink RM for that)
I added a virtual switch so Ill able to control the TV, so when the virtual switch will turned off the turn off scene will be triggered and the same for turn on.
The problem is that alexa is not recognized the virtual switch device. When I click on discover all devices, the virtual switch is not in the deviced list. I tried to forget all the devices and also the Vera skill but it did not helped.
I know that alexa can detect virtual devices because it detected the Vera mode device.
Hoow to configure the virtual switch so Alexa will able to find it?
Thanks ;)
Title: Re: Alexa with virtual switch
Post by: Sorin on February 07, 2017, 07:12:40 am
There is a chance the virtual switch will be recognized by Alexa if you can change the category and subcategory to a known one.

http://wiki.micasaverde.com/index.php/Luup_Device_Categories

Title: Re: Alexa with virtual switch
Post by: shallowearth on February 07, 2017, 07:12:37 pm
I updated the vswtich code to reflect category 3 and it was still not offered as a switch as part of the process to select devices to add to Alexa.  So simply updating the Category and SubCategory doesn't appear to be enough to make it work with Alexa.
Title: Re: Alexa with virtual switch
Post by: Juppers on February 08, 2017, 08:21:52 am
Worked for me. I added the following to the device section of D_VSwitch.xml and now they show up for Alexa.
   
<Category_Num>3</Category_Num>
<SubCategory_Num>0</SubCategory_Num>
Title: Re: Alexa with virtual switch
Post by: shallowearth on February 08, 2017, 10:40:43 am
Hmm, that is exactly what I did, but it didn't work for me.  Can you attach you xml file?  Are you running the Beta firmware.

Also when you look at the Advanced tab of your virtual switch, do both category and subcategory parameters show up, mine would only show the category.
Title: Re: Alexa with virtual switch
Post by: Juppers on February 08, 2017, 01:14:21 pm
I'm running the beta. subcategory doesn't show up, I assume because 0 is the default.
Title: Re: Alexa with virtual switch
Post by: gabayarden on February 08, 2017, 01:24:45 pm
Worked for me :)
Thanks alot.

After adding the properties
<Category_Num>3</Category_Num>
<SubCategory_Num>0</SubCategory_Num>

Go to the mail from amazon "amazon alexa beta: participation confirmed". than click on CLICK HERE TO ENABLE SKILL
and choose the new device from there.
Title: Re: Alexa with virtual switch
Post by: onArcade on March 13, 2017, 05:56:20 pm
I'm totally new to this whole zwave thing, so maybe you guys can help me out.

How do I access the D_VSwitch.xml so I can edit it?

I've got a fibaro double relay switch for wich I had to make a virtual switch.
Title: Re: Alexa with virtual switch
Post by: specsix on March 14, 2017, 06:00:04 pm
The virtual switch didn't work for me even after updating all the properties, but after rebooting Vera and the echo, they showed up like an hour later.  Not sure exactly what happened, but now all my virtual switches show up immediately after discovering devices.    Hope this helps.
Title: Re: Alexa with virtual switch
Post by: onArcade on March 14, 2017, 06:49:23 pm
I'm totally new to this whole zwave thing, so maybe you guys can help me out.

How do I access the D_VSwitch.xml so I can edit it?

I've got a fibaro double relay switch for wich I had to make a virtual switch.


I figured it out. Apps -> develop apps -> luup files

#littlevictories
Title: Re: Alexa with virtual switch
Post by: Paulbuckingham on April 28, 2017, 06:39:09 pm
How do I access the D_VSwitch.xml so I can edit it?

Apps -> develop apps -> luup files > then what?????   
Title: Re: Alexa with virtual switch
Post by: shallowearth on April 30, 2017, 12:50:05 pm
Click download far to the right in th same row of the file.
Title: Re: Alexa with virtual switch
Post by: vas5150 on May 03, 2017, 06:25:17 pm
All works flawlessly with Alexa, But if i turn light off at wall switch, virtual switch thinks its still on, so if i then tell alexa to turn on virtual switch it does nothing as it thinks it is already on.  Is there a way for virtual switch to get feed back?
Title: Re: Alexa with virtual switch
Post by: shallowearth on May 03, 2017, 07:53:31 pm
Yes, create a scene that triggers from the light being turned On (from the wall switch or another scene), to turn on the Virtual Switch
Then create a second scene that triggers from the light being turned Off, to turn off the Virtual Switch.

Your Virtual Switch will catch back up the next time your light switch is polled.  (so it will be a little out of sync for a bit until the polling happens).  This usually isn't a big deal unless you are sitting there fiddling with your wall switch and Alex/Vera to control the light switch all at the same time.

Note that this creates a little bit of circular logic between the two switches, that will result in the On Command or Off Command being sent twice to the light switch, but because it is already on or off at the time it all works out without having to get more complex about it.

Title: Re: Alexa with virtual switch
Post by: vas5150 on May 03, 2017, 09:57:47 pm
Yes, create a scene that triggers from the light being turned On (from the wall switch or another scene), to turn on the Virtual Switch
Then create a second scene that triggers from the light being turned Off, to turn off the Virtual Switch.

Your Virtual Switch will catch back up the next time your light switch is polled.  (so it will be a little out of sync for a bit until the polling happens).  This usually isn't a big deal unless you are sitting there fiddling with your wall switch and Alex/Vera to control the light switch all at the same time.

Note that this creates a little bit of circular logic between the two switches, that will result in the On Command or Off Command being sent twice to the light switch, but because it is already on or off at the time it all works out without having to get more complex about it.

Thank you,
Title: Re: Alexa with virtual switch
Post by: Isablend on May 12, 2017, 04:45:05 am
Been following this thread, and have created a virtual switch and updated the D_VSwitch.xml file, however it is not appearing as a device in Alexa (all my other light switch etc are shown).  I have deleted all devices and done a re-discover, any thoughts on what else I might do to get the virtual device visible to Alexa?  I have also re-started Vera and everything is working including the virtual switch in the form I want it.

Title: Re: Alexa with virtual switch
Post by: shallowearth on May 12, 2017, 05:12:56 am
Does the virtual switch show up in the config page in the Vera that tells it what switches and scenes to expose to Alexa? Or does it just not show up in Alexa after you checked it in Vera Alexa Settings?

Did you check on the advance parameter tab of the virtual switch device  that it says category_num 3
If it doesn't say that something went wrong with the file you editted/uploaded
Try again and then restart the Vera.

Title: Re: Alexa with virtual switch
Post by: Isablend on May 12, 2017, 07:18:05 am
Does the virtual switch show up in the config page in the Vera that tells it what switches and scenes to expose to Alexa? Or does it just not show up in Alexa after you checked it in Vera Alexa Settings?
 - Yes the VSwitch appears in Vera, it doesn't appear as a device exposed to Alexa.   What do you mean by Vera Alexa Settings.

Did you check on the advance parameter tab of the virtual switch device  that it says category_num 3
 - Yes, I updated the D_Vswitch.xml file and category is correctly set as 3

If it doesn't say that something went wrong with the file you editted/uploaded
 - All loaded correctly.

Try again and then restart the Vera.
 - Have done and I can use the VSwitch correctly, its just not being exposed to Alexa, v.frustrating.
Title: Re: Alexa with virtual switch
Post by: shallowearth on May 12, 2017, 10:32:00 am
Did you actually go in to the Vera UI for the device.  Click on advanced and see the param category_num was listed and has a 3 in the value?

Before you click discover device in Alexa there is a Vera Webpage that you go to that lists what devices you want to make available to Alexa and what friendly name you want to give them.  Is the Virtual Switch showing up there so that you can click the check box?
Title: Re: Alexa with virtual switch
Post by: MNB on May 12, 2017, 11:04:01 am
For education sake are you implying that once identified to Alexa that one can use the virtual switch? How would you tell her which switch and/or function you want selected? Mike
Title: Re: Alexa with virtual switch
Post by: Isablend on May 12, 2017, 11:56:08 am
In my case  I have a virtual switch call 'House Shield', which when I say "Alexa turn on house shield" will turn on the appropriate house alarm mode, and then broadcast "House perimeter has been secured" via my Sonos groups throughout the house, then "Alexa turn off house shield" does the opposite.

Turns out that in order to get the virtual switch exposed to Alexa requires you to disable the Skill in Alexa and then re-enable.   This shows a list of available devices which have to be selected to then make them discoverable within the Alexa App, which you do by pressing the discover device button.  All sorted now.  Many thanks.
Title: Re: Alexa with virtual switch
Post by: MNB on May 12, 2017, 02:35:45 pm
Thanxs for the comeback and clarification @Isablend, typically virtual switch has eight switches 1-8 are your saying that your somehow naming a single switch (of the eight) or is your device a single switch that's named "House shield", thanxs Mike
Title: Re: Alexa with virtual switch
Post by: shallowearth on May 12, 2017, 06:18:49 pm
Virtual Switch is a different plug in than Multi Switch.  Multi Switch is the one with 8 and does not work with Alexa.

Virtual Switch allows you to create one or more on/off switches that you can use to trigger  scenes.  By updating the file as described it can be used through Alexa like a normal light switch. 
Title: Re: Alexa with virtual switch
Post by: MNB on May 12, 2017, 09:13:45 pm
Got it! thanxs for the clarification. Mike
Title: Re: Alexa with virtual switch
Post by: RichardTSchaefer on May 12, 2017, 09:19:40 pm
F.Y.I.
Vera treats each Multi-Switch as a separate switch ... so you can turn each on/off.

You can create an on/off scene for each Multi-Switch for Alexa.
Title: Re: Alexa with virtual switch
Post by: Don Phillips on May 12, 2017, 09:38:16 pm
MNB, I use IPhone Locator to switch a Multiswitch. When both of us are gone, house goes to Away mode, which triggers a bunch of stuff including notifications to both of us. When either of us is home, the Multiswitch is off.
Title: Re: Alexa with virtual switch
Post by: Isablend on May 13, 2017, 04:57:51 am
I've done something similar, but just used two individual virtual switches to track where we are.  Use geofence to determine house mode and update virtual switch and do various other actions.
Title: Re: Alexa with virtual switch
Post by: MNB on May 13, 2017, 11:04:29 am
@RTS, thanxs for the input, as I'm experimenting with RPI I'm currently using scene(s) do the very same. As to Alexa I was hoping I could directly demand the mulit-switch.

@Don, understand since re-adopting iPhone Locator plugin I too have used my Multi-switch to turn On/Off my Home labeled switch.

@Isablend, you make mention of "Geofence" how has that worked for you? I had read mixed reviews in earlier thread discussions and was hoping that the function had matured to something that works reliably.
Title: Re: Alexa with virtual switch
Post by: pls90 on May 14, 2017, 06:42:11 am
regarding geofences, I'd like to recommend you try VeraProximity to switch your virtual switches. Working quite well for me.

Gesendet von meinem SM-G930F mit Tapatalk

Title: Re: Alexa with virtual switch
Post by: MNB on May 14, 2017, 11:35:18 am
@pls90 thanxs for the suggestion, I thought VeraProximity was for Android devices only?
Title: Re: Alexa with virtual switch
Post by: pls90 on May 15, 2017, 12:45:19 am
yes, it' android only. Sorry, I must have missed you were looking for a solution on ios.

Gesendet von meinem SM-G930F mit Tapatalk

Title: Re: Alexa with virtual switch
Post by: Isablend on May 15, 2017, 05:27:54 am
@MNB - to be honest geofencing is not there fully for me yet.   I can get it working for one phone, but my wife's (both iOS) has not proven as reliable.   I did play with the iPhone locator app for a bit, but was hoping for better overall results form the built in Vera App, but not yet 100% convinced (and it takes such a time to test for all scenarios, going into and out of the geofence).  I don't rely on it for critical elements (but wish I could).
Title: Re: Alexa with virtual switch
Post by: MNB on May 15, 2017, 02:22:54 pm
@pls90 NP, its hard enough to keep straight all the nuances ones own stuff let alone someone else...  ;D

@Isablend, thanxs for update I had that impression when it was first being touted that conceptually it was a great idea however the reliability with current iOS phone detection was the so called "Achilles heel". Looking through the various threads, I see discussions but no real "my solutions works" claims..  I'm hoping that someone can contradicts my observation(s) and provide working solution(s).
Title: Re: Alexa with virtual switch
Post by: yannicks on July 02, 2017, 07:52:28 am
Hello,

I did the modifications on D_VSwitch.xml (for category and subcategory), now a "category_num" is visible (=3) on Vera for virtual switches, but virtual switches are still not recognized to be associated to Alexa.
I tried to reboot Vera + Echo, nothing new.
Do you have any ideas ?
Thanks!
Title: Re: Alexa with virtual switch
Post by: shallowearth on July 02, 2017, 02:29:57 pm
You have to go through he setup again where you put the check mark next to the devices you want discoverable by Alexa.
Title: Re: Alexa with virtual switch
Post by: yannicks on July 02, 2017, 02:56:57 pm
Yes that is what I do.
I am going to https://home.getvera.com/amazon/alexa/smarthome/devicelist but virtual devices don't appear.

According to this thread you apparently faced some issues to have it functionnal (you were stuck like me at some point).
How did you finally fix it ?
Thanks again.
Title: Re: Alexa with virtual switch
Post by: shallowearth on July 03, 2017, 12:26:26 am
Uploaded the file changes, rebooted Vera, rerun enrollment, that was it.
Title: Re: Alexa with virtual switch
Post by: yannicks on July 03, 2017, 06:25:11 pm
Finally got it working today, but without any changes.
It seems that there is a synchronisation delay...
Title: Re: Alexa with virtual switch
Post by: PrincessCleavage on April 26, 2018, 12:11:14 am
Thank you for this:
Worked for me. I added the following to the device section of D_VSwitch.xml and now they show up for Alexa.
   
<Category_Num>3</Category_Num>
<SubCategory_Num>0</SubCategory_Num>
Title: Re: Alexa with virtual switch
Post by: Cor on May 18, 2018, 05:39:22 am
For me they won't show up.

-I changed the xml file ( see attachment).
-checked the advanced section: category_num :3
-rebooted vera
-disabled the vera skill
-enabled the vera skill
-linked
-in the vera gui >> manage alexa:

>> no virtual switched show up, anything else i can do?

Thanks,
Cor
Title: Re: Alexa with virtual switch
Post by: ranneman on May 19, 2018, 01:25:00 am
Cor, your file seems to be okay, I compared it to mine and it looks similar. My setup works (although not really needed anymore as scenes now work in Alexa Routines).
Title: Re: Alexa with virtual switch
Post by: Cor on May 19, 2018, 03:09:52 am
now a day later , and still they don't show up in "manage Alexa".

Anything else I can try?

Cor
Title: Re: Alexa with virtual switch
Post by: ranneman on May 21, 2018, 02:02:36 am
Cor, I did a quick test on a veralite and found that it works instantaneously. Steps I did:
1. create device via apps,
2. device type: urn:schemas-upnp-org:device:VSwitch:1
3. device file: D_VSwitch.xml
4. implementation file: I_VSwitch.xml
5. save device
6. reload luup and check device
7. go to getvera and manage alexa, It shows the newly created virtual device.
8. discover devices through alexa app shows the virtual device and can control it
Title: Re: Alexa with virtual switch
Post by: charlescsparrow on June 17, 2018, 10:53:18 am
Hi all,

One quick note if it helps anyone else.  I modified the D_VSwitch.xml to add category and subcategory as suggested, but it still wasn't showing in my list of devices to expose to alexa until I added a new virtual switch.  That seemed to force it to reevaluate the list of devices and all my virtual switches immediately showed up to be exposed to alexa.  I'm guessing if I had waited the 24 hours a job would have triggered sometime to rebuild he device list, but if you're in a hurry, adding another virtual switch worked for me.
Title: Re: Alexa with virtual switch
Post by: timmy on June 30, 2018, 06:23:26 pm
Given that the exported XML file is a text file, you can edit it in a text editor such as Notepad. However, I strongly recommend that you use an application that supports XSD schema validation such as Microsoft Visual Studio.


___________________________________________________
https://downloader.vip/the-pirate-bay/
https://downloader.vip/yify-yts/
https://downloader.vip/rargb/
Title: Re: Alexa with virtual switch
Post by: nirgal on July 28, 2018, 03:06:50 am
I am trying to add:
<Category_Num>3</Category_Num>
<SubCategory_Num>0</SubCategory_Num>

to the D_VSwitch.xml.
I have downloaded the file, edited it and than uploaded it using the following screen.

I waited more than an hour, but still when I go back and download the file, I still see the old one.

Any idea ?