SpaceLogic KNX Forum
Schneider Electric SpaceLogic KNX forum to get support and share knowledge including selection, installation and troubleshooting for spaceLYnk, Wiser for KNX, eConfigure KNX, SpaceLogic KNX Hybrid module and other topics.
Posted: 2015-01-13 02:17 AM . Last Modified: 2024-07-15 12:03 AM
Link copied. Please paste this link to share this article on your social media post.
This application note describes possibility to control Philips Hue lamps from KNX installation using homeLYnk. Philips Hue is RGB LED bulb, which is mainly intended to be controlled from Smartphones and tablets.
Link copied. Please paste this link to share this article on your social media post.
Maybe it would be interesting use the real RGB control.. and send the R,G,B independently as done with DMX or DALI.
-- Get Value of RGB picker
value_d = event.getvalue()
-- Convert to HEX for splitting to 3 byte values
value = lmcore.inttohex(value_d, 3) -- 3 = number of bytes inside value
-- Split First 2 byte HEX values from 3 byte HEX
redandgreen = string.sub(value, 1, 4)
-- Split First Value from 2 byte HEX
red = string.sub(redandgreen, 1, 2)
-- Split Last value from 2 byte HEX
green = string.sub(redandgreen, -2)
-- Split Last byte value from 3 byte HEX
blue = string.sub(value, -2)
-- Convert HEX values back to integer
valuered = lmcore.hextoint (red)
valuegreen = lmcore.hextoint (green)
valueblue = lmcore.hextoint (blue)
-- Calculate lowest value of RGB value
low = math.min(unpack({valuered, valuegreen, valueblue}))
-- Calculate highest value of RGB value
high = math.max(unpack({valuered, valuegreen, valueblue}))
-- Calculate Saturation (The saturation is the colorfulness of a color relative to its own brightness)
saturation = math.floor((100 * ((high - low) / high)) + 0.5)
if valuered == 0 and valuegreen == 0 and valueblue == 0 then
white = 0
else
white = math.floor(((255 - saturation) / 255 * (valuered + valuegreen + valueblue) / 3)+ 0.5)
end
-- Write integer RGB values and Calculated White & Saturation to KNX
grp.write('0/2/28', valuered, dt.uint8)
grp.write('0/2/29', valuegreen, dt.uint8)
grp.write('0/2/30', valueblue, dt.uint8)
Link copied. Please paste this link to share this article on your social media post.
This is actually what the KNX RGB data type does.
It consists of 3 bytes, where each byte represents one of RGB colors.
There is no big deal to modify the script to read 3 grp addresses of 1 byte size.
Link copied. Please paste this link to share this article on your social media post.
Dear all,
We have published AN020 - Philips Hue lamps controlled from Wiser for KNX in the past. The time is running fast and Philips released another 2 generations of Hue since that time.
This AN has been rewriten as AN2_002 (new generation of AN ) and released on Schneider electric website today.
There are completely new libraries and project inside to help you with configuration and control of your Hue installation.
AN020 is obsolete but cannot be deleted because I am not an owner. Please check following link.
AN is available on Yammer and SE website as well.
- Solutions team
Create your free account or log in to subscribe to the board - and gain access to more than 10,000+ support articles along with insights from experts and peers.