[ST Edge] vEdge Creator: a virtual device generator for end users

The obvious way to implement a virtual thermostat would be to use an app that could be configured to read external sensors and control external devices to implement the required heating and cooling.

The virtual thermostats being considered here are a bit different as the thermostat logic is being implemented as a device, and SmartThings devices can’t work directly with other devices. So Todd’s virtual thermostat expects an external Routine, or other automation, to update the temperature in the virtual thermostat device from an external source. Mariano takes a different approach in that the virtual thermostat is an add on to a temperature sensor so the temperature is already available.

When it comes to controlling external heating and cooling devices, there are a couple of approaches that could be taken. The virtual thermostat could have internal components that represent the external devices virtually and it could set the state of them as required. Then external Routines, or other automations, could be used to mirror those settings to real hardware. So all the intelligence would exist with the virtual device.

From what I can see both Todd and Mariano are taking a different approach where external Routines are expected to be monitoring the status of the virtual thermostat and working out what they have to do. So if the thermostat mode is Heat they will do something appropriate. So a little bit of the intelligence exists in these Routines.

1 Like

I’ve managed to create a presence sensor for 2 phones.

When both leave it turns on 3 blink alarms.

When either phone arrives back it turns off the 3 blink alarms.

Looks like I have everything set up correctly but when both phones are away only 2 of the 3 blink devices turn on although when I arrive back all 3 correctly turn off.

What could be causing this?

EDIT: ahh. I’ve just noticed that arming that device is off in IFTTT and can’t be turned on again.

Question: Does this vEdge device work with IFTTT. I’ve tried and don’t seem to be able to make the connection.

Thank you for these details! Clearer now but it looks complex to achieve.

