How does Alexa determine what commands a device supports?

So the question is what is being called in a “standard” DTH like Hue or Lifx? Who from SmartThings can we tag that might be able to answer?

EDIT: May have figured it out. I manually added a new bulb called “Test Color Bulb” using the LIFX Color Bulb device type. I then added it to Alexa and turned on debug. I said “Alexa set Test Color Bulb to Blue” and in logging I saw “setColor [hue:67, saturation:100]” so I’m thinking that be default “setColor” is the command it uses. Going to add that command to my DTH and just have a debug line in it and see if that is what is called.

Second Edit: Yup…setColor is what gets called with a color map which contains hue and saturation. If that doesn’t exist then apparently it doesn’t take color commands. I’ll add a setColor routine that just converts hue/sat over to a value that will go through my “normal” adjustColor routine I already have in place.

Last Edit: More testing and I’m 99% sure setColor is the “standard” way SmartThings transfers a color from Alexa/GH to a device type through the color map and not only is that name required but it has to be passed a “map color”. So the conversion seems to happen in the cloud and only the Hue/Sat is passed. I then take that and convert it to RGB then to Hex and its working great.

@jody.albritton - Can you confirm the above? Is it documented somewhere that I missed? I.e. a list of supported color names?

3 Likes