[OBSOLETE] Trend Setter

Have you tried it with actiontiles? I was hoping it would show colour or state but shows wattage reading instead

I haven’t, but the likelihood is that ActionTiles doesn’t support the powerUsage attribute that I use to show if it’s off/low/medium/high/veryhigh as it’s not a standard attribute for any capabilities that I’m aware of.

It’s the same with the states of the switch group as normal switches only support “on” and “off” values, but the switch group devices in Trend Setter can have “mostlyOn”, “mostlyOff” and “half” which ActionTiles doesn’t support and just end up with a question mark.

There’s not a great deal can be done about it unless there was a capability that both SmartThings and ActionTiles supports that had the appropriate attributes and values.

Just wanted to say thanks for this great SmartApp @Kriskit! I had been wishing for the ability to group bulbs and other lights together as one unit/name for several months now and this app does just that and does it well.

I also love the way “ONISH” status displays when just some of the lights in a group happen to be on. It makes me smile every time.

1 Like

Hey @Kriskit - first of all, this app is perfect for what I wanted to do
coordinating collections of OSRAM Lightify lights.

I’ve discovered one oddity I’d like to dive in to:
I’ve got the master switch shared to the Google Home smart app, so I can use voice commands. On/off and dimmer levels to the Trendsetter Master work just fine. But color commands don’t seem to have any effect.

For instance:
Me: "OK Google, turn the Accent Lights ON."
Google: “OK, turning the Accent lights on.”
–All Lightify lights in the Accent group turn on.
Me: "OK Google, turn the Accent lights blue"
Google: “OK, turning the Accent lights blue”
–Lightify light color does not change.

It’s like whatever API that google calls to set the color, doesn’t get caught by the Trendsetter handler.

Have you selected the corect device type when you created the group? If you screen shot your master device it should show if its correct.

I think this is the correct RGBW type.

Looks good to me, I’ve got the same lights so I’ll set up the same tomorrow and see if I can see the same issue. :+1:

Hi sorry for delay I have now tested it and found the same, what I did notice is telling it to go to white did work though ie daylight white and warm white, but orange red and blue didn’t. @Kriskit is this something that can be fixed on your end?

I’m afraid I have no idea how Google Home perceives the devices. SmartThings is basically an abstraction of the device you want to control - from what I can tell, Google Home (like Amazon Echo) would see the RGBW controller device the same as it’d see any other RGBW device. The only thing that might be happening is that the integration with Google Home is using a different method of setting the colour than the Trend Setting virtual device supports, but I wouldn’t know what that is as the commands are governed by the capabilities set on the device handler which are built into the ST platform.

I don’t have Google Home so I can’t test it, maybe if you could have the IDE Live Log open whilst trying the commands it might show something?

yep here

926fe758-8fec-4b38-b814-869a46b2f7eb 15:42:45: error java.lang.IllegalArgumentException: All Values must be Integers between 0 and 100. Received: (67, 100) @line 438 (setColor)
926fe758-8fec-4b38-b814-869a46b2f7eb 15:42:19: debug Setting color temperature to 5000
926fe758-8fec-4b38-b814-869a46b2f7eb 15:42:19: debug syncColorTemp(): [5000, 5000]
926fe758-8fec-4b38-b814-869a46b2f7eb 15:42:16: debug Setting color temperature to 5000
926fe758-8fec-4b38-b814-869a46b2f7eb 15:42:07: debug Percent On: 100
926fe758-8fec-4b38-b814-869a46b2f7eb 15:42:07: debug syncSwitch(): [on, on]
926fe758-8fec-4b38-b814-869a46b2f7eb 15:41:42: debug Setting level to 100
926fe758-8fec-4b38-b814-869a46b2f7eb 15:41:42: debug syncLevel(): [100, 100]
926fe758-8fec-4b38-b814-869a46b2f7eb 15:41:42: debug Percent On: 0
926fe758-8fec-4b38-b814-869a46b2f7eb 15:41:42: debug syncSwitch(): [off, off]

nothing happened on this page when i said blue

