SwitchMania [UPDATED] - create 4 different kinds of virtual switches

having the same error trying to create a Virtual switch… thanks

I get the error as well. Any fix to this? Here are my DTH’s and SmartApps:

image

What am I missing? Also could you suggest where I may find it?

Thanks

I also cannot find it

I am missing the SmartThings’ default “On/Off Button Tile” DTH can someone advise where I can get this please?

Well, SwitchMania doesn’t work thats my conclusion. I have spent x3 evenings pissing about with this thread and im getting nowhere fast.

So I have found this: FAQ: Creating a virtual Device

Manually creating vSwitches is going to be easier than getting SwithMania to work (which you probably won’t be able to).

1 Like

After about 10 minutes of manually creating a virtual device I do indeed conclude that SwitchMania nothing more than a waste of time.

Not for me. It has worked from day one and creating virtual devices has never been easier.

YMMV

2 Likes

For those that want to use this smart app but are discouraged by it not working - I just installed it and it worked fine, but does appear to require a tiny bit of tweaking. Here are the steps I used:

  1. Log into the smartthings IDE @ https://account.smartthings.com [edited]
  2. Go to infofiend’s repository and install everything you can.
  3. In the IDE go to ‘device handlers’ and ‘+ create new device handler’ and select ‘from code’
  4. From infofiends respository, paste the code in for the following device types:
    4a. Device One: ‘Momentary-Button-Tile.groovy’ then select “Create” --> ‘Publish’ -> ‘For me’
    (repeat step 3)
    4b. Device Two: ‘simulated-presence-sensor.groovy’ then select “Create” -->‘Publish’ -> ‘For me’
    (repeat step 3)
    4c. Device Three: ‘virtual_dimmer’ then select “Create” --> ‘Publish’ -> ‘For me’

…but wait, you need 4 devices! The 4th device can be pulled direct from smartthings IDE.

  1. Device Handlers --> Create New Device Handler --> From Template
  2. Select On/Off Button Tile. select “Create” --> ‘Publish’ -> ‘For me’

Next its onto the smart apps. Similar procedure, but under ‘My Smart Apps’

  1. ‘My Smart Apps’ --> ‘+New SmartApp’ --> ‘From Code’
    8a - 8c. Paste in, create, and publish the code for the following items in the infofiend repository:
    a. my-switch-calls-routines-app.groovy
    b. my-virtual-switch-creator.groovy
    c. switch-mania.groovy

the ‘trick’. What made it finally all work for me was making one minor tweak to the code.

  1. Under ‘My SmartApps’ --> ‘My Virtual Switch Creator’ on lines 56 - 64 it lists the different switch types you installed. However, it lists the ‘Momentary Button Tile’ switch as “MichaelStruck”. I don’t have that version, for whatever reason - that’s not what was in the infofiend repository (at least that I installed). So you have to change that line to “smartthings” as follows:

def childDevice = addChildDevice(“smartthings”, “Momentary Button Tile”, deviceId, null, [label: switchLabel])

Blockquote

Make that change and hit publish. App seems to be working. Haven’t done a full test with everything, but it at least creates the switches without errors as others previously reported.

That’s all I know. Hope this helps.

1 Like

FYI: don’t direct people here. This is only a portion of people’s shard and doesn’t redirect them correctly.

When logging into SmartThings, use:

https://account.smartthings.com

Then they are directed appropriately to their shard (graph.api… na04-east1)

3 Likes

Wow, never knew that. What gem. That whole shard thing confused the hell out of me when I first got smartthings. Completely cryptic and didn’t seem to be documented anywhere.

1 Like

It ends up creating hell for people, because some can login to the graph.api but that isn’t their shard, so they go adding SmartApps, Device Handlers and Virtual Devices and then they can’t figure out why it isn’t showing up in the Marketplace or under Things and this is one of the most major culprits, so when I see it, I try to say something so others don’t end up creating bigger issues for themselves.

Yup. had no idea. Updated link. Thanks.

1 Like

I have forked and updated this available here
I have changed/updated all the device handlers & made them GitHub installable as a few wasn’t before.

Please Note: You must install the main app Switch Mania first otherwise the child apps won’t install
Owner: tmleafs
Name: SwitchMania
Branch: master

2 Likes

I get an unexpected error when trying to add a new device I have added all 3 apps and published and the 2 device handlers but will not work.

There are 4 device handlers and 2 smartapps…

are you using my stuff or tmleafs’ fork?

getting this Error when trying to do the smart apps side.

Error

500: Internal Server Error

URI

/ide/app/doRepoUpdates

Never mind I figured it out.

How did you fix this?

I’m really sorry but I honestly don’t remember.