treban / pimatic-raspbee

This plugin provides a raspbee interface for pimatic.
GNU General Public License v2.0
5 stars 5 forks source link

Set Color Temperature for RGB Bulbs doesnt work #17

Closed scobby closed 5 years ago

scobby commented 6 years ago

Hi Treban, the color temperature for RGB (tradfri rgb bulb) doesnt work.

for example: setCT?colorCode=81

or via the frontend slider for color temperature.

cany you fix this?

treban commented 6 years ago

I will take a look at it

treban commented 5 years ago

The problem is, that die tradfri RGB Bulb does not support color temperature out of the box over the deconz api.

I can't change the color-temperature over the deconz website either.

deconz knows 3 types of lights see here

plugin device type features deconz device type
RaspBeeCT change temperature Color temperature light
RaspBeeRGB change color Color light
RaspBeeRGBCT change color and temperature Extended color light

I will check if i can implement a transformation formula.

00lex commented 5 years ago

now I run into the same issue https://github.com/michbeck100/pimatic-hap/issues/80#issuecomment-511478360

can you give me a hint?

set color rgb Paradieslicht2 to to #121212
set color rgbct Paradieslicht2 to to #121212

does not work :( I just get "the" from "set color rgb"

Bildschirmfoto 2019-07-15 um 21 37 50
00lex commented 5 years ago

no solution, but im a little closer. here my observation:

I don't know how to add RaspBeeRGBCT to action.coffee :(

its a little OT, but why do you use hex values? if I take a look at the variables, I see regular numbers

treban commented 5 years ago

@00lex you're right the RGBCT devices class is not completely covered by the rules. i will fix that soon! for the hap plugin i am preparing a pull request, so that support is fully implemented for CT-only bulbs and sensors.

the rgb hex value is historically related :) I will add an action provider with hue and sat parameters.

00lex commented 5 years ago

I will add an action provider with hue and sat parameters.

that was just a question without intentions. but good, thank you!

00lex commented 5 years ago

okay with the last update this works to: dim raspbee ParadieslichtRGBCT to 90 and set color rgb ParadieslichtRGBCT to #BF2413

I can live with that and I´m happy. my old workflow with hue-zll was set a color and read the values from variables to write rules.

now I set a color, read the HSV values from dashboard:

Bildschirmfoto 2019-07-16 um 15 13 14

and then convert them on this site to the hex value for the rule: https://www.rapidtables.com/convert/color/hsv-to-rgb.html

Bildschirmfoto 2019-07-16 um 15 18 07

its not ideal, but it works

00lex commented 5 years ago

wait I make a mistake! I can only read the HSV value from hue-zll bulbs, not from raspbee-bulbs

treban commented 5 years ago

i will rebuild the color management and change from rgb to hsv. then it's consistent.

00lex commented 5 years ago

okay perfect!

in this context, I remember there's another benefit if you change HEX to HSV. https://forum.pimatic.org/topic/2983/shuffle-color/4 hope you are a disco guy :)

I think the raspbee-plugin in this state makes hue-zll and the tradfri plugin obsolete 👍

00lex commented 5 years ago

Feedback:

ok, i edit my config to transferee all my rules from the hue-zll to raspbee plugin. raspbee has another behavior. if a bulb is tuned off with the following execution: dim raspbee Paradieslicht to $dimlv_paradies and set color rgb Paradieslicht to #8A8B7A, I get an error because the bulb was turned off.

to handle this, I need to add a delay for the second action: dim raspbee Paradieslicht to $dimlv_paradies and set color rgb Paradieslicht to #8A8B7A after 1s

everything else works as before. thank you! EDIT: that's OT but maybe interesting for you in case v2 bricks things in your plugin some day.

and this is OT too, but its a very cool hack for aqara body motion sensor. I've done this with 5 and it works since one week perfect https://github.com/dresden-elektronik/deconz-rest-plugin/issues/1671

treban commented 5 years ago

@00lex new beta is published pimatic-raspbee@0.1.2 = pimatic-raspbee@beta can you check it?

tradfri bulbs are Color light -> no native color temperature support , implemented by philips hue are `Extended color light? -> native color temperature support

pimatic Device type Feature Deconz Resource Type
RaspBeeRGB change color and temperature Color light
RaspBeeRGBCT change color and temperature Extended color light
00lex commented 5 years ago

philips hue are `Extended color light?

I think, but im not sure.

the new versions has no for me notable issues. the update itself runs without issues, first start without unexpected errors, rules can be written as with hue-zll and values of hue+saturation match the expected final color.

instal of (v0.1.1): dim raspbee Fensterbrett to $dimlv_salon +10 transition time 10s and set color rgb Fensterbrett to #8A8B7A after 1s

we can no write again (v0.1.2): dim raspbee Fensterbrett to $dimlv_salon +10 transition time 10s and set color Fensterbrett to hue 12.85 and sat 55 after 1s

KUDOS! I just test it with a hue bulb and a hue light stripe.

just on thing. maybe for documentation. if I bulb is turned off, you have to put a small delay after the second action if the rule dim AND set a color. else you get a error and the color will not change. this behavior doesn't exist with hue-zll, but I don't see a problem to handle this with a delay.

00lex commented 5 years ago

from my site you can push the release button and close this issue 👍

treban commented 5 years ago

0.1.2 released