6c6bac0f-add9-4ff4-9046-c73b4aa9b03c 15:42:19: debug Updating Controller State: colorTemperature → [5000, 5000]
6c6bac0f-add9-4ff4-9046-c73b4aa9b03c 15:42:19: debug getChildDevices(false), children=1
6c6bac0f-add9-4ff4-9046-c73b4aa9b03c 15:42:18: debug Device state change: Main Light → colorTemperature = 5000
6c6bac0f-add9-4ff4-9046-c73b4aa9b03c 15:42:18: debug Device state change: Hallway → colorTemperature = 5000
6c6bac0f-add9-4ff4-9046-c73b4aa9b03c 15:42:16: debug Running command ‘setColorTemperature’ with arguments [5000] on [Hallway, Main Light]

6c6bac0f-add9-4ff4-9046-c73b4aa9b03c 15:42:16: debug Running command ‘on’ with arguments on [Hallway, Main Light]

6c6bac0f-add9-4ff4-9046-c73b4aa9b03c 15:42:07: debug Updating Controller State: level → [100, 0]
6c6bac0f-add9-4ff4-9046-c73b4aa9b03c 15:42:07: debug Updating Controller State: switch → [on, on]
6c6bac0f-add9-4ff4-9046-c73b4aa9b03c 15:42:07: debug getChildDevices(false), children=1
6c6bac0f-add9-4ff4-9046-c73b4aa9b03c 15:42:07: debug Device state change: Main Light → level = 100
6c6bac0f-add9-4ff4-9046-c73b4aa9b03c 15:42:06: debug Device state change: Main Light → switch = on
6c6bac0f-add9-4ff4-9046-c73b4aa9b03c 15:42:06: debug Device state change: Main Light → level = 0
6c6bac0f-add9-4ff4-9046-c73b4aa9b03c 15:42:06: debug Device state change: Hallway → switch = on
6c6bac0f-add9-4ff4-9046-c73b4aa9b03c 15:41:42: debug Updating Controller State: level → [100, 100]
6c6bac0f-add9-4ff4-9046-c73b4aa9b03c 15:41:42: debug Updating Controller State: switch → [off, off]
6c6bac0f-add9-4ff4-9046-c73b4aa9b03c 15:41:42: debug getChildDevices(false), children=1
6c6bac0f-add9-4ff4-9046-c73b4aa9b03c 15:41:41: debug Device state change: Main Light → level = 100
6c6bac0f-add9-4ff4-9046-c73b4aa9b03c 15:41:40: debug Device state change: Hallway → switch = off
6c6bac0f-add9-4ff4-9046-c73b4aa9b03c 15:41:40: debug Device state change: Main Light → level = 0
6c6bac0f-add9-4ff4-9046-c73b4aa9b03c 15:41:40: debug Device state change: Main Light → switch = off
6c6bac0f-add9-4ff4-9046-c73b4aa9b03c 15:41:40: debug Running command ‘off’ with arguments on [Hallway, Main Light]


and google logs

6accc4a6-5db4-4f3e-976c-508fdce2baec 15:42:45: debug Outgoing: [requestId:9578623889734873876, payload:[commands:[[ids:[926fe758-8fec-4b38-b814-869a46b2f7eb], status:PENDING]]]]
6accc4a6-5db4-4f3e-976c-508fdce2baec 15:42:45: debug Set Test Lights to 255
6accc4a6-5db4-4f3e-976c-508fdce2baec 15:42:45: debug handleExecute()
6accc4a6-5db4-4f3e-976c-508fdce2baec 15:42:16: debug Outgoing: [requestId:5437567610752848404, payload:[commands:[[ids:[926fe758-8fec-4b38-b814-869a46b2f7eb], status:PENDING]]]]
6accc4a6-5db4-4f3e-976c-508fdce2baec 15:42:16: debug Set Test Lights color temperature to 5000K
6accc4a6-5db4-4f3e-976c-508fdce2baec 15:42:16: debug handleExecute()
6accc4a6-5db4-4f3e-976c-508fdce2baec 15:41:40: debug Outgoing: [requestId:3816409648227453787, payload:[commands:[[ids:[926fe758-8fec-4b38-b814-869a46b2f7eb], status:PENDING]]]]
6accc4a6-5db4-4f3e-976c-508fdce2baec 15:41:39: debug Turn off Test Lights
6accc4a6-5db4-4f3e-976c-508fdce2baec 15:41:39: debug Turn Test Lights off
6accc4a6-5db4-4f3e-976c-508fdce2baec 15:41:39: debug handleExecute()

