Okay, so I am getting started with SmartThings after just playing around and poking at them. Let me first say that I’m a software developer by trade (funny enough I use Java and Groovy all day long) and so far I really enjoy what I have seen in SmartThings.
However, that said. I’m running into some stumbling blocks. Let me begin with the overall concept and then offer up the current working versions of my Device Type Handler and SmartApp. I’m stumbling over controlling the color of the bulbs.
Overall, what I am looking to do, is to control multiple OSRAM RGBW 5/6 Bulbs with a single device. I figured the best way to approach this would be to create a Virtual device type handler and a SmartApp that relays the events to the bulbs.
The first part, the virtual device type handler is based on the existing ZigBee RGBW device type handler. I’ve basically gutted it and wired it to sendEvents. The first thing that I’ve struggled with was “setColor” and initial state of the device, then later about what data to pass along. Take a look at the comments in the code to see what I attempted and what I’ve ended up doing (hint: just passing along hex value and nothing else).
The second part, the SmartApp, is very simple and straight forward. Everything works fine, minus setting the color. I somehow thing this is related to the fact I was only able to pass along the hex value from the device type handler. It really seems like I’m having to do a lot more work than I should have to (converting hex to HSB and such). Again, the comments in the code show the evolution of what I’ve tried.
Anyone out there familiar with setColor and the OSRAM RGBW bulbs willing to give me some pointers or tips?
The lack of accurate documentation, fragmented code all over GitHub and untold number of versions posted in the community forum really makes the process of getting accurate information confusing and frustrating. I suspect this is my main problem, and lack of experience with SmartThings.
Here is the code in question:
Device Type Handler