Hi,
Following @TAustin 's great work on vEdge Creator, I was curious to explore a different approach for creating virtual devices.
The driver allows creation of devices one-by-one.
Please install “Virtual Things Edge Driver [YG]”
How to use
After installing the driver, press “Add device” and then “Scan nearby”.
This will create “vDev Controller” - virtual devices controller (currently it only creates virtual devices, but does not actually allow to control them).
Once the controller is created, enter its detailed view.
The user specifies a type of the device to create by choosing “Virtual Thing Type To Create” and presses switch button.
The controller will report its status (ready/creating/created) and the name of the device being created.
When the device is created the switch goes into “Off” state and the controller is ready to create another device.
Note:
Once the virtual devices are created, it is completely fine to delete the Controller. The deletion of the controller should not affect the already created devices in any way.
However, the controller will be automatically created during the next discovery process.
Supported devices
Type | Capabilities | Comments |
-------------------------------------------------------------------------------------------------------------------------|
Switch | switch, contactSensor(hidden) | Can be used as a trigger source in Alexa |
Dimmer | switchLevel, switch | |
Curtain Switch | windowShade, switch | |
Momentary | momentary, button | switch (hidden), contactSensor (hidden).Works with Alexa.Since v1.5|
Acceleration sensor | accelerationSensor, switch | Also contains threeAxis, tamperAlert. Since v1.5 |
Contact sensor | contactSensor, switch | Can be used as a trigger source in Alexa |
Motion sensor | motionSensor, switch | |
Presence sensor | presenceSensor, switch | |
Smoke Sensor | smokeDetector, switch | |
Water sensor | waterSensor, switch | Since v1.5 |
Alarm | alarm | |
Lock | lock | |
Thermostat | | |
Audio | mediaPlayback, audioVolume, audioMute, audioTrackData, mediaPresets, mediaTrackControl. Since v1.5 |
Power | powerMeter, energyMeter | Since 1.7 |
Controller
The Controller is used to create virtual devices.
It is created by discovery process (Add device → “Scan nearby”). It is safe to delete the controller, once virtual devices are created.
As long as you have the driver installed, the controller will be created on each discovery, if it does not exists.
To create a virtual device
- enter the Controller’s detailed view
- press ‘Virtual Thing Type To Create’ and select the desired type
- Press Switch button
When changing ‘Virtual Thing Type To Create’ in the controller, the controller will show the number of devices of the selected type (Since v1.3).
Please note, after creating the device the info will be empty (not updated with the new number). This to keep creation robust. If the selected device type changes, the info will be updated again.
Update
Since v1.6, Info capability can show
- The number of created device of the selected type. This is the fastest option
- The list of devices of the selected type and their number (This is the default option)
- The list of all devices, created by the driver. The devices of the selected type will be shown in bold and in ‘Blue Violet’ color
Please note, this is the slowest option, might not work well with large number of devices
The desired info capability format can be specified in Controller’s settings.
Many thanks to @TAustin and @philh30 for their help and the idea to use HTML tags
Controller’s view
Detailed view | Info field, populated with created devices |
Selecting the device type to create
Virtual switch
The virtual switches allow changing the icon (Since v1.3) by selecting device profile.
The profile is selected in ‘Settings’.
There is a special ‘Simple switch’ profile that does not contain contactSensor capability.
This is useful to prevent STHM event. However, when selecting this profile, the device can not be used as a trigger for Alexa routine.
Switch with any profile, except ‘Simple switch’ can be used in Alexa as both a source (‘When it happens’ ) and as a destination (‘Action’).
‘Simple switch’ can be only a destination for Alexa routine.
The supported profiles are
- switch
- light
- smart plug
- dishwasher
- dryer
- fan
- garage door
- robot cleaner
- stove
- washer
- TV (since v1.4)
- camera (since v1.4)
- leak sensor (since v1.5)
- Simple switch (since v1.7)
Virtual Momentary button
The momentary button is a stateless switch which allows you to define an action when a button is pressed.
The device contains a momentary capability to trigger the action and button capability with only ‘pressed’ action.
The device allows to select profile in ‘Settings’.
The following profiles are supported:
-
With hidden contact sensor
The device can be used in Alexa as both a source (‘When it happens’ ) and as a destination (‘Action’).
When defining the Alexa routine, please note, the the device will be shown as a door sensor for routine’s trigger and as a switch for routine’s action.
Please also note, this device will trigger STHM alerts -
Simple profile
With this profile, the device can be used in Alexa as a destination (‘Action’). However it can’t be used as a source (‘When it happens’ ) for routine. It will not trigger STHM alerts
The device contains the following capabilities
- momentary
- button
- switch (hidden), required for Alexa routine’s action
- contactSensor (hidden), required for triggering Alexa routines
Pressing momentary have the following effects
- momentary’s state changes from ‘Standby’ to ‘Press momentary’, then back to ‘Standby’
- button’s states changes from ‘Standby’ to ‘Pressed’, then back to ‘Standby’
- switch’s state is changed to ‘on’ and after approximately 2 seconds back to ‘off’
- contact sensor is changed to ‘open’ and after approximately 2 seconds back to ‘closed’
Virtual Acceleration sensor
The device contains the following capabilities
- accelerationSensor
- switch
- threeAxis
- tamperAlert
Pressing a switch changes acceleration sensor from ‘No vibration’ to ‘Vibration detected’.
Other capabilities can be controlled through API/WebCore.
Virtual Alarm
Virtual alarm contains alarm capability, that can be used in both ‘IF’ and ‘THEN’ statements of the routine.
Supported alarm types
- Off
- Strobe
- Siren
- Siren and Strobe
Virtual Audio
(Since v1.5)
Change log
v1.7 2022-05-30T06:21:13.138967863Z
New things:
- vPower
vSwitch:
- rename ‘Switch icon’ setting to ‘Switch profile’
- add ‘Simple switch’ profile without contact sensor capability
vMomentary:
- add ‘Device Profile’ setting
- add ‘Simple profile’ profile without contact sensor
v1.6 2022-02-07T20:47:12.309967
Add ability to display all virtual devices, created by this driver in Info field.
See Controller section for more details
v1.5.1 2022-01-30T05:12:43.493124Z
Force controller’s initialization during driver’s update
v1.5 2022-01-29T18:36:54.682876Z
New things:
- Momentary
- Acceleration sensor
- Water sensor
- Audio
vSwitch:
- add Leak sensor icon to vSwitch
Thanks
I’d like to take this opportunity to thank @nayelyz , @erickv and @psbarrett for their help.