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

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.

This app used to work now I get nothing but errors when trying to add new buttons log says device version mismatch