Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hue Emulator Color Support #1311

Closed
ertanden opened this issue Oct 10, 2016 · 16 comments · Fixed by #4216
Closed

Hue Emulator Color Support #1311

ertanden opened this issue Oct 10, 2016 · 16 comments · Fixed by #4216

Comments

@ertanden
Copy link

ertanden commented Oct 10, 2016

Would be nice to have color support in hue Emulator.

Currently it doesn't work through Logitech Harmony. Can't set light colors.

@digitaldan
Copy link
Contributor

What build are you on? There was an issue for this and a fix this week, if you could try it out and confirm it works that would be great

@ertanden
Copy link
Author

Yes, actually I was the one reporting that issue too: #1266. If you like you can close this and re-open #1266.

I'm on a recent snapshot. 2.0.0.201610080957 is the version of Hue Emulation binding.

@digitaldan
Copy link
Contributor

Yes, actually I was the one reporting that issue too:

Sorry missed that. Actually I had been assuming this was a conversion issue, now I realized I'am advertising everything as a "LWB004" device, which is not a Color hue bulb. That would be the problem. Let me play around with how to solve this, one thought is if the item is a ColorItem, then advertise a Color bulb, another however would be to support a "ColorLight" tag, there's currently a discussion about tagging symantics at eclipse-archived/smarthome#1093 . I'll probably go with the item type to start,

@jackdead
Copy link

Hey, i am also very interested in the color support in the Hue Emulation Binding. Anything new on this topic?

@yp87
Copy link

yp87 commented Jan 3, 2017

Same, I would like to be able to change colors through Google Home and other application using the hue emulator. One use case I am looking forward to is to connect the Hue Disco (colors following music) app to the hue emulator so that my ledstrip follows the color changes like my hue bulbs.

Any update on this issue?

@colinfrei
Copy link

Any update on this? I'd like to use Alexa to change colors, but it says my device doesn't support that.
I think the device would need to be advertised as an 'Extended Color Light' (and possibly a different model id) for that to work, seems that's hardcoded though.

@felixloesch
Copy link

I would also like to see this feature. Especially that Alexa can now control light color of Hue Bulbs as well.
So +1. Please implement it @digitaldan.

@NickWaterton
Copy link
Contributor

I looked at the code, and there seems to be an attempt to support colour items in there, but it doesn't work. It seems to depend on a ColorItem.state being an instance of HSBType, which it isn't. By default a ColorItem.state is DecimalType (it returns brightness), you have to cast the colorItem to HSBType to be able to access all the properties.

It should be looking at the item type, not state, as state does not neccesarily reflect the item type accurately.

@felixloesch
Copy link

So what are your proposed changes to the code? Just the cast or is there more that needs to be changed? I would support the change and test a new version of the binding.

@felix-loesch
Copy link

I am happy to support in adding color support for hue emulation binding @digitaldan.
I looked at the code and assume we have to announce different light bulb types depending on the item type of the hue device in Openhab. All different hue bulb types are listed on the following page: https://developers.meethue.com/documentation/supported-lights)

@TheNetStriker
Copy link

I did take a look at the code and I think the main problem is that simply that the conversion to HSBType is not quite right yet. The brightness is converted to openhab format (from 0 - 255 to percent type) but the saturation is not converted to percent type. (also 0 - 255) Also the hue value is not converted. (This should be divided by 182 regarding to the hue addon) I've changed the method toHSBType in the HueState.java like this:

    public HSBType toHSBType() {
        int brightness = 0;
        int saturation = 0;
        int hue = 0;
        if (this.on || this.bri > 0) {
            // if on but brightness is less then 1, set HSB brightness to 100, otherwise convert Hue brightness
            brightness = this.bri < 1 ? 100 : (int) (this.bri / 255.0 * 100);
        }
        if (this.on || this.sat > 0) {
            // if on but saturation is less then 1, set HSB saturation to 100, otherwise convert Hue saturation
            saturation = this.sat < 1 ? 100 : (int) (this.sat / 255.0 * 100);
        }
        if (this.on || this.hue > 0) {
            // if on but hue is less then 1, set HSB hue to 14924, otherwise convert Hue hue
            hue = this.hue < 1 ? 14924 : (int) (this.hue / 182);
        }
        return new HSBType(new DecimalType(hue), new PercentType(saturation), new PercentType(brightness));
    }

This seams to solve the problem that the Phillips Hue color values are not accepted. But the problem is still that a lot of apps are having problem recognizing the emulated api because there are a lot of json properties that are not provided by the emulation. (e.g. groups, config, schedules, scenes, rules, sensors and resourcelinks)

So we also would need to have a definition which of those json properties are required at minimum for those apps to recognize the api properly.

@felix-loesch
Copy link

Could be the case. But for example for Alexa all Openhab Items are offered as simple on/off lights. Even if the item in Openhab is defined as a color light item. In order for Alexa to recognize an openhab item as a color light it has to be offered as a color light via the hue emulation binding. Only then Alexa allows controlling the color attribute like this: "Alexa, switch to color blue".

@jd1
Copy link

jd1 commented Feb 24, 2018

I have the same problem with my Logitech Harmony. It seems to be that the harmony uses Brightness, X and Y to set the color, but the Hue emulator does simply ignore X and Y.

@Nicras
Copy link

Nicras commented Apr 1, 2018

Bump this...I need color for hue emulation hard. Would be very nice if someone can add this functionality

@gdgeist
Copy link

gdgeist commented Sep 1, 2018

Appears this is dead with no comments or code updates. Assuming "color" will not work with Hue Emulation and Alexa anytime soon.

@davidgraeff
Copy link
Member

The referenced PR adds color support for the hue emulation. But controlling the color will not work with Alexa without a skill.

Flole998 pushed a commit to Flole998/openhab-addons that referenced this issue Dec 30, 2021
When generating a new binding with the maven archetype it should refer to openhab core via the variable `ohc.version` In the feature.xml.

Signed-off-by: Hilbrand Bouwkamp <hilbrand@h72.nl>
markus7017 pushed a commit to markus7017/openhab-addons that referenced this issue Aug 12, 2023
* Remove compatibility layer article.

Signed-off-by: Jerome Luckenbach <github@luckenba.ch>

* Removed IFTT temporary from sidebar.

Signed-off-by: Jerome Luckenbach <github@luckenba.ch>

* Remove Homebuilder Page and Sidebar Element.

Signed-off-by: Jerome Luckenbach <github@luckenba.ch>

* Remove Packages Page and Sidebar Element.

Signed-off-by: Jerome Luckenbach <github@luckenba.ch>

* Removed QNAP temporary from sidebar.

Signed-off-by: Jerome Luckenbach <github@luckenba.ch>

* Removed outdated link.

Signed-off-by: Jerome Luckenbach <github@luckenba.ch>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.