There’s no way to have smart app enrolled in the hub ?
I use to use a smart app on groovy ide which worked as a charm but now all groovy ide devices/smart app are no longer working:(

I purchased an aeotec hub to replace this thinking it was possible to migrate smart app on the hub but I see that this is not possible:(

I will maybe try to make this through Home Assistant. I see that some solutions are present on HACS.

I hope someone will suggest something on smarthings. This was so simple and nice to use :frowning:

2 posts were split to a new topic: How can I set virtual presence sensor with a routine?

3 posts were merged into an existing topic: How can I set virtual presence sensor with a routine?

Ifttt needs to update their integration to use edge drivers. They are working on this, but do not have it finished yet. So the issue is on the Ifttt side, not with this edge driver specifically. Once Ifttt finishes the new integration, this edge driver should work with it.

For more on the Ifttt issues, see the following thread:

SmartThings and IFTTT not linking DO NOT UNLINK!

Ah I thought this edge driver would be a workaround for the IFTTT issues. I’ve been using IFTTT to do what I want for years but it stopped working about 2 weeks ago for the reason described in that other thread. I guess I’ll just have to wait for IFTTT to come good again.

1 Like

Can I use this driver to create a device with these kind capabilities? A c02 sensor, temp humidity etc. I want to use it so I can send data from netatmo to that device with the api.

You won’t find one single device that has all those capabilities, but you can create individual ones that will probably cover most of what you need. For example, there is a temp/humidity device, and an air quality device. I could add a sound device if you need that.

Otherwise if you needing one device that has all the capabilities you want, then that will take some custom work to create.

1 Like

I’m already using the temp humidity one, works great! If it’s not too much hassle to create a sound sensor, then yes please. :grin:
And a c02 sensor? The air quality one does not use ppm but another unit.

I’d like to use a standard level capability for setting the sound level value. That would give you 0-100 (db) range. Is that sufficient or will you be taking measurements in a nightclub? :smirk:

How about the ppm values for CO2; what range would you need for setting the value?

1 Like

My livingroom is my own nightclub. :stuck_out_tongue_closed_eyes:
I think thats more than enough!

Regarding the c02 meter. I think from 0 to 2500 is good. thanks in advance!

1 Like

@TAustin

I created a single virtual presence device successfully just now. Then I tried to create a virtual switch but the action keeps timing-out with a network error. Looking at the logcat I am seeing the following whether I’m trying to create anything or not.

2023-01-31T17:24:18.516399680+00:00 WARN Virtual Devices V2  Unexpected filesystem lookup for capability partyvoice23922.vbatterylevel
2023-01-31T17:24:18.575100597+00:00 FATAL Virtual Devices V2  Lua: callback error
stack traceback:
        [C]: in field 'st_json_decode'
        [string "json"]:17: in field 'decode'
        [string "st/capabilities/init.lua"]:56: in field 'build_cap_from_json_string'
        [string "st/capabilities/init.lua"]:142: in function <[string "st/capabilities/init.lua"]:134>
        [C]: in function 'pcall'
        [string "st/capabilities/init.lua"]:94: in metamethod '__index'
        [string "init.lua"]:1533: in main chunk
caused by: error converting Lua lightuserdata to String (expected string or number)
Traceback:
stack traceback:
        [C]: in function 'error'
        [string "st/capabilities/init.lua"]:98: in metamethod '__index'
        [string "init.lua"]:1533: in main chunk
2023-01-31T17:24:24.203070391+00:00 WARN Virtual Devices V2  Unexpected filesystem lookup for capability partyvoice23922.vbatterylevel
2023-01-31T17:24:24.567988517+00:00 FATAL Virtual Devices V2  Lua: callback error
stack traceback:
        [C]: in field 'st_json_decode'
        [string "json"]:17: in field 'decode'
        [string "st/capabilities/init.lua"]:56: in field 'build_cap_from_json_string'
        [string "st/capabilities/init.lua"]:142: in function <[string "st/capabilities/init.lua"]:134>
        [C]: in function 'copcall'
        [string "st/capabilities/init.lua"]:94: in metamethod '__index'
        [string "init.lua"]:1533: in main chunk
caused by: error converting Lua lightuserdata to String (expected string or number)
Traceback:
stack traceback:
        [C]: in function 'error'
        [string "st/capabilities/init.lua"]:98: in metamethod '__index'
        [string "init.lua"]:1533: in main chunk

Is this normal/expected?

Yikes, no this is not expected or normal!

There was a driver change earlier that fixed a problem with virtual battery devices. Do you have any? If so, I’d recommend deleting them and recreating them.

If that’s not it, could you please confirm what driver version you have installed. It’s not making sense why you would be getting this particular error…

I did have one virtual battery device until a few days ago but I wasn’t using it so I deleted it.

Installed driver details:

And note I still cannot create any more virtual devices with the driver since adding that single presence device earlier today. I keep getting “A network or server error occurred. Try again later.” in the app.

Sorry for all the questions, but…

  • Now that you’ve deleted that battery device, are you seeing anything different in the log?
  • Are you getting that error only when you tried to create a new device? When you try again, are you still getting that same error repeated in the log?
  • Are other virtual devices still operating ok?

If everthing still seems to be botched up, you could try reinstalling the driver with the CLI:

smarttings edge:drivers:install

1 Like

I actually deleted the battery device several days ago. The logs are from today.

The error occurs without me trying to create a new device. When I do attempt to create a new device it does not appear to generate anything in the logs.

All other virtual appear to be working (I have a lot so cannot be 100% certain).

I reinstalled via the CLI and boom, all working again and those log errors have gone away.

Thank you!

6 posts were split to a new topic: Zipato Siren: Use Doorbell Sound?

Weird. Let me know if this happens again, and get the logging running if it does.

Thanks for reporting.

1 Like

DRIVER UPDATE NOTICE!!

New driver version 2023-02-01T22:35:17.008560957 has been pushed out to everyone’s hub. Your driver will be automatically updated.

New in this update:

  • Due to a recent change in the way automation routines are configured for switch level (dimmer) devices, I have added a dimmer level-only virtual device. This has no switch; just the dimmer control. (@NickA)

  • Related to the above, I have added a new Settings option to the Level virtual device (switch+dimmer) that allows you to select whether or not to have the switch affected when changing the dimmer. This will behave like a standard light dimmer switch where if you change the level to anything above 0, it will turn ON the switch automatically. Conversely, if you set the dimmer to 0, it will turn OFF the switch automatically. Turning the switch itself on or off does not affect the dimmer. Note that this behavior had always been available with the Light virtual device, and will continue to be. (@HalD)

  • New ‘AlexaSwitch’ device. This is basically the same as the Contact virtual device, in that it contains both a contact and a switch useful for Alexa routines. However this new separate device type should be more obvious for newcomers, and hides the contact which some people prefer. You also have several dashboard icon options available through device Settings.

  • Additional new virtual device types added:

    • Illuminance (@fido)
    • Sound Sensor
    • Sound Pressure (db level) (@Firdb)
    • CO2 Detector (@Firdb)

    Each of the above new device types include controls for setting the respective values.


What to expect

It continues to be a challenge to update the Creator device buttons with new options. Previously, I recommended everyone to delete and recreate their Creator device. However, this time around, I’m trying a new approach that is intended to be less intrusive. Once the driver has been updated on your hub, it may take some time and fiddling with the SmartThings app, but I’m hopeful the Creator device will automatically update for you.

It is possible that the Create and Inventory buttons may be temporarily non-functional, but give it some time and restart the app to see if it eventually gets fixed.

I anticipate that Android users will have things work fairly quickly, but iOS users may see delays or even have the Creator device not working again. If that is the case, then delete the Creator device and get it re-created through an Add device / Scan for nearby devices action in the app. You can do this without affecting your existing virtual devices. (Those with the CLI can use it to reinstall the driver manually, which should also get things back to normal).

Please report your experiences here (specify Android or iOS) so I can determine if this new approach worked or is a failure!

Be aware that new devices seem to now be created in whatever room your hub device is located in, as opposed to the No room assigned room.

17 Likes