Simulator virtual devices not working

This is very strange. In an account without physical hub Imanaged to finish the tutorial successfully. So then I used another account in which i have the Smartthings hub associated, i tried to follow the sample again with no success. The installation in the simulator is ok, but the virtual switch and the virtual motion detector are not working. I can click on the drop down menu to select on or off or active or inactive but the apply button does nothing.
Does anyone has an idea?

I presume you are referring to the Simulator in the IDE (development environment)?

There’s definitely a problem / bug that few of us have posted around the Forum.

Please be sure to email: Support@SmartThings.com, and I’m taking @Dianoga, @slagle, @jody.albritton so they are aware this is becoming noticed by more folks.

This has come back. When doing anything in the IDE simulator I get the following error anytime I try to control a simulated/virtual device.
10:11:51 PM: error java.lang.ArrayIndexOutOfBoundsException

I have taken out all my code except the setup code (so it’s not even calling my functions that I’m aware of). I created a new test location (w/o a hub) and still no luck. Any debugging pointers?

This is a bug that’s currently being worked on.

That said, you’re long term best bet is going to be self publishing and installing on your phone.

1 Like

Jim
question 1:
are you advising that virtual devices not working is a known bug?
or
the exception mentioned by Daniel_Villa is the known bug??

I’m not generating errors when trying to simulate a virtual device, my problem is that the virtual device does nothing. the eventhandler doesn’t even initiate.

question 2:
Why is it best (long term) to self-publish and install on phone? I’m assuming that youre suggesting publishing it and assigning the devices to physical devices in preference? how does this help testing while creating smartapps? for something simple i dont mind running around the house triggering the device but for anything complex this is not feasible. I’m not sure if im getting what you are trying to suggest

I’m referring to the specific ArrayIndexOutOfBoudsException mentioned above.

If you look around these forums, you’ll see that experienced SmartThings developers will often advise that the simulator is prone to the occasional glitch or inconsistencies with the mobile app. To avoid frustration, I would also recommend following this approach - use the simulator as a quick test, but self-publish and install on a mobile app as the primary means of testing. You don’t need to necessarily use physical devices when installing to the mobile app; you could create virtual devices and then just use those in the SmartApp.

It can be pretty frustrating to think there’s something wrong with your code, only to find that it’s just the simulator that’s acting up. That’s why you’ll see advice to use the mobile app instead of the simulator.

Thanks, and Merry Christmas! :christmas_tree:

2 Likes

thank you so much for the immediate reply and merry christmas!

so…
I’m having an issue where virtual devices does not work at all. no exceptions thrown and the eventhandler doesnt even initiate. any help, tips to resolve this? if not, can i report this issue to Smartthings?

I definitely agree that final testing should be published to app. my problem is that i cant use the simulator while developing my smartapp because the virtual devices doesnt work at all; this makes troubleshooting, debugging my code very difficult!

I hope you understand my intention, i’m not looking to argue. i just want virtual devices to work for me so that i can write my smartapp

edit…
btw. im new to smartthings so excuse my ignorance. i re-read your post and am editing my response. part 1. when you refer to mobile app you mean smartthings from android app store? part 2. how do you assign it to a virtual device on the app?

1 Like

Of course! That sounds really frustrating. I suggest posting as much code/details here as you can, and see if anyone else has any ideas or workarounds they’ve used. The community developers here are awesome and usually have figured out how to do things.

It may be a couple days before anyone on the SmartThings staff looks in detail at your specific issue due to the holidays (including me), but it doesn’t hurt to post all the details here. You certainly can also create a support ticket for your issue, but you’re best path towards resolution will be the community.

1 Like

i do appreciate the response on christmas. so thank you

1 Like

SmartThings staff of various sorts monitor this Community Forum and sometimes step in with direct assistance… Consumers tend to get priority over Developers; because Community Developers help each other… And eventually, if the scope of the problem is outside the tremendous experience and creativity here, it is sometimes resolved by SmartThings staffing, but, realistically, may be “back-burnered” as a bug/feature request with indeterminate resolution plan.

And so it is often best to seek workarounds if you have an urgent requirement, in my experience.


In this case, you should have no trouble to instantiate devices of your Virtual Type, and thus no need the simulator.

You can add lots of log.debug output (to Live Logging) and even extra Tiles to push in test data and/or a hard coded SmartApp that triggers test events.

In other words… old school debugging.

Simplify simplify simplify until something works and makes sense and then incrementally modify, test, modify, test… Until you succeed.

All the “expert” Community Developers here have had to go through this process for both learning curve and workaround situations.

  1. YES, the SmartThings mobile App for Android and/or iOS is where you must test, but use the IDE to watch Live Logging for errors and log.debug output.

  2. Once you “publish for me” a DTH or SmartApp you can: a. Instantiate Devices using the IDE Add Device, select any unique name & ID, b. Install the SmartApp from the My SmartApps at bottom of Marketplace tab in the App.

1 Like

i created a doorsensor device and currently shows open. how do i toggle device state? i tried pressing what ever i could on the device page and the Things page.

great advice about the live logging, thanks

assigned it as Simulated Contact Sensor. Jim and tgauchat thanks for help. i think i have everything i need to test my smartapp!

2 Likes