justme-1968 / alexa-fhem

Anbindung von FHEM über Alexa Smart Home Skill und/oder Custom Skill
https://wiki.fhem.de/wiki/FHEM_Connector
11 stars 7 forks source link

Hue Colormode xy not supported #22

Closed Rainerlan closed 2 years ago

Rainerlan commented 2 years ago

The Hue API has 2 different ways of changing the color: xy & hs mode. Alexa-fhem seem to supports hs mode only. My Innr RB 250 C bulbs support colormode xy only Can alexa-fhem be configured (through the huedevice device?) to support setting the color using colormode xy?

justme-1968 commented 2 years ago

that is not possible at the moment, also alexa itself has no support for xy.

but you can create a homebridge mapping for RGB instead of the autodetected one. then alexa fhem will send an rgb command and the hue device module in fhem will calculate an approximate xy command

Rainerlan commented 2 years ago

I know the homebridgemapping is off-topic - So sorry for the question - but as you just mentioned it...please allow the question: I am using this mapping (not the autodetected one) but still it does not work - would you recommend a different setting? clear On=state,cmdOn=on,cmdOff=off RGB=rgb,cmd=rgb Brightness=bri,cmd=bri ColorTemperature=ct,cmd=ct also I tried clear On=state,cmdOn=on,cmdOff=off Hue=hue,cmd=rgb Brightness=bri,cmd=bri ColorTemperature=ct,cmd=ct

Also using this mapping, the 1st event I see in fhem after the alexa command still is "set \<Huedevice> hue \<value>"

justme-1968 commented 2 years ago

please try with only RGB. something like clear On=state,cmdOn=on,cmdOff=off RGB=rgb,cmd=rgb. also please show the alexa-fhem log during startup.

Rainerlan commented 2 years ago

With RGB mapping, alexa-fhem displays the RGB value at startup correctly (for HUEDevice7) - but alexa device search (after having deleted the device before) detects the bulb only without color. On/off, brightness and colortemperature are working fine... I.e. bri and ct are detected fine, but color capability is only visible in the alexa-app if I use hue - RGB is not being recognized by alexa device search as "color-capable device". alexa-fhem-dbg_start_rgb.log Bildschirmfoto 2021-12-08 um 20 48 30. Seems the only thing I can do, is to use hue, choose a random cmd for hue which I define by a cmdalias, which will then set the rgb of the HUEdevice7... (Just need to find out if the correct conversion is already supported by the numerous fhem commands)

Rainerlan commented 2 years ago

Yepee! I solved it using a cmdalias: defmod huergb cmdalias set [\w\.]+ huergb \d+ AS {my $hue=$EVTPART2;;;;my $sat=ReadingsVal($EVTPART0,'sat','100');;;;my $bri=ReadingsVal($EVTPART0,'bri','100');;;;my ($r,$g,$b)=Color::hsv2rgb($hue,$sat/256,$bri/256);;;;fhem "set $EVTPART0 rgb ".Color::rgb2hex($r*255,$g*255,$b*255)} and homebridgemapping in the "HUEDevice": attr HUEDevice7 homebridgeMapping clear On=state,cmdOn=on,cmdOff=off Hue=hue,cmd=huergb Brightness=bri,cmd=bri ColorTemperature=ct,cmd=ct

Rainerlan commented 2 years ago

Kann es sein, dass der Hue-Wert nicht zurück an Alexa gemeldet wird? Ich kann ihn nicht finden... (Also eg. keinen "namespace":"Alexa.ColorController"...)

[9.12.2021, 01:19:19] [FHEM]     caching: On: dim37% (as string; from 'dim37%')
[9.12.2021, 01:19:19] [FHEM]     caching: Brightness: 100 (as string; from '100')
[9.12.2021, 01:19:19] <<<< [ssh] {"context":{"properties":[{"namespace":"Alexa.PowerController","name":"powerState","value":"ON","timeOfSample":"2021-12-09T00:19:19.953Z","uncertaintyInMilliseconds":500},{"namespace":"Alexa.BrightnessController","name":"brightness","value":100,"timeOfSample":"2021-12-09T00:19:19.953Z","uncertaintyInMilliseconds":500},{"namespace":"Alexa.ColorTemperatureController","name":"colorTemperatureInKelvin","value":2475,"timeOfSample":"2021-12-09T00:19:19.953Z","uncertaintyInMilliseconds":500}]},"event":{"header":{"namespace":"Alexa","name":"StateReport","payloadVersion":"3","messageId":"f5fa367d-c185-4e41-ac3a-511fee05fc59","correlationToken":"-"},"endpoint":{"scope":{"type":"BearerToken","token":"678B25D6-3723259F1FDC37E8"},"endpointId":"d0:cf:5e:ff:fe:ec:74:43-01"},"payload":{}}}
justme-1968 commented 2 years ago

ich hab dir im fhem forum geantwortet. kurz: da hat im code noch etwas gefehlt. probier mal bitte die version von da. ich mache hier zu und wir machen da weiter.