BTW, I did a mockup of this in my DVE, and with only a few files tweaked it’s possible to have an MiOS String StateVariable “Bound” to a Color Item in openHAB.
The behavior of the [Classic] Sitemap UI for the Colorpicker is a little odd, but manageable. I’m not really sure how often someone would use that UI but, onward…
I have it taking a [HSB] Value from Vera, in the form h,s,b (eg. “120,30,100”) and it displays in the Colorpicker, as well as changing values in the Colorpicker and having them “call” a [fictitious] UPnP Action call:
urn:micasaverde-com:serviceId:Color1/setHSBTarget(newHSBTarget=??)
I picked a neutral serviceId, in case others wanted to use it, but it’s living in a config file (not code) so it’s easy to have others.
I just need Thomas to merge my other checkin, then I’ll put this into the code so it’s ready for when we need it.
Changes include, adding “[tt]miosHSBCommand.map[/tt]”:
INCREASE=urn:upnp-org:serviceId:Dimming1/SetLoadLevelTarget(newLoadlevelTarget=?++)
DECREASE=urn:upnp-org:serviceId:Dimming1/SetLoadLevelTarget(newLoadlevelTarget=?--)
OFF=urn:upnp-org:serviceId:Dimming1/SetLoadLevelTarget(newLoadlevelTarget=0)
ON=urn:upnp-org:serviceId:Dimming1/SetLoadLevelTarget(newLoadlevelTarget=100)
_defaultCommand=urn:micasaverde-com:serviceId:Color1/SetHSBTarget(newHSBTarget=??)
Tweaking a few code files, and then building a sitemap entry:
sitemap demo label="Color Menu" {
Frame label="Frequently Used" {
Colorpicker item=StaircaseLightsModeStateForEnergy label="Color List"
}
}
and a test item:
Color StaircaseLightsModeStateForEnergy "Staircase Lights Mode State (Energy) [%s]" {mios="unit:house,device:95/service/HVAC_OperatingState1/ModeStateForEnergy,command:MAP(miosHSBCommand.map)"}
PS: Just ignore the weird State Variable I slammed it into, that was something that Vera put against my Dimmer back in UI4…
The odd part is that I’m assuming the “Color” information is another serviceId hanging off an existing [Vera] Light Switch. Looking at the generated Items files though, it looks like the Hue binding is creating 2x devices for each bulb (one “regular” Light switch, and another device for the color information)… this might throw a wrench/spanner in the works.