[ST Edge] Virtual Things Edge Driver

I am having problems again. The driver get stuck with a status of “creating” when I try to create a new virtual device.
I have rebooted the hub, closed the app, forced stopped the app, cleared the cache deleted the driver and reinstalled the driver.
I did NOT unsubscribe from your channel because I didn’t want to lose the devices I have created.
Deleting and reinstalling the driver resets the driver to ready, but nothing gets it to create a new virtual device.

Hi @Paul_Oliver ,

If you want to keep the devices, created by the driver, the driver should not be deleted. In fact, I think attempting to delete the driver with devices should fail with ‘driver in use’ error.
If the driver was indeed removed due to some platform’s issue, but you still have the devices, I really doubt they are functioning properly.
If you can confirm the virtual devices are responding and the automations, associated with them keep working, I will assume the driver was not deleted.

I did not do any modifications to the driver since the last update. Not even to my dev channel. So, the first thing to investigate is whether drivers stops responding after some period of time due to some other issues, perhaps network disconnect. Another thing I’d like to check is whether it could be related to the amount of virtual devices, created with the driver or even with the specific type of the virtual device.

  1. Can you please confirm the virtual devices, created with the driver responding and working correctly?
  2. What status for the virtual devices and controller do you see in IDE?
  3. How many virtual devices were created with the driver?
  4. What kind of device you were trying to create when the Controller got stuck?
  5. How many devices of that type you managed to create (before the unsuccessful attempt)?
  6. Would it be possible to retrieve the logs from the driver? You will need to install smarthings cli and run it from the command line.

Thanks

It looks like I currently using 8 virtual switches, 1 contact sensor and 1 presence sensor created by your vDevController. All virtual switches are use as Alexa triggers.

Experimenting I created another 6 to 12 devices, but later deleted then.

They all appear to work except for the presence sensor. It will not change state using the button. When I open the device it shows ON and NOT PRESENT.

The driver and all virtual devices created show as on line in the IDE.

I do not have CLI installed. Is this something you install on a PC or mobile device?

I am going to delete the nonfunctional presence sensor to see if that makes any difference.

So I deleted the non operational presence sensor, cleared the cache, force stopped the app and that did not fix anything.

So I then deleted the vDevController and reinstalled it twice and both times it shows as off-line in the app but on line in the IDE. There are no buttons or switch’s when I open the device tile.

I rebooted hub, forever stopped the app, and cleared the cache. Nothing gets the vDevController online.

Everything else I have checked in my system works.

I am also still able to create virtual devices using TAustin’s vEdge Creator

Thank you!

1 Like

@Paul_Oliver

I’m sorry for any inconvenience caused.
Let’s try to collect the logs.
From Windows

  1. Download smartthings cli https://github.com/SmartThingsCommunity/smartthings-cli/releases/download/v0.0.0-pre.31/smartthings-win.zip
  2. open the command window
    Windows key->Run , type cmd and press enter
  3. open the downloaded archive into the same folder as the default for your cmd
    ( you can type explorer . to open the explorer window and copy smartthings.exe into this folder
  4. from cmd, run smartthings
    smartthings.exe edge:drivers:logcat --hub-address=<hub address>
  5. select the driver

If everything is fine you will see
listening for logs... |

After this, delete controller and scan for devices again. Please do not uninstall the driver, only delete the controller
Wait for controller to be created, you should see the logs.
If the controller has any capabilities, try to press them
Please copy & paste the logs here.
Thank you

1 Like

This is way above my pay grade but hear goes:

? Select a driver. 4
2021-10-20T23:50:56.730815752+00:00 TRACE Virtual Things Edge Driver [YG] Received event with handler device_lifecycle
2021-10-20T23:50:56.734304419+00:00 INFO Virtual Things Edge Driver [YG] <Device: 585c9ccf-3a8f-4dc3-a107-321081575714 (vDev Controller)> received lifecycle event: removed
2021-10-20T23:50:56.739577127+00:00 TRACE Virtual Things Edge Driver [YG] Found DeviceLifecycleDispatcher handler in Virtual Devices Creator
2021-10-20T23:50:56.742543961+00:00 WARN Virtual Things Edge Driver [YG] on_device_removed(): ‘vDev Controller’ 585c9ccf-3a8f-4dc3-a107-321081575714
2021-10-20T23:50:56.745803294+00:00 DEBUG Virtual Things Edge Driver [YG] vDev Controller device thread event handled
2021-10-20T23:50:56.750844127+00:00 DEBUG Virtual Things Edge Driver [YG] vDev Controller device thread event handled
2021-10-20T23:52:55.022871933+00:00 TRACE Virtual Things Edge Driver [YG] Received event with handler discovery
2021-10-20T23:52:55.137032975+00:00 WARN Virtual Things Edge Driver [YG] discovery_handler(): options={insecure_join_allowed=true, timeout=90, z_wave_s2=true}
2021-10-20T23:52:55.174195600+00:00 DEBUG Virtual Things Edge Driver [YG]
2021-10-20T23:52:55.182145225+00:00 DEBUG Virtual Things Edge Driver [YG]
2021-10-20T23:52:55.200132516+00:00 DEBUG Virtual Things Edge Driver [YG]
2021-10-20T23:52:55.208367766+00:00 DEBUG Virtual Things Edge Driver [YG]
2021-10-20T23:52:55.215490766+00:00 DEBUG Virtual Things Edge Driver [YG]
2021-10-20T23:52:55.218784475+00:00 DEBUG Virtual Things Edge Driver [YG]
2021-10-20T23:52:55.223327475+00:00 DEBUG Virtual Things Edge Driver [YG]
2021-10-20T23:52:55.226301933+00:00 DEBUG Virtual Things Edge Driver [YG]
2021-10-20T23:52:55.230104016+00:00 DEBUG Virtual Things Edge Driver [YG]
2021-10-20T23:52:55.266864600+00:00 DEBUG Virtual Things Edge Driver [YG]
2021-10-20T23:52:55.269843766+00:00 DEBUG Virtual Things Edge Driver [YG]
2021-10-20T23:52:55.272784183+00:00 DEBUG Virtual Things Edge Driver [YG]
2021-10-20T23:52:55.275960266+00:00 WARN Virtual Things Edge Driver [YG] discovery_handler - crearting controller
2021-10-20T23:52:55.282973350+00:00 DEBUG Virtual Things Edge Driver [YG] find_empty_name(): vDev Controller
2021-10-20T23:52:55.291095016+00:00 DEBUG Virtual Things Edge Driver [YG] Factory.create_device() type=vDevCtl created=false creator=<Creator:vDevCtl profile=‘Virtual Devices Controller (YG)’ label=‘vDev Controller’ dni=‘vDevCtl2’>
2021-10-20T23:52:55.294115808+00:00 DEBUG Virtual Things Edge Driver [YG] discovery device thread event handled
2021-10-20T23:52:56.013589391+00:00 TRACE Virtual Things Edge Driver [YG] Received event with handler device_lifecycle
2021-10-20T23:52:56.032190350+00:00 INFO Virtual Things Edge Driver [YG] <Device: 81786602-2e5e-4f03-9b7a-5566cc645c69 (vDev Controller)> received lifecycle event: added
2021-10-20T23:52:56.045725141+00:00 TRACE Virtual Things Edge Driver [YG] Received event with handler device_lifecycle
2021-10-20T23:52:56.049059641+00:00 INFO Virtual Things Edge Driver [YG] <Device: 81786602-2e5e-4f03-9b7a-5566cc645c69 (vDev Controller)> received lifecycle event: doConfigure
2021-10-20T23:52:56.055393975+00:00 TRACE Virtual Things Edge Driver [YG] Found DeviceLifecycleDispatcher handler in Virtual Devices Creator
2021-10-20T23:52:56.058609058+00:00 WARN Virtual Things Edge Driver [YG] on_device_added(): ‘vDev Controller’ 81786602-2e5e-4f03-9b7a-5566cc645c69
2021-10-20T23:52:56.061832475+00:00 DEBUG Virtual Things Edge Driver [YG] vDev Controller device thread event handled
2021-10-20T23:52:56.066881308+00:00 TRACE Virtual Things Edge Driver [YG] Found DeviceLifecycleDispatcher handler in Virtual Devices Creator
2021-10-20T23:52:56.070054933+00:00 WARN Virtual Things Edge Driver [YG] on_device_init(): ‘vDev Controller’ 81786602-2e5e-4f03-9b7a-5566cc645c69
2021-10-20T23:52:56.073816808+00:00 INFO Virtual Things Edge Driver [YG] <Device: 81786602-2e5e-4f03-9b7a-5566cc645c69 (vDev Controller)> emitting event: {“component_id”:“main”,“state”:{“value”:“switch”},“capability_id”:“amberpiano10217.virtualThingTypeV2”,“attribute_id”:“type”}
2021-10-20T23:52:56.094979516+00:00 INFO Virtual Things Edge Driver [YG] <Device: 81786602-2e5e-4f03-9b7a-5566cc645c69 (vDev Controller)> emitting event: {“component_id”:“main”,“state”:{“value”:“off”},“capability_id”:“switch”,“attribute_id”:“switch”}
2021-10-20T23:52:56.108562308+00:00 DEBUG Virtual Things Edge Driver [YG] set_controller_status(): status=ready info=
2021-10-20T23:52:56.112799308+00:00 INFO Virtual Things Edge Driver [YG] <Device: 81786602-2e5e-4f03-9b7a-5566cc645c69 (vDev Controller)> emitting event: {“component_id”:“main”,“state”:{“value”:“ready”},“capability_id”:“amberpiano10217.controllerStatus”,“attribute_id”:“status”}
2021-10-20T23:52:56.123502600+00:00 INFO Virtual Things Edge Driver [YG] <Device: 81786602-2e5e-4f03-9b7a-5566cc645c69 (vDev Controller)> emitting event: {“component_id”:“main”,“state”:{“value”:""},“capability_id”:“amberpiano10217.controllerStatus”,“attribute_id”:“info”}
2021-10-20T23:52:56.135003433+00:00 INFO Virtual Things Edge Driver [YG] <Device: 81786602-2e5e-4f03-9b7a-5566cc645c69 (vDev Controller)> emitting event: {“component_id”:“main”,“state”:{“value”:{“status”:“ready”,“info”:""}},“capability_id”:“amberpiano10217.object”,“attribute_id”:“data”}
2021-10-20T23:52:56.146153808+00:00 DEBUG Virtual Things Edge Driver [YG] vDev Controller device thread event handled
2021-10-20T23:52:56.152013516+00:00 TRACE Virtual Things Edge Driver [YG] Found DeviceLifecycleDispatcher handler in Virtual Devices Creator
2021-10-20T23:52:56.155326183+00:00 WARN Virtual Things Edge Driver [YG] on_do_configure(): ‘vDev Controller’ 81786602-2e5e-4f03-9b7a-5566cc645c69
2021-10-20T23:52:56.158848350+00:00 DEBUG Virtual Things Edge Driver [YG] vDev Controller device thread event handled
2021-10-20T23:52:56.168549766+00:00 DEBUG Virtual Things Edge Driver [YG] vDev Controller device thread event handled
2021-10-20T23:54:02.400822541+00:00 TRACE Virtual Things Edge Driver [YG] Received event with handler discovery
2021-10-20T23:54:19.728769204+00:00 TRACE Virtual Things Edge Driver [YG] Received event with handler capability
2021-10-20T23:54:19.733745745+00:00 INFO Virtual Things Edge Driver [YG] <Device: 81786602-2e5e-4f03-9b7a-5566cc645c69 (vDev Controller)> received command: {“positional_args”:,“args”:,“component”:“main”,“capability”:“switch”,“command”:“on”}
2021-10-20T23:54:19.737594120+00:00 TRACE Virtual Things Edge Driver [YG] Found CapabilityCommandDispatcher handler in Virtual Devices Creator
2021-10-20T23:54:19.740636120+00:00 DEBUG Virtual Things Edge Driver [YG] event_handler_switch_on_off(): device=‘vDev Controller’ event={args={}, capability=“switch”, command=“on”, component=“main”, positional_args={}}
2021-10-20T23:54:19.746389287+00:00 DEBUG Virtual Things Edge Driver [YG] find_empty_name(): vSwitch1
2021-10-20T23:54:19.749499995+00:00 DEBUG Virtual Things Edge Driver [YG] set_controller_status(): status=creating info=vSwitch1
2021-10-20T23:54:19.753341787+00:00 INFO Virtual Things Edge Driver [YG] <Device: 81786602-2e5e-4f03-9b7a-5566cc645c69 (vDev Controller)> emitting event: {“component_id”:“main”,“state”:{“value”:“creating”},“capability_id”:“amberpiano10217.controllerStatus”,“attribute_id”:“status”}
2021-10-20T23:54:19.765971204+00:00 INFO Virtual Things Edge Driver [YG] <Device: 81786602-2e5e-4f03-9b7a-5566cc645c69 (vDev Controller)> emitting event: {“component_id”:“main”,“state”:{“value”:“vSwitch1”},“capability_id”:“amberpiano10217.controllerStatus”,“attribute_id”:“info”}
2021-10-20T23:54:19.778254412+00:00 INFO Virtual Things Edge Driver [YG] <Device: 81786602-2e5e-4f03-9b7a-5566cc645c69 (vDev Controller)> emitting event: {“component_id”:“main”,“state”:{“value”:{“status”:“creating”,“info”:“vSwitch1”}},“capability_id”:“amberpiano10217.object”,“attribute_id”:“data”}
2021-10-20T23:54:19.796771995+00:00 INFO Virtual Things Edge Driver [YG] <Device: 81786602-2e5e-4f03-9b7a-5566cc645c69 (vDev Controller)> emitting event: {“component_id”:“main”,“state”:{“value”:“off”},“capability_id”:“switch”,“attribute_id”:“switch”}
2021-10-20T23:54:19.808262120+00:00 DEBUG Virtual Things Edge Driver [YG] vDev Controller device thread event handled
listening for logs… |

Hi @Paul_Oliver ,
This is great, thank you.
I think I have an idea what might be wrong.
Do you have vSwitch1 currently?
If so, is it possible to rename it to something else, like vSwitch1old or vSwitchDoor or anything that not is the exact match to
vSwitch<number>
?
Then try to create a new switch with the Controller.
Thanks

I do NOT have any switches names vSwitch1 or vSwitch (any number).

I just tried to create a new switch and it got stuck creating vSwitch1.

This the log I get from trying to create vSwitch2:

? Select a driver. 4
2021-10-21T05:12:38.469332851+00:00 TRACE Virtual Things Edge Driver [YG] Received event with handler capability
2021-10-21T05:12:38.485358059+00:00 INFO Virtual Things Edge Driver [YG] <Device: 81786602-2e5e-4f03-9b7a-5566cc645c69 (vDev Controller)> received command: {“command”:“on”,“capability”:“switch”,“component”:“main”,“args”:,“positional_args”:}
2021-10-21T05:12:38.489259559+00:00 TRACE Virtual Things Edge Driver [YG] Found CapabilityCommandDispatcher handler in Virtual Devices Creator
2021-10-21T05:12:38.492333351+00:00 DEBUG Virtual Things Edge Driver [YG] event_handler_switch_on_off(): device=‘vDev Controller’ event={args={}, capability=“switch”, command=“on”, component=“main”, positional_args={}}
2021-10-21T05:12:38.498487643+00:00 DEBUG Virtual Things Edge Driver [YG] find_empty_name(): vSwitch2
2021-10-21T05:12:38.501421893+00:00 DEBUG Virtual Things Edge Driver [YG] set_controller_status(): status=creating info=vSwitch2
2021-10-21T05:12:38.505371101+00:00 INFO Virtual Things Edge Driver [YG] <Device: 81786602-2e5e-4f03-9b7a-5566cc645c69 (vDev Controller)> emitting event: {“state”:{“value”:“creating”},“capability_id”:“amberpiano10217.controllerStatus”,“component_id”:“main”,“attribute_id”:“status”}
2021-10-21T05:12:38.516660476+00:00 INFO Virtual Things Edge Driver [YG] <Device: 81786602-2e5e-4f03-9b7a-5566cc645c69 (vDev Controller)> emitting event: {“state”:{“value”:“vSwitch2”},“capability_id”:“amberpiano10217.controllerStatus”,“component_id”:“main”,“attribute_id”:“info”}
2021-10-21T05:12:38.528703184+00:00 INFO Virtual Things Edge Driver [YG] <Device: 81786602-2e5e-4f03-9b7a-5566cc645c69 (vDev Controller)> emitting event: {“state”:{“value”:{“status”:“creating”,“info”:“vSwitch2”}},“capability_id”:“amberpiano10217.object”,“component_id”:“main”,“attribute_id”:“data”}
2021-10-21T05:12:38.548453684+00:00 INFO Virtual Things Edge Driver [YG] <Device: 81786602-2e5e-4f03-9b7a-5566cc645c69 (vDev Controller)> emitting event: {“state”:{“value”:“off”},“capability_id”:“switch”,“component_id”:“main”,“attribute_id”:“switch”}
2021-10-21T05:12:38.559560851+00:00 DEBUG Virtual Things Edge Driver [YG] vDev Controller device thread event handled
listening for logs… /

@Paul_Oliver
This is not something I expected.
Let’s try to see the drivers and devices your hub see.

  1. Drivers first.
    From cli, type
smartthings edge:drivers:installed

You will be prompted to select the hub. Press 1 (or the hub’s number if you have more and it is not the first). Try to see whether you have more than one entry for “Virtual Things Edge Driver [YG]”
Please post it’s id. IF you have more than one entry, I will need all of them.
Please do NOT post the id of your hub, it is not secure to post it in the public forum.
2. From the cli type

smartthings devices

Try to see all your vSwitch* devices.

Are you able to create a virtual devices of other types?
Regards

I just experimented with your vDev Controller and I can create every device except a switch.

@Paul_Oliver
Ok, so I suspect the issue is caused by driver removal without removing all devices first.
Normally, you should not be able to remove the driver if you still have devices, created by it.
However, probably due to some platform issue it did not work as expected and your driver was removed. This is probably an unexpected state for the cloud servers.
Later, you installed the new version of the driver, but this new version does not see the devices, created by the old one.

Do you see the new switch name every time you are trying to create a new switch?
Like pushing once the driver attempts to create vSwitch1, but the next time it would attempt to create vSwitch2, etc.
Every time you are trying to create a switch, the driver should assign a different name.
If you see this behaviour, try to create switch that your hub did not see before. For example, if before uninstalling the driver, you created 5 switches and the last one was vSwitch5, try creating switches until the driver says it is creating vSwitch6.

Also, would it be possible to see whether you have multiple versions of the drivers and a list of devices, as explained above?
Thanks

1 Like

I never removed the driver, I have only deleted and reinstalled the controller. I apparently used the wrong terminology in previous posts.

So, whenever I reboot the hub, which I have done a lot lately due issues with various beta Edge drivers the vSwitch count always goes back to vSwitch1. And I have no way to change that numbering, it is automatically assigned.

So as an experiment I keep pushing the on/off button until I got to vSwitch12 and at that point it actually created a functional switch. I have since created a vSwitch13.

So the problem is that after the hub reboots the controller goes back to creating vSwitch1 which was already created. I always rename my devices, so none are called vSwitch1, but obviously they is some ID that your controller sees.

@Paul_Oliver ,
That is very interesting info, thank you.

The reason that it is not possible to set the counter is because the driver will lookup for the first available(free) name by itself.
It will iterate over all names and find the first available. It will also remember the first available number, so the next time you create the thing it will find the available name faster.

It seems however, that the cloud remembers the names of the created devices and prevents creating the new one even if the device was later
renamed and the name is currently available.
It is probably a platform issue that needs to be addressed by the ST team, but I might have a workaround for it.
I will keep you updated.

I really don’t feel comfortable to require from the user to keep the track of devices and manually set the counters after each hub reboot. I will be looking into more elegant solution.

3 Likes

You are welcome, and thank you for your help.

You taught me some new tricks.

1 Like

@Paul_Oliver
I uploaded the new version 1.2 that I hope fixes the issue you reported.
After hub reboot/driver update the driver should be able to find unused name/network id and create device successfully.
Regards

3 Likes

v1.2 seems to be working. After the changes it created “vSwitch14” on the 1st try.

Thanks again for the great virtual device creator

1 Like

@Paul_Oliver ,
Thanks for the update. I’m glad it is working now

Good evening. Could you please create me this virtual device “Plug (can be used as a trigger source in Alexa as it contains hidden contactSensor capability)”. Thank you very much