I’ve a smartapp that handles switches, sirens, contact sensors, … working without problems. However, when I try to add a push button, in simulation mode, the button callback method is never called.
with same result. When the simulation starts, a virtual button appears, with five options on it: button 1 pushed, button 1 held, … . However, none of them seems to trigger the method “onButtonOff” to write the log message.
Any hint?
Addendum:
If I’ve the “live logging” opened in another window, following message appears when the option “button1 pushed” of the virtual button is clicked:
b6770c4e-57e2-4139-b39c-f1b76b2364c3 5:00:05 PM: error groovy.lang.MissingMethodException: No signature of method: script_dth_436b0865_5bbd_4160_89b0_b34cd798e940_ver_6_6.zwaveEvent() is applicable for argument types: (physicalgraph.zwave.commands.basicv1.BasicSet) values: [BasicSet(value: 21)]
Possible solutions: createEvent(java.util.Map)
Error message in the “live logging” appears under the tab “buttonOff” of the live logging, not in the “Test” tab, thus, I suppose it is coming from the device handler.
In the test location I’ve no custom device handlers.
Yes, it could be, but it is a very simple example app and using the standard virtual button, (not using a custom one), I’ve no idea what I’m doing wrong.
It will be very, very useful if someone loads this app in his own test environment and checks if the error happens.
As you know, when simulation is started, the IDE allows to select the device (for each input) to be used. One of them is the virtual one, the other ones are the physical ones that are connected to the hub (if any).
I’m testing in a pure virtual location, no physical devices, the button is the virtual one that the IDE allows. In this case, the callback is never called and the error message appears.
When testing in a real location and with a physical button, the app works as expected, the callback is called. Could be an error in the official IDE simulator ?
tgauchat
(ActionTiles.com co-founder Terry @ActionTiles; GitHub: @cosmicpuppy)
10
Is this software element available in any public repository ? ( in some places it is said that smartthings is FOS, but the only code I’ve found is for some smartapps and handlers ).
Moreover, If someone confirms the issue, we could raise an issue to Samsung ( how ? )
tgauchat
(ActionTiles.com co-founder Terry @ActionTiles; GitHub: @cosmicpuppy)
13
You can contact Support@SmartThings.com to raise issues; but be forewarned: You very likely will not get assistance with development problems (IDE, etc.).
Could be an error in the capabilty code (see here) ?
The “parse” method is calling “zwaveEvent”, but this one is not defined in the code.
If we compare with other capabilities, most of them doesn’t use “parse” at all, and the ones that uses it defines a lot of “zwaveEvent” methods (see capability zwave-motion-sensor by example)
tgauchat
(ActionTiles.com co-founder Terry @ActionTiles; GitHub: @cosmicpuppy)
15
zwaveEvent is built into the platform, but is not required for parse() to work. A DTH can receive ZigBee messages, as well as IP (LAN) or cloud-cloud API messages from a service manager.
I’m sorry… But I’ve lost track of what is your question or issue?
If the issue is that the Simulator appears to be malfunctioning, then it’s definitely not worth any time to debug it. NEVER trust or even bother with the simulator!
Just publish and install / instantiate your SmartApp, real or virtual Device(s), test using the mobile App while viewing the Live Logging tab in the IDE.
The original question is “why this app doesn’t works in the simulator?”.
After the received answers and collected info, problem seems related to the device handler of the simulator button, that seems implemented in the capability definition, thus, next question is “there are an error in the implementation of the simulation of the button or its is something specific of my environment?”.
Finally, as this part is open-source, I can not agree with the statement “it’s definitely not worth any time to debug it”, issue can and must be fixed and error reported to their maintainers. Of course, this is a voluntary activity for person who want collaborate in the project.
Kind regards.
tgauchat
(ActionTiles.com co-founder Terry @ActionTiles; GitHub: @cosmicpuppy)
17
The simulator is not open source.
The code of the “virtual buttons” you can create in the simulator is not the same as “simulated buttons” you can generate by manually creating instances from source code. This latter method is much more powerful as you can add custom debugging statements anywhere in the DTH (as well as in your SmartApp).
Anyhow, if you don’t care for my advice, there’s nothing I can do:
It is probably very frustrating to you, @DiasExtranyos, but what @tgauchat says is borne out by years of experience with the SmartThings platform. Feel free to report issues about the simulator and/or IDE to Support — just don’t expect anything to be fixed! You can search the forum to find many other threads expressing this same frustration!
In the meantime, perhaps you will find out what works for you and how to work around the shortcomings of the development platform. There are a lot of powerful things that can be done here…