Can you run me through what commands you gave it? I’m assuming the first one is the group controller device, and the second one s the group smart app.

The main issue appears to be that the setColor command has received some values it wasn’t expecting. It makes sense that the controller device doesn’t receive any commands for blue because it blew up.

The code in question according to the error is this.
image

There’s a possibility that the values being passed in are not integers, even though they’re outputting properly as 67, 100 in the logs.

If you’re willing and able, can you try doing the following?

Replace the second line of the above code (line 438) on the Colorful Temperature Light Group Device handler with:

hex = colorUtil.hslToHex(Integer.parseInt(value.hue), Integer.parseInt(value.saturation))

This should hopefully force the type to the correct one.

from memory turn on (OK)
Turn off (OK)
Turn on again (OK)
manually changed the colours to see the messages using phone
Change the test light to white (OK)
Change the test light to blue (failed)

think so i should have named them as what they were rather than test lights and test light.

no worries i have tried and this is the error message

926fe758-8fec-4b38-b814-869a46b2f7eb 16:19:57: error groovy.lang.MissingMethodException: No signature of method: static java.lang.Integer.parseInt() is applicable for argument types: (java.lang.Long) values: [67]
Possible solutions: parseInt(java.lang.String), parseInt(java.lang.String, int), print(java.lang.Object), print(java.io.PrintWriter) @line 438 (setColor)
926fe758-8fec-4b38-b814-869a46b2f7eb 16:19:36: debug Percent On: 100
926fe758-8fec-4b38-b814-869a46b2f7eb 16:19:36: debug syncSwitch(): [on, on]
926fe758-8fec-4b38-b814-869a46b2f7eb 16:19:35: debug Setting level to 100
926fe758-8fec-4b38-b814-869a46b2f7eb 16:19:35: debug syncLevel(): [100, 100]

Ah ok, I’d forgotten they’ve restricted access to the Integer static but made a function available globally.

Try changing it to:

hex = colorUtil.hslToHex(parseInt(value.hue), parseInt(value.saturation))

Please :slight_smile:

no cigar

   926fe758-8fec-4b38-b814-869a46b2f7eb  16:29:20: error groovy.lang.MissingMethodException: No signature of method: script_dth_914dc755_b117_4880_b6f9_f1ceebdff05a_ver_0_3.parseInt() is applicable for argument types: (java.lang.Long) values: [33]
    Possible solutions: parseXml(java.lang.String), parse(java.lang.String), print(java.io.PrintWriter), print(java.lang.Object), pages(), parseJson(java.lang.String) @line 438 (setColor)
    926fe758-8fec-4b38-b814-869a46b2f7eb  16:28:49: debug Percent On: 100
    926fe758-8fec-4b38-b814-869a46b2f7eb  16:28:49: debug syncSwitch(): [on, on]
    926fe758-8fec-4b38-b814-869a46b2f7eb  16:28:35: debug Setting level to 100
    926fe758-8fec-4b38-b814-869a46b2f7eb  16:28:35: debug syncLevel(): [100, 100]
    926fe758-8fec-4b38-b814-869a46b2f7eb  16:28:35: debug Percent On: 0
    926fe758-8fec-4b38-b814-869a46b2f7eb  16:28:35: debug syncSwitch(): [off, off]

also think its the other way round as the one with the errors on isnt the name of the group in the SA

Right, sorry I get it
 it’s sending a Long type
 how annoying.

Ok, one more try and I’ll stop wasting your time lol - I’m at work so a bit limited as to what I can do myself to try things out.

