setColor() arguments error. Source Code attached

Continuing the discussion from setColor() argument:

The shared link is access to my code.

Hi KD,

We can’t access source code directly from your IDE account.

You need to use a GitHub repository, please.

i.e., this link doesn’t work unless we are logged in as you :scream: https://graph.api.smartthings.com/ide/app/editor/818991b7-1795-4426-abd5-d5f9a3210db4

My apologies. I’m new to this and GitHub. See if this works

What type (brand, model, Device Type Handler) are the “slaves”?

If the “slaves” do not implement setColor() correctly, then your code could be 100% correct, but still not work.

Its the same as the code i gave you the first time: https://gist.github.com/joshua-moore/7c8f8355f217770bae56

I’m sorry… we’re going in circles. Let’s start fresh.

The SmartApp code you linked works fine, but doesn’t do anything (it doesn’t subscribe to any events).

So how it is that you are getting an error please?

1 Like

The problem, as I said in the other Topic is not your SmartApp, it is your “Virtual Device Type Handler”.

See here: Your setColor() method only takes ONE argument; the Capability specification says it must take TWO arguments:

oooh OK. I’m getting the picture. So how would I go about handling this? Would it need to equal two strings, one pertaining to hex and one to saturation?

OK got ya. so for it to actually change the bulb, I would need to implement the sendEvent() method.

1 Like

Something like that might work, but really…

Study (read several times) the Capability colorControl section: One simple home system. A world of possibilities. | SmartThings

Then realize … it is really a bit of an ambiguous mess… (not your fault… it just evolved inconsistently, IMHO. There have been a few discussions on this…


For a “sync” SmartApp I think you can avoid using the setColor() method, and, instead use the Hue and Saturation Attributes and Commands directly:

1 Like


Updated SmartApp. Hopefully this subscribes to events and makes changes

Well… Is it working?

according to the simulator, no. It gave me this message:

grails.validation.ValidationException: Validation Error(s) occurred during save():

I don’t trust the simulator.

Why not create actual instance(s) of your Virtual Device and/or real color control Things; install the SmartApp into your SmartThings and test it using the SmartThings Mobile App while Live Logging is running on your PC?

Runs fine with no error but doesn’t change the color of the bulb

Get Outlook for iOS

1 Like

Well that’s better!

Add a whole bunch of log.debug() statements so you can trace what parts of the SmartApp and DTH are running, and the values of variables, etc., in Live Logging.