Feature Request - On/Off Button Tile - why can't you install it from the ST App itself

[wasn’t sure where to put this. So, since it was stated here in this thread…]
Wow, this is really cool!
I just installed it and created a vswitch to test, and, of course, it worked just like that.
Thanks, Eric.

1 Like

If you follow the GitHub directions, this app creates switches just as described, and they work!

Here are just a few notes for people using this App, since it has some confusing behavior for a newby (at least for a newby who thinks like me):

When you go to Marketplace -> SmartApps -> My Apps -> Virtual On/Off Switch Creator, two things will happen when you click “Done”:

  1. A new device will show up under My Locations -> [Location Name] -> Things -> named whatever you entered in the “Switch Label” field
  2. A new App will show up under My Locations -> [Location Name] -> SmartApps -> named whatever you entered in the “Assign a name” field. If you don’t enter a name, the App name will be “Virtual On/Off Switch Creator”

I think that is all expected.

The less expected parts for me is that the new virtual switch and the new App are inextricably linked in a 1:1 relationship. So to create a new virtual switch you have to repeat the whole process above, and can’t just use the App already created in My Locations -> [Location Name] -> SmartApps -> [Assign a name], as the App that is already there is only related to the single virtual switch that was created when that App was created.

This means that every virtual switch created has one App, and every App has one virtual switch. If you remove the App under My Locations -> [Location Name] -> SmartApps -> [Assign a name] , then the virtual switch associated with this App under My Locations -> [Location Name] -> Things -> [Switch Label] vanishes. If you remove the virtual switch under My Locations -> [Location Name] -> Things -> [Switch Label], then the App associated with this virtual switch under My Locations -> [Location Name] -> SmartApps -> [Assign a name] vanishes. So to have 20 switches, you need 20 apps.

This might be expected behavior to some, but I thought I was going to have one version of the app and could create 1:N virtual switches with that app, and the switches would be free on their own to be managed. If you think this way, you might also just assume that the App was a helper App, and try to delete it after the virtual switch was created, but this will delete the virtual switch. Also if you use the virtual switch in another app, such as Rule Machine, and then try to delete the App associated with the switch, you will get the error “deleteObserver on Error: %s” (on Android). If you then remove the virtual switch from all use, you can delete the App, which will remove the switch.

Also if you enter the App and change the name of “Switch Label”, and click “Done” nothing happens except for the name in the “Switch Label” field of the App is saved. No new virtual switch is created, and the name of the original virtual switch created by this App doesn’t change. Also if you change the name of the virtual switch itself in Things, it will change the name of the virtual switch itself, but it doesn’t change the “Switch Label” field in the associated App. So these two items are linked, but you can’t quite tell they are linked at first unless you delete one of the pair.

I hope this helps some other new users understand what is happing with this app, which works very well, but is a bit confusing.

1 Like

OMG! I thought it was just me lol

Thanks @AutomateIt for taking the time to spell this all out, as it is exactly what I have been realizing as I just started to create more and more vswitches with this app. I see now that it is not really what I want. I want to create a bunch of vswitches, but not at the expense of also creating an equal number of apps.

So, is it true that, when creating a vswitch via the usual process in the IDE, it only results in a vswitch, and not another new app? If so, then the ‘hassle’ of having to go into the IDE to create a vswitch every time is well worth it…if for no other reason than this is way too confusing for noobs like me to keep track of…besides the fact that I don’t want to have to scroll through so many useless apps when I’m looking for something in my apps.

Not to say I don’t appreciate what was done here. I do (as stated in my other post above). I will continue to track this thing, and if it ever gets modified to not need to create an extra app for every single vswitch, I will start using it again.

Thanks again, Eric. Regardless of whether or not it meets all of the needs of everyone (never possible), this really is great work! :slight_smile:

That’s correct. It only creates the device, not an app.

1 Like

Thank you, sir. :smile:

20 chars