Problems with RGB color

Hi there,

I am using colorthief to get the album cover of an home assistant entity to control Hue RGB lights.

This is the node:

[{"id":"1328112d.c86bef","type":"tab","label":"Flow 1","disabled":false,"info":""},{"id":"f38777a7.f45c08","type":"function","z":"1328112d.c86bef","name":"RGB Data","func":"//Construct a payload to send to the light using our values\n  msg.payload = \n  {\n    \"data\":\n    {\n      \"rgb_color\": [msg.payload[0], msg.payload[1], msg.payload[2]]\n    }\n  }\n  return msg;","outputs":1,"noerr":0,"x":400,"y":180,"wires":[["52f0184d.8f5058","fa5f57da.3eae1","a92aab33.42ab9"]]},{"id":"7b1741df.4d213","type":"function-npm","z":"1328112d.c86bef","name":"Get-Color","func":"if (msg.payload == \"playing\"){\nconst { getColorFromURL } = require('color-thief-node');\nimageURL = \"https://xxx.xx.de:8123\" + msg.data.new_state.attributes.entity_picture;\nconst mainColor = getColorFromURL(imageURL) .then(values => { node.send({payload:values}); });}\nreturn;","outputs":1,"noerr":0,"x":240,"y":180,"wires":[["f38777a7.f45c08","a92aab33.42ab9"]]},{"id":"6bee77df.fa7a98","type":"api-call-service","z":"1328112d.c86bef","name":"Fernseher","server":"bf7fb19a.bb8b","version":1,"debugenabled":false,"service_domain":"light","service":"turn_on","entityId":"light.wohnzimmer_fernseher","data":"{\"brightness_pct\":\"70\"}","dataType":"json","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":760,"y":140,"wires":[["95269f43.737498"]]},{"id":"707baa0.2607758","type":"server-state-changed","z":"1328112d.c86bef","name":"Volumio","server":"bf7fb19a.bb8b","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"media_player.volumio_2","entityidfiltertype":"exact","outputinitially":true,"state_type":"str","haltifstate":"","halt_if_type":"str","halt_if_compare":"is","outputs":1,"output_only_on_state_change":false,"x":90,"y":180,"wires":[["7b1741df.4d213"]]},{"id":"52f0184d.8f5058","type":"api-current-state","z":"1328112d.c86bef","name":"Licht Wohnzimmer","server":"bf7fb19a.bb8b","version":1,"outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is","override_topic":false,"entity_id":"light.wohnzimmer","state_type":"str","state_location":"data","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":true,"x":570,"y":140,"wires":[["6bee77df.fa7a98","f23e9b81.45e34"],[]]},{"id":"95269f43.737498","type":"api-call-service","z":"1328112d.c86bef","name":"f.lux aus","server":"64b5bfad.bfd888","version":1,"debugenabled":false,"service_domain":"switch","service":"turn_off","entityId":"switch.flux","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":1000,"y":180,"wires":[[]]},{"id":"f23e9b81.45e34","type":"api-call-service","z":"1328112d.c86bef","name":"Couch","server":"bf7fb19a.bb8b","version":1,"debugenabled":false,"service_domain":"light","service":"turn_on","entityId":"light.wohnzimmer_couch","data":"{\"brightness_pct\":\"70\"}","dataType":"json","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":750,"y":200,"wires":[["95269f43.737498"]]},{"id":"fa5f57da.3eae1","type":"api-call-service","z":"1328112d.c86bef","name":"Dekolicht","server":"bf7fb19a.bb8b","version":1,"debugenabled":false,"service_domain":"light","service":"turn_on","entityId":"light.deko","data":"{\"brightness_pct\":\"100\"}","dataType":"json","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":760,"y":260,"wires":[["95269f43.737498"]]},{"id":"a92aab33.42ab9","type":"debug","z":"1328112d.c86bef","name":"","active":true,"tosidebar":true,"console":false,"tostatus":false,"complete":"false","statusVal":"","statusType":"auto","x":580,"y":340,"wires":[]},{"id":"bf7fb19a.bb8b","type":"server","z":"","name":"Home Assistant"},{"id":"64b5bfad.bfd888","type":"server","z":"","name":"Home Assistant","legacy":false,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":true}]

When I am doing a debug I get for example RGB 22,103,154 from the debug node.

RGB Color on my Hue Iris and my E27 bulbs is: 38,170,255
RGB Color on my Hue color spot is: 145,129,255

This is the cover:
c175

and these are the colors (determined, E27/Iris, Color Spots)

Do you have an idea what that can be?

Greets
Daniel

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.