Custom OnOffSwitch With Virtual Adapter

Running gateway v0.9.2 and virtual adapter v0.7.0. Also using Twilio, GPIO, Zigbee and Pulse adapters.

I’ve made great progress with a Rpi system controlling a hot water pump recirc motor, leak detection and basic security with Twilio notification. I’d like to add some more features. Making use of several virtual on/off switches would make for clean solutions.

Here’s the problem…

With the virtual adapter installed I can select the OnOffSwitch from the things template and it works fine but I only get one switch (need multiple). I’ve tried to create a custom OnOffSwitch but the switch created does not allow a mouse click toggling of state (on/off) from the “things” page without hanging up. I’ve taken screen shots (4 total) of the custom thing’s configuration (below) and suspect I’ve got something configured wrong. Any ideas how to get a custom OnOffSwitch configured correctly?


Your screenshots look right. After you’ve added the thing to your gateway, click on the spider/splat icon on your thing to open up the properties view, then click the vertical button at the bottom right. Then, click “Edit”. After doing so, you should be able to change the thing type from “Custom Thing” to “On/Off Switch”, which will give you the functionality you want.

Thanks for your quick response. Didn’t work though. Getting the same symptom as before. Mouse click on the object in the things screen and it won’t change from off to on. Seems to hang up with “…” on the icon.

The object was brought into the gateway as an onoffswitch initially. To test your approach I removed it from the gateway, brought it back in as a “thing” and then edited the thing to an onoffswitch. Any other ideas?

I have a fix coming soon. When you get v0.7.1 of the Virtual Things add-on, things should work properly.

Thanks mrstegeman. I’ll look forward to the update.

I tested the update this morning and everything works! Thanks for your effort.

1 Like