This forum uses cookies
This forum makes use of cookies to store your login information if you are registered, and your last visit if you are not. Cookies are small text documents stored on your computer; the cookies set by this forum can only be used on this website and pose no security risk. Cookies on this forum also track the specific topics you have read and when you last read them. Please confirm that you accept these cookies being set.

Hue Brightness feedback
#81
Hello. 

A few months ago, I integrated Philips Hue lighting fixtures that support dimming, color temperature change, and RGB. Everything works perfectly, except I hadn't set up the feedback for the light fixture's state if you change it from the Philips Hue app. Before posting on the forum, I carefully reviewed all topics related to this issue. I am using "user.hue v5.lua" and "resident hue feedback v2.lua". The on/off, dimming, and RGB feedback work perfectly. However, neither the color temperature change itself nor its feedback are working correctly. For example, I set 2000K from W4K, and in the Hue app, it shows a completely different color. The feedback also doesn't work. When I disable the feedback script, the color temperature control works correctly. I am using the following script. Please help me find where I am going wrong. I have spent over 2 days on this problem without a resolution.

Regards, 
Nayden 


Code:
-- Set name (Lookup in HUE app under light configuration) and feedback adresses (don't change statevalue, brivalue and colorvalue as they are used as memoryfield) addressmapping = {   -- Name                  -- On/Off FB       -- Bright FB   -- Color FB   ['Cove lighting-cr'] = {state = '1/0/9', bri = '32/2/9', rgb = '32/3/9', ct = '32/4/9', statevalue = '', brivalue = '', colorvalue = '', ctvalue = ''} } -- Set polling interval in seconds interval = 1 -- Use logging logging = false -- Load needed lib's require('user.hue') require('json') -- loop indefenitly while true do   reply = getHueLights()   mylamps = json.decode(reply)   for _, item in pairs(mylamps) do     -- Check if lamp is found by bridge otherwise it make no sense to send commands     if item.state.reachable == true then       -- On/Off       name = addressmapping[item.name]       if name then         addr = addressmapping[item.name]['state']         if addr and addr ~= '' then           currentvalue = addressmapping[item.name]['statevalue']           if currentvalue ~= item.state.on then             grp.write(addr, item.state.on)             addressmapping[item.name]['statevalue'] = item.state.on             if logging == true then               log('lamp ' .. item.name .. ' state is: ' .. tostring(item.state.on))             end           end         end       end       --Brightness       if item.state.bri then         name = addressmapping[item.name]         if name then           addr = addressmapping[item.name]['bri']           if addr and addr ~= '' then             -- Check if lamp is on otherwise overrule BRI value to 0             if item.state.on == false then               item.state.bri = 0             end             currentvalue = addressmapping[item.name]['brivalue'] or 0             if currentvalue ~= item.state.bri then               grp.write(addr, math.floor((tonumber(item.state.bri)/2.55) + 0.5))               addressmapping[item.name]['brivalue'] = item.state.bri               if logging == true then                 log('lamp ' .. item.name .. ' brightness is: ' .. math.floor((tonumber(item.state.bri)/2.55) + 0.5) .. ' %')               end             end           end         end       end            -- Color temperature       name = addressmapping[item.name]       if name and item.state.ct then         addr = addressmapping[item.name]['ct']         if addr and addr ~= '' then           newvalue = math.floor(1000000 / item.state.ct)           currentvalue = addressmapping[item.name]['ctvalue']           if currentvalue ~= newvalue then             grp.update(addr, newvalue)             addressmapping[item.name]['ctvalue'] = newvalue             if logging == true then               log('lamp ' .. item.name .. ' color temperature is: ' .. newvalue .. ' K')             end           end         end       end          --Color       if item.state.ct or item.state.xy then         name = addressmapping[item.name]         if name then           addr = addressmapping[item.name]['rgb']           if addr and addr ~= '' then             -- Check if lamp is on otherwise overrule color value to 0             if item.state.on == false then                colorvalue = 0             end             if item.state.colormode == 'xy' then               currentvalue = addressmapping[item.name]['colorvalue']               colorvalue = xy_to_rgb(item.state.xy[1],item.state.xy[2],item.state.bri)               --colorvalue = xyz_to_rgb((item.state.xy[1] * 100), (item.state.xy[2] * 100))               if currentvalue ~= colorvalue then                 grp.checkwrite(addr, colorvalue)                 addressmapping[item.name]['colorvalue'] = colorvalue                 if logging == true then                   log('lamp ' .. item.name .. ' color is: ' .. colorvalue)                 end               end             elseif item.state.colormode == 'ct' then               currentvalue = addressmapping[item.name]['colorvalue']               --colortemp = math.floor((item.state.ct / 0.0769) + 0.5)  --0.0769230769230769               colortemp = math.abs((item.state.ct - 500) / 2)               colortemp = math.floor(colortemp + 0.5)               colortemp = 80 + colortemp               if colortemp > 255 then                 colortemp = 255               end               r = lmcore.inttohex(255, 1)               g = lmcore.inttohex(255, 1)               b = lmcore.inttohex(colortemp, 1)               rgb = r .. g .. b               colortemp = lmcore.hextoint(rgb,3)               if currentvalue ~= colortemp then                 --colortempconverted = ct_to_rgb(colortemp)                 grp.write(addr, colortemp)                 addressmapping[item.name]['colorvalue'] = colortemp                 if logging == true then                   log('lamp ' .. item.name .. ' color is: ' .. colortemp)                 end               end             end           end         end       end     end   end   -- Delay loop   os.sleep(interval) end
Reply
#82
Log the status reply and post what you have there.
Reply
#83
(23.07.2025, 13:06)admin Wrote: Log the status reply and post what you have there.

Hello,

I'm noticing that when I change the color temperature, the RGB parameter also changes.

Regards, 
Nayden

Curent logs:
apit3 (app daemon) 23.07.2025 16:11:39
* arg: 1
  * string: [DEBUG]
* arg: 2
  * string: publish_message(): response=
* arg: 3
  * number: 2092
* arg: 4
  * string: , err=
* arg: 5
  * nil
apit3 (app daemon) 23.07.2025 16:11:39
* arg: 1
  * string: [DEBUG]
* arg: 2
  * string: Sending message #_publishDatapointsValues succed: 2092
apit3 (app daemon) 23.07.2025 16:14:02
* arg: 1
  * string: [DEBUG]
* arg: 2
  * string: publish_message(): response=
* arg: 3
  * number: 2092
* arg: 4
  * string: , err=
* arg: 5
  * nil
apit3 (app daemon) 23.07.2025 16:14:02
* arg: 1
  * string: [DEBUG]
* arg: 2
  * string: Sending message #_publishDatapointsValues succed: 2092
apit3 (app daemon) 23.07.2025 16:14:03
* arg: 1
  * string: [DEBUG]
* arg: 2
  * string: publish_message(): response=
* arg: 3
  * number: 2092
* arg: 4
  * string: , err=
* arg: 5
  * nil
apit3 (app daemon) 23.07.2025 16:14:03
* arg: 1
  * string: [DEBUG]
* arg: 2
  * string: Sending message #_publishDatapointsValues succed: 2092
apit3 (app daemon) 23.07.2025 16:14:19
* arg: 1
  * string: [DEBUG]
* arg: 2
  * string: publish_message(): response=
* arg: 3
  * number: 2092
* arg: 4
  * string: , err=
* arg: 5
  * nil
apit3 (app daemon) 23.07.2025 16:14:19
* arg: 1
  * string: [DEBUG]
* arg: 2
  * string: Sending message #_publishDatapointsValues succed: 2092
apit3 (app daemon) 23.07.2025 16:14:20
* arg: 1
  * string: [DEBUG]
* arg: 2
  * string: publish_message(): response=
* arg: 3
  * number: 2092
* arg: 4
  * string: , err=
* arg: 5
  * nil
apit3 (app daemon) 23.07.2025 16:14:20
* arg: 1
  * string: [DEBUG]
* arg: 2
  * string: Sending message #_publishDatapointsValues succed: 2092

Current errors:

23 23.07.2025 15:55:20
Resident script:143: attempt to perform arithmetic on local 'current_color_value' (a string value)
stack traceback:
123 23.07.2025 15:55:30
Resident script:143: attempt to perform arithmetic on local 'current_color_value' (a string value)
stack traceback:
123 23.07.2025 15:55:41
Resident script:143: attempt to perform arithmetic on local 'current_color_value' (a string value)
stack traceback:
123 23.07.2025 15:55:53
Resident script:143: attempt to perform arithmetic on local 'current_color_value' (a string value)
stack traceback:
123 23.07.2025 15:56:06
Resident script:143: attempt to perform arithmetic on local 'current_color_value' (a string value)
stack tracebac
Reply
#84
Post your whole script. What is at line 143? Log the current_color_value variable value.
Reply
#85
(23.07.2025, 13:38)admin Wrote: Post your whole script. What is at line 143? Log the current_color_value variable value.

Apologies, but those errors were from the previous script I was testing. I uploaded the new one at 4:10 PM, and its last line is number 132.
Reply
#86
In this case log mylamps variable value after line 20.
Reply
#87
(23.07.2025, 13:45)admin Wrote: In this case log mylamps variable value after line 20.

Apologize in advance, but I'm not sure I understood exactly what I need to do.
Reply
#88
add log(mylamps) after line 20 in your script
------------------------------
Ctrl+F5
Reply
#89
(23.07.2025, 14:25)Daniel Wrote: add log(mylamps) after line 20 in your script

Hello,

After I inserted log(mylamps)  after line 20 in my script, the result is:

Code:
Hue feedback 24.07.2025 11:17:24 * table: ["23"]   * table:    ["swversion"]     * string: 1.122.8    ["swconfigid"]     * string: 24EB3638    ["uniqueid"]     * string: 00:17:88:01:0c:a0:12:e7-0b    ["capabilities"]     * table:      ["control"]       * table:        ["colorgamut"]         * table:          [1]           * table:            [1]             * number: 0.6915            [2]             * number: 0.3083          [2]           * table:            [1]             * number: 0.17            [2]             * number: 0.7          [3]           * table:            [1]             * number: 0.1532            [2]             * number: 0.0475        ["ct"]         * table:          ["min"]           * number: 153          ["max"]           * number: 500        ["colorgamuttype"]         * string: C        ["maxlumen"]         * number: 350        ["mindimlevel"]         * number: 200      ["streaming"]       * table:        ["renderer"]         * bool: true        ["proxy"]         * bool: true      ["certified"]       * bool: true    ["swupdate"]     * table:      ["state"]       * string: noupdates      ["lastinstall"]       * string: 2025-07-17T11:37:04    ["productid"]     * string: Philips-LCG002-3-GU10ECLv2    ["manufacturername"]     * string: Signify Netherlands B.V.    ["productname"]     * string: Hue Centris spot    ["modelid"]     * string: 5060730P7_02    ["state"]     * table:      ["ct"]       * number: 369      ["reachable"]       * bool: true      ["alert"]       * string: select      ["on"]       * bool: false      ["bri"]       * number: 254      ["mode"]       * string: homeautomation      ["colormode"]       * string: ct      ["hue"]       * number: 8401      ["sat"]       * number: 142      ["effect"]       * string: none      ["xy"]       * table:        [1]         * number: 0.459        [2]         * number: 0.4103    ["type"]     * string: Extended color light    ["name"]     * string: Centris spot 1    ["config"]     * table:      ["startup"]       * table:        ["mode"]         * string: safety        ["configured"]         * bool: true      ["function"]       * string: mixed      ["archetype"]       * string: huecentris      ["direction"]       * string: omnidirectional ["28"]   * table:    ["swversion"]     * string: 1.122.8    ["swconfigid"]     * string: 49730BB6    ["uniqueid"]     * string: 00:17:88:01:0b:f3:74:80-0b    ["capabilities"]     * table:      ["control"]       * table:        ["colorgamut"]         * table:          [1]           * table:            [1]             * number: 0.6915            [2]             * number: 0.3083          [2]           * table:            [1]             * number: 0.17            [2]             * number: 0.7          [3]           * table:            [1]             * number: 0.1532            [2]             * number: 0.0475        ["ct"]         * table:          ["min"]           * number: 153          ["max"]           * number: 500        ["colorgamuttype"]         * string: C        ["maxlumen"]         * number: 1600        ["mindimlevel"]         * number: 40      ["streaming"]       * table:        ["renderer"]         * bool: true        ["proxy"]         * bool: true      ["certified"]       * bool: true    ["swupdate"]     * table:      ["state"]       * string: noupdates      ["lastinstall"]       * string: 2025-07-17T11:37:00    ["productid"]     * string: Philips-LCL001-1-LedStripsv4    ["manufacturername"]     * string: Signify Netherlands B.V.    ["productname"]     * string: Hue lightstrip plus    ["modelid"]     * string: LCL001    ["state"]     * table:      ["ct"]       * number: 156      ["reachable"]       * bool: true      ["alert"]       * string: select      ["on"]       * bool: false      ["bri"]       * number: 254      ["mode"]       * string: homeautomation      ["colormode"]       * string: ct      ["hue"]       * number: 41432      ["sat"]       * number: 75      ["effect"]       * string: none      ["xy"]       * table:        [1]         * number: 0.3143        [2]         * number: 0.3301    ["type"]     * string: Extended color light    ["name"]     * string: Hue lightstrip plus dining    ["config"]     * table:      ["startup"]       * table:        ["mode"]         * string: safety        ["configured"]         * bool: true      ["function"]       * string: decorative      ["archetype"]       * string: huelightstrip      ["direction"]       * string: omnidirectional ["10"]   * table:    ["swversion"]     * string: 1400-0001    ["uniqueid"]     * string: 00:15:8d:00:08:1d:b9:80-01    ["capabilities"]     * table:      ["control"]       * table:        ["ct"]         * table:          ["min"]           * number: 153          ["max"]           * number: 370      ["streaming"]       * table:        ["renderer"]         * bool: false        ["proxy"]         * bool: false      ["certified"]       * bool: false    ["swupdate"]     * table:      ["state"]       * string: notupdatable      ["lastinstall"]       * string: 2023-06-10T09:10:45    ["manufacturername"]     * string: Paulmann Licht    ["productname"]     * string: Color temperature light    ["modelid"]     * string: 500.46    ["state"]     * table:      ["ct"]       * number: 255      ["reachable"]       * bool: true      ["alert"]       * string: select      ["mode"]       * string: homeautomation      ["colormode"]       * string: ct      ["on"]       * bool: false      ["bri"]       * number: 254    ["type"]     * string: Color temperature light    ["name"]     * string: Celling light 3    ["config"]     * table:      ["function"]       * string: functional      ["archetype"]       * string: ceilingsquare      ["direction"]       * string: omnidirectional ["5"]   * table:    ["swversion"]     * string: 10751203    ["uniqueid"]     * string: a4:c1:38:39:f7:b3:aa:56-0b    ["capabilities"]     * table:      ["control"]       * table:        ["ct"]         * table:          ["min"]           * number: 158          ["max"]           * number: 495      ["streaming"]       * table:        ["renderer"]         * bool: false        ["proxy"]         * bool: false      ["certified"]       * bool: false    ["swupdate"]     * table:      ["state"]       * string: notupdatable      ["lastinstall"]       * string: 2023-04-23T16:37:15    ["manufacturername"]     * string: GLEDOPTO    ["productname"]     * string: Color temperature light    ["modelid"]     * string: GL-C-006P    ["state"]     * table:      ["ct"]       * number: 255      ["reachable"]       * bool: true      ["alert"]       * string: select      ["mode"]       * string: homeautomation      ["colormode"]       * string: ct      ["on"]       * bool: false      ["bri"]       * number: 254    ["type"]     * string: Color temperature light    ["name"]     * string: Cove lighting    ["config"]     * table:      ["function"]       * string: mixed      ["archetype"]       * string: huelightstrip      ["direction"]       * string: omnidirectional ["9"]   * table:    ["swversion"]     * string: 1400-0001    ["uniqueid"]     * string: 00:15:8d:00:08:1d:bf:a2-01    ["capabilities"]     * table:      ["control"]       * table:        ["ct"]         * table:          ["min"]           * number: 153          ["max"]           * number: 370      ["streaming"]       * table:        ["renderer"]         * bool: false        ["proxy"]         * bool: false      ["certified"]       * bool: false    ["swupdate"]     * table:      ["state"]       * string: notupdatable      ["lastinstall"]       * string: 2023-06-10T09:10:43    ["manufacturername"]     * string: Paulmann Licht    ["productname"]     * string: Color temperature light    ["modelid"]     * string: 500.46    ["state"]     * table:      ["ct"]       * number: 255      ["reachable"]       * bool: true      ["alert"]       * string: select      ["mode"]       * string: homeautomation      ["colormode"]       * string: ct      ["on"]       * bool: false      ["bri"]       * number: 254    ["type"]     * string: Color temperature light    ["name"]     * string: Celling light 1    ["config"]     * table:      ["function"]       * string: functional      ["archetype"]       * string: ceilingsquare      [... Hue feedback 24.07.2025 11:17:25 * table: ["23"]   * table:    ["swversion"]     * string: 1.122.8    ["swconfigid"]     * string: 24EB3638    ["uniqueid"]     * string: 00:17:88:01:0c:a0:12:e7-0b    ["capabilities"]     * table:      ["control"]       * table:        ["colorgamut"]         * table:          [1]           * table:            [1]             * number: 0.6915            [2]             * number: 0.3083          [2]           * table:            [1]             * number: 0.17            [2]             * number: 0.7          [3]           * table:            [1]             * number: 0.1532            [2]             * number: 0.0475        ["ct"]         * table:          ["min"]           * number: 153          ["max"]           * number: 500        ["colorgamuttype"]         * string: C        ["maxlumen"]         * number: 350        ["mindimlevel"]         * number: 200      ["streaming"]       * table:        ["renderer"]         * bool: true        ["proxy"]         * bool: true      ["certified"]       * bool: true    ["swupdate"]     * table:      ["state"]       * string: noupdates      ["lastinstall"]       * string: 2025-07-17T11:37:04    ["productid"]     * string: Philips-LCG002-3-GU10ECLv2    ["manufacturername"]     * string: Signify Netherlands B.V.    ["productname"]     * string: Hue Centris spot    ["modelid"]     * string: 5060730P7_02    ["state"]     * table:      ["ct"]       * number: 369      ["reachable"]       * bool: true      ["alert"]       * string: select      ["on"]       * bool: false      ["bri"]       * number: 254      ["mode"]       * string: homeautomation      ["colormode"]       * string: ct      ["hue"]       * number: 8401      ["sat"]       * number: 142      ["effect"]       * string: none      ["xy"]       * table:        [1]         * number: 0.459        [2]         * number: 0.4103    ["type"]     * string: Extended color light    ["name"]     * string: Centris spot 1    ["config"]     * table:      ["startup"]       * table:        ["mode"]         * string: safety        ["configured"]         * bool: true      ["function"]       * string: mixed      ["archetype"]       * string: huecentris      ["direction"]       * string: omnidirectional ["28"]   * table:    ["swversion"]     * string: 1.122.8    ["swconfigid"]     * string: 49730BB6    ["uniqueid"]     * string: 00:17:88:01:0b:f3:74:80-0b    ["capabilities"]     * table:      ["control"]       * table:        ["colorgamut"]         * table:          [1]           * table:            [1]             * number: 0.6915            [2]             * number: 0.3083          [2]           * table:            [1]             * number: 0.17            [2]             * number: 0.7          [3]           * table:            [1]             * number: 0.1532            [2]             * number: 0.0475        ["ct"]         * table:          ["min"]           * number: 153          ["max"]           * number: 500        ["colorgamuttype"]         * string: C        ["maxlumen"]         * number: 1600        ["mindimlevel"]         * number: 40      ["streaming"]       * table:        ["renderer"]         * bool: true        ["proxy"]         * bool: true      ["certified"]       * bool: true    ["swupdate"]     * table:      ["state"]       * string: noupdates      ["lastinstall"]       * string: 2025-07-17T11:37:00    ["productid"]     * string: Philips-LCL001-1-LedStripsv4    ["manufacturername"]     * string: Signify Netherlands B.V.    ["productname"]     * string: Hue lightstrip plus    ["modelid"]     * string: LCL001    ["state"]     * table:      ["ct"]       * number: 156      ["reachable"]       * bool: true      ["alert"]       * string: select      ["on"]       * bool: false      ["bri"]       * number: 254      ["mode"]       * string: homeautomation      ["colormode"]       * string: ct      ["hue"]       * number: 41432      ["sat"]       * number: 75      ["effect"]       * string: none      ["xy"]       * table:        [1]         * number: 0.3143        [2]         * number: 0.3301    ["type"]     * string: Extended color light    ["name"]     * string: Hue lightstrip plus dining    ["config"]     * table:      ["startup"]       * table:        ["mode"]         * string: safety        ["configured"]         * bool: true      ["function"]       * string: decorative      ["archetype"]       * string: huelightstrip      ["direction"]       * string: omnidirectional ["10"]   * table:    ["swversion"]     * string: 1400-0001    ["uniqueid"]     * string: 00:15:8d:00:08:1d:b9:80-01    ["capabilities"]     * table:      ["control"]       * table:        ["ct"]         * table:          ["min"]           * number: 153          ["max"]           * number: 370      ["streaming"]       * table:        ["renderer"]         * bool: false        ["proxy"]         * bool: false      ["certified"]       * bool: false    ["swupdate"]     * table:      ["state"]       * string: notupdatable      ["lastinstall"]       * string: 2023-06-10T09:10:45    ["manufacturername"]     * string: Paulmann Licht    ["productname"]     * string: Color temperature light    ["modelid"]     * string: 500.46    ["state"]     * table:      ["ct"]       * number: 255      ["reachable"]       * bool: true      ["alert"]       * string: select      ["mode"]       * string: homeautomation      ["colormode"]       * string: ct      ["on"]       * bool: false      ["bri"]       * number: 254    ["type"]     * string: Color temperature light    ["name"]     * string: Celling light 3    ["config"]     * table:      ["function"]       * string: functional      ["archetype"]       * string: ceilingsquare      ["direction"]       * string: omnidirectional ["5"]   * table:    ["swversion"]     * string: 10751203    ["uniqueid"]     * string: a4:c1:38:39:f7:b3:aa:56-0b    ["capabilities"]     * table:      ["control"]       * table:        ["ct"]         * table:          ["min"]           * number: 158          ["max"]           * number: 495      ["streaming"]       * table:        ["renderer"]         * bool: false        ["proxy"]         * bool: false      ["certified"]       * bool: false    ["swupdate"]     * table:      ["state"]       * string: notupdatable      ["lastinstall"]       * string: 2023-04-23T16:37:15    ["manufacturername"]     * string: GLEDOPTO    ["productname"]     * string: Color temperature light    ["modelid"]     * string: GL-C-006P    ["state"]     * table:      ["ct"]       * number: 255      ["reachable"]       * bool: true      ["alert"]       * string: select      ["mode"]       * string: homeautomation      ["colormode"]       * string: ct      ["on"]       * bool: false      ["bri"]       * number: 254    ["type"]     * string: Color temperature light    ["name"]     * string: Cove lighting    ["config"]     * table:      ["function"]       * string: mixed      ["archetype"]       * string: huelightstrip      ["direction"]       * string: omnidirectional ["9"]   * table:    ["swversion"]     * string: 1400-0001    ["uniqueid"]     * string: 00:15:8d:00:08:1d:bf:a2-01    ["capabilities"]     * table:      ["control"]       * table:        ["ct"]         * table:          ["min"]           * number: 153          ["max"]           * number: 370      ["streaming"]       * table:        ["renderer"]         * bool: false        ["proxy"]         * bool: false      ["certified"]       * bool: false    ["swupdate"]     * table:      ["state"]       * string: notupdatable      ["lastinstall"]       * string: 2023-06-10T09:10:43    ["manufacturername"]     * string: Paulmann Licht    ["productname"]     * string: Color temperature light    ["modelid"]     * string: 500.46    ["state"]     * table:      ["ct"]       * number: 255      ["reachable"]       * bool: true      ["alert"]       * string: select      ["mode"]       * string: homeautomation      ["colormode"]       * string: ct      ["on"]       * bool: false      ["bri"]       * number: 254    ["type"]     * string: Color temperature light    ["name"]     * string: Celling light 1    ["config"]     * table:      ["function"]       * string: functional      ["archetype"]       * string: ceilingsquare      [...

I don't see the light fixture 'Cove lighting-cr' with ID number 12 in the log file at all.

Best regards,
Nayden
Reply
#90
To log a particular lamp modify the script around line 18:
Code:
while true do   reply = getHueLights()   mylamps = json.decode(reply)   for _, item in pairs(mylamps) do     if item.name == 'Cove lighting-cr' then       log(item)     end
Reply
#91
(24.07.2025, 08:39)admin Wrote: To log a particular lamp modify the script around line 18:
Code:
while true do   reply = getHueLights()   mylamps = json.decode(reply)   for _, item in pairs(mylamps) do     if item.name == 'Cove lighting-cr' then       log(item)     end

The result is:

Code:
Feedback 24.07.2025 12:08:48 * table: ["swversion"]   * string: 1.122.8 ["swconfigid"]   * string: 49730BB6 ["uniqueid"]   * string: 00:17:88:01:0b:f3:14:ae-0b ["capabilities"]   * table:    ["control"]     * table:      ["colorgamut"]       * table:        [1]         * table:          [1]           * number: 0.6915          [2]           * number: 0.3083        [2]         * table:          [1]           * number: 0.17          [2]           * number: 0.7        [3]         * table:          [1]           * number: 0.1532          [2]           * number: 0.0475      ["ct"]       * table:        ["min"]         * number: 153        ["max"]         * number: 500      ["colorgamuttype"]       * string: C      ["maxlumen"]       * number: 1600      ["mindimlevel"]       * number: 40    ["streaming"]     * table:      ["renderer"]       * bool: true      ["proxy"]       * bool: true    ["certified"]     * bool: true ["swupdate"]   * table:    ["state"]     * string: noupdates    ["lastinstall"]     * string: 2025-07-17T11:36:44 ["productid"]   * string: Philips-LCL001-1-LedStripsv4 ["manufacturername"]   * string: Signify Netherlands B.V. ["productname"]   * string: Hue lightstrip plus ["modelid"]   * string: LCL001 ["state"]   * table:    ["ct"]     * number: 285    ["reachable"]     * bool: true    ["alert"]     * string: select    ["on"]     * bool: false    ["bri"]     * number: 58    ["mode"]     * string: homeautomation    ["colormode"]     * string: xy    ["hue"]     * number: 24225    ["sat"]     * number: 18    ["effect"]     * string: none    ["xy"]     * table:      [1]       * number: 0.3675      [2]       * number: 0.3982 ["type"]   * string: Extended color light ["name"]   * string: Cove lighting-cr ["config"]   * table:    ["startup"]     * table:      ["mode"]       * string: powerfail      ["configured"]       * bool: true    ["function"]     * string: decorative    ["archetype"]     * string: huelightstrip    ["direction"]     * string: omnidirectional
Reply
#92
The reported color temp is 3500K (1000000 / 285). Is it correct?

Have you applied this change? https://forum.logicmachine.net/showthrea...9#pid19499
Reply
#93
(24.07.2025, 09:22)admin Wrote: The reported color temp is 3500K (1000000 / 285). Is it correct?

Have you applied this change? https://forum.logicmachine.net/showthrea...9#pid19499

Hello, again

Yes, the last setting I made was 3500K. I'm using the script you provided for the color temperature.

Without Feedback script:
 
         

       

With Feedback script:

       

       

Regards,
Reply
#94
Do you use the same object for control and status? What is the event script attached to this object? Why do you use string data type instead of 2 byte unsigned?
Reply
#95
(24.07.2025, 12:54)admin Wrote: Do you use the same object for control and status? What is the event script attached to this object? Why do you use string data type instead of 2 byte unsigned?


1. I used the same object for control and status. I removed the status part for testing. 
2. I'm applying the script as an event script. 
3. I changed it to 2-byte unsigned. After these changes, the problem remains.
Code:
--Control HUE from TW object (color temperature) (use as event based script) require('user.hue') lamp_id = 12 bri = grp.getvalue('32/2/9') -- 0..100% ct = grp.getvalue('32/4/9') -- 2000K..6500K setBrightnessCT(lamp_id, bri, ct)
Reply
#96
You should use separate objects for control and status. Otherwise you might get a loop because color temperature value is not exact due to recalculation.
Reply
#97
(24.07.2025, 14:29)NKereshki Wrote:
(24.07.2025, 12:54)admin Wrote: Do you use the same object for control and status? What is the event script attached to this object? Why do you use string data type instead of 2 byte unsigned?


1. I used the same object for control and status. I removed the status part for testing. 
2. I'm applying the script as an event script. 
3. I changed it to 2-byte unsigned. After these changes, the problem remains.
Code:
--Control HUE from TW object (color temperature) (use as event based script) require('user.hue') lamp_id = 12 bri = grp.getvalue('32/2/9') -- 0..100% ct = grp.getvalue('32/4/9') -- 2000K..6500K setBrightnessCT(lamp_id, bri, ct)
Change your Code to 
Code:
--Control HUE from TW object (color temperature) (use as event based script) require('user.hue') lamp_id = 12 --bri = grp.getvalue('32/2/9') -- 0..100% ct = grp.getvalue('32/4/9') -- 2000K..6500K setBrightnessCT(lamp_id, bri, ct)
Now you controll only the Colortemperature, for brightness use a seperate Event
Reply
#98
(28.07.2025, 05:45)Sral1987 Wrote:
(24.07.2025, 14:29)NKereshki Wrote:
(24.07.2025, 12:54)admin Wrote: Do you use the same object for control and status? What is the event script attached to this object? Why do you use string data type instead of 2 byte unsigned?


1. I used the same object for control and status. I removed the status part for testing. 
2. I'm applying the script as an event script. 
3. I changed it to 2-byte unsigned. After these changes, the problem remains.
Code:
--Control HUE from TW object (color temperature) (use as event based script) require('user.hue') lamp_id = 12 bri = grp.getvalue('32/2/9') -- 0..100% ct = grp.getvalue('32/4/9') -- 2000K..6500K setBrightnessCT(lamp_id, bri, ct)
Change your Code to 
Code:
--Control HUE from TW object (color temperature) (use as event based script) require('user.hue') lamp_id = 12 --bri = grp.getvalue('32/2/9') -- 0..100% ct = grp.getvalue('32/4/9') -- 2000K..6500K setBrightnessCT(lamp_id, bri, ct)
Now you controll only the Colortemperature, for brightness use a seperate Event

Hello,

First, I want to thank you for your help. Unfortunately, when I remove the brightness line from the script, the color temperature also stops being controlled. I'm using the script you showed me.

Best regards,
Nayden
Reply
#99
(25.07.2025, 07:06)admin Wrote: You should use separate objects for control and status. Otherwise you might get a loop because color temperature value is not exact due to recalculation.

Hi Admin,

Sincere thanks for your help. After separating the group address for color temperature control and feedback, everything is working perfectly.

Should I do this separation for the other group objects too: on/off, dimming, and RGB change? I just want to clarify that I also have a physical KNX button through which I turn the lights on/off and dim them. If I separate all controls from feedback, I can't synchronize the KNX button and sometimes I have to press it twice. What occurred to me is if it also "listens" to the feedback group address.

What would you advise, and what do you think is the best practice?

Best regards,
 N. Kereshki
Reply
In general any KNX system is done in a way that there is one object for control and another for status.
------------------------------
Ctrl+F5
Reply


Forum Jump: