How can i install a custom edge driver in virtual device?

Hello,
First of all i created a custom edge driver (lua), i succesfully installed in hub with smarthings cli, question is how can i use or install this driver on a virtual device (created with smartthings cli)

tagging @nayelyz

Hi, @dannymoran!

The steps to test a custom driver are:

  1. Package the driver to upload it in the ST Cloud
  2. Assign the driver to a channel
  3. Install the driver in your Hub
  4. If it’s a LAN driver, you just need to hit “scan nearby” in the app when you select “add device”.
  5. If it’s a Zigbee or Z-Wave driver, you need to put the device in pairing mode and then click on “scan nearby”

In both cases, “scan nearby” will trigger the discovery in the drivers and will check for compatible devices or install the one you defined in this process (LAN)

Thanks for the tag, @jkp!

I have completed steps 1-3, after hitting “scan nearby” in the app, VIRTUAL devices dont appear, i am trying to use custom capabilities thats why i need an custom virtual device (with my own lua driver)

Unless I’ve missed something, VIRTUAL devices haven’t been formally launched yet.

Creating a custom VIRTUAL than runs in the cloud and uses custom capabilities is easy enough as you can just create a device profile first and the CLI will process it for you.

What gets interesting is when you want the VIRTUAL to run locally and/or need to have a bit more custom intelligence, for example linking the switch and presenceSensor capabilities together. I have managed to build an Edge driver inspired by the Virtual Switch driver and get the CLI to use to build a VIRTUAL. The Edge driver is installed as part of the VIRTUAL device creation process.

The problem is it only worked for a short period of an hour or two and then became unresponsive. I can’t remember if the same was true if I used the Virtual Switch. I don’t feel I can go any further at the moment given they haven’t been launched yet.

Is this in any way related to what you are trying to do? Or are you just trying to create your own virtual device and being distracted by the existence of the VIRTUAL type? The community built virtual devices you see around are actually of type LAN, not VIRTUAL. They create a device in the discovery handler.

Hi orangebucket, how did you managed to build the virtual device with your custom edge driver, when i create a virtual device with smartthings virtualdevices:create in cli it just asks for name, and device profile not for driver, and with smartthings virtualdevices:create-standard it asks for name and prototype, virtual device is created but its not linked to my custom driver

I didn’t do it interactively, I gave it an input file. The key to figuring that out is the Core SDK.

Thanks for the info, i could create a virtual device linked to my custom driver using Core SDK, it is working correctly with my rules and it is stable, now the problem is that the device is only working in the cloud but not locally. is there a way to make this device work locally?