hex = colorUtil.hslToHex((int)value.hue, (int)value.saturation)

Sorry!

no worries it the lease I can do (im no coder, i can only just read it!)

This did the trick :sunglasses:

logs to orange then blue

926fe758-8fec-4b38-b814-869a46b2f7eb  16:40:21: debug syncHue(): [67, 67]
926fe758-8fec-4b38-b814-869a46b2f7eb  16:40:08: debug syncHue(): [8, 8]
926fe758-8fec-4b38-b814-869a46b2f7eb  16:40:08: debug syncSaturation(): [100, 100]

group

6c6bac0f-add9-4ff4-9046-c73b4aa9b03c  16:40:21: debug Updating Controller State: hue -> [67, 67]
6c6bac0f-add9-4ff4-9046-c73b4aa9b03c  16:40:21: debug getChildDevices(false), children=1
6c6bac0f-add9-4ff4-9046-c73b4aa9b03c  16:40:20: debug Device state change: Main Light -> hue = 67
6c6bac0f-add9-4ff4-9046-c73b4aa9b03c  16:40:18: debug Running command 'setHue' with arguments [67] on [Hallway, Main Light]...
6c6bac0f-add9-4ff4-9046-c73b4aa9b03c  16:40:18: debug Running command 'on' with arguments [] on [Hallway, Main Light]...
6c6bac0f-add9-4ff4-9046-c73b4aa9b03c  16:40:18: debug Running command 'setSaturation' with arguments [100] on [Hallway, Main Light]...
6c6bac0f-add9-4ff4-9046-c73b4aa9b03c  16:40:18: debug Running command 'on' with arguments [] on [Hallway, Main Light]...
6c6bac0f-add9-4ff4-9046-c73b4aa9b03c  16:40:18: debug Running command 'setColor' with arguments [[hue:67, saturation:100, level:null]] on [Hallway, Main Light]...
6c6bac0f-add9-4ff4-9046-c73b4aa9b03c  16:40:08: debug Updating Controller State: hue -> [8, 8]
6c6bac0f-add9-4ff4-9046-c73b4aa9b03c  16:40:08: debug Updating Controller State: saturation -> [100, 100]
6c6bac0f-add9-4ff4-9046-c73b4aa9b03c  16:40:08: debug getChildDevices(false), children=1
6c6bac0f-add9-4ff4-9046-c73b4aa9b03c  16:40:07: debug Device state change: Main Light -> hue = 8
6c6bac0f-add9-4ff4-9046-c73b4aa9b03c  16:40:07: debug Device state change: Hallway -> hue = 8
6c6bac0f-add9-4ff4-9046-c73b4aa9b03c  16:40:07: debug Device state change: Main Light -> saturation = 100
6c6bac0f-add9-4ff4-9046-c73b4aa9b03c  16:40:04: debug Running command 'setHue' with arguments [8] on [Hallway, Main Light]...
6c6bac0f-add9-4ff4-9046-c73b4aa9b03c  16:40:04: debug Running command 'on' with arguments [] on [Hallway, Main Light]...
6c6bac0f-add9-4ff4-9046-c73b4aa9b03c  16:40:04: debug Running command 'setSaturation' with arguments [100] on [Hallway, Main Light]...
6c6bac0f-add9-4ff4-9046-c73b4aa9b03c  16:40:04: debug Running command 'on' with arguments [] on [Hallway, Main Light]...
6c6bac0f-add9-4ff4-9046-c73b4aa9b03c  16:40:04: debug Running command 'setColor' with arguments [[hue:8, saturation:100, level:null]] on [Hallway, Main Light]...

Wonderful, I’ll update the github code :slight_smile:

1 Like

Ok @StephenB , github code updated - either use below, or update from github :slight_smile:

Let me know if this fixes it for you too :slight_smile:

1 Like

This fixes it for me too.

Somehow, it wasn’t sending me this thread when you all were debugging. Sorry I didn’t see it and participate.

So when Google makes the call to Smartthings, it’s passing in a long integer for hue and saturation? And then you’re doing an explicit cast to standard integers?