SOLVED: Set device capabilities in virtual BinaryLight device

I have copied the BinaryLight device and SwitchPower service files as a reference for creating a virtual switch and added my own Implementation file that calls LUA code to do do things on state changes. This part works OK.

However, I cannot seem to get this virtual switch to generate events that other scenes can use. I can configure scenes to use events from the virtual switch (they are listed there when I set them up so the system knows about them) but when I change the switch state no event is triggered.

One thing I have noticed is that my virtual switch has no Capabilities variable. I am assuming that this may be the problem but cannot see how to set this up anywhere - UI4 would not let me add one manually.

My D and S files are attached - what should I be looking at to see why I get no events?


IIRC, the event definitions must be placed in [tt]D_…json[/tt] (for UI4).

I already have a json file uploaded (attached) based upon the PowerSwitch one - do I need to include that filename in some other XML file to ensure that it gets loaded, or is it looked for automatically based upon the base filename?


Please see for a working implementation of a virtual state device.

Thank you - all I neded to do was add


into my device file and it started to work.

Many thanks Ap15e


Updated zip file here.

Gang, I’m stuck. I’ve just started a somewhat nerve-racking process of upgrading from my very stable and reliable Vera1 running UI2 to Vera2 on UI4, and one of the first things I wanted to do was verify that I could create virtual devices for scene control, because I’m going to have to recreate all my scenes from scratch on Vera2.

I searched and found many threads on this subject, and downloaded the latest D_ and I_ files provided by several members, and followed instructions carefully to create a Binary Switch device. However, the device just shows up with an icon, and no actual buttons. I’ve restarted the LUA engine multiple times, with no result, and I still can’t get a device that looks like…,2495.msg32731.html#msg32731

Instead, mine looks like the image below.

So then I decided to re-create my motion sensor based virtual device that I currently use on my Vera1. Same result. I get the same kind of device with a generic icon, but no buttons reflecting the armed/unarmed status of the motion sensor. I have verified that my code to set state is working, so the device seems to have been created correctly.

Any gudiance would be appreciated. What am I missing?

The bottom line is that uploading the D_ and I_ files from the zip file mentioned 2 posts back and then creating a new device with D_StateDevice.xml as the device file should do the trick.

You’re saying that doesn’t work for you? And your real binary switches look fine, presumably?

(I haven’t tried this recently on UI4, but just tested it on a Vera Lite and I got a switch with buttons.)

For some reason, you have to wait and the thing makes itself right after a while. I had the same issue. I was creating a second virtual switch and after some time - not sure how long - maybe a couple of hours.

I just came across this in the forum…,9484.msg64213.html#msg64213

Wondering if this might be my problem, as I’m currently running 1.1.1362. Ugh.

It’s now been 24 hours with Vera2 running, and both of my virtual devices still look non-functional. Generic icon, no buttons, not showing up as devices when I open the Scene form to develop a scene.

I did this on UI5 and no problems with multiple switches. Maybe an issue with UI4?

IIRC, that is related to .lua files only, not .xml.

working on UI4 here, ver 11245

I cannot define a simple binary flag device in my Vera 2 (1.1.1362). Is there anyone out there that is successfully using a virtual device on Vera 2, UI4, 1.1.1362 firmware?

I have followed every thread in the forum on this subject, and when I read that 1.1.1362 broke the uploading of uncompressed LUA files, followed by a posting from MCV that said the firmware that corrects this (1.1.1365) isn’t a public release, I just about pulled my hair out. So the latest supported UI4 firmware for a Vera2 isn’t working (or is 1.1.1362 not the latest UI4 firmware)?

I’ve essentially got a useless Vera2 at this point. I’m stuck on 1.1.1362 because every attempt to upgrade to UI5 screws it up and requires a factory reset. I can’t do anything with it on this version because I can’t create a simple virtual device. And I can’t seem to find a later, supported version of UI4 firmware.

After so much success and reliability with my Vera1 running UI2, I’m beyond discouraged with all the challenges I’ve had with Vera2.

It is my belief that UI4 ver 1.1.1245 is the latest “supported” version of UI4 and that the later versions had some fixes and possibly some regressions so were never officially released

I believe that is accurate, going by the announcements on the public beta board and the (incomplete) release notes; with 1.1.1365 being the last non-public build.

My impression is 1.1.1338 is better than 1.1.1245, as it addresses the Z-Wave Network reset issue.

1.1.1350, 1.1.1362 and 1.1.1365 being small incremental updates.

Theoretically 1.1.1365 is the best, but it hasn’t been tested enough because it was made back in February (IIRC) and we were busy getting out a new UI5 release. That’s why it was never released.

I would have to search the boards but I think there was a (possibly) small regression that was significant to me which is why I left my V2 at 1245, might have been loss of a proper mode display on schlage/Trane thermostat