I want to be able to dim my Philips Hue lights using a KNX switch. I configured a switch button to do percentage control, which would then be read by Homey and send as a dimming value towards the Philips Hue lights.
When doing some analysis in KNX I can see that when pressing the button a percentage value is send, which the should be captured by the Philips Hue light.
However the Philips Hue light reads this value incorrectly.
When testing the flow I need to send values between 0 and 1 (whereas 0 is 0% and 1 is 100%)
Does someone have an example on how to dim lights based on KNX triggers
If KNX sends 0 - 100 values, youâd divide it by 100, prior to set a light to that value.
You can do that with a Homeyscript card, or with the Temporary Variables app.
The calculation to use:
{{ [KNX value tag of trigger card] / 100 }}
Thx for the fast reply and the great tips.
I am new to both KNX as well as Homey, so this info is greatly appreciated.
I have been doing some tests, but still without success.
Itâs both for dimming Hue lights as well as controlling Sonos volume that I am trying this.
But I guess I maybe am using wrong Data Types thatâs making it fail.
I have trid dimming control, as well as percentage control but both do fail
Can you lookup the value range of the KNX dim trigger?
Weâll have to be sure what value range it sends;
Youâll find it here, under header âCapabilitiesâ (enter the device name in filter bar): https://tools.developer.homey.app/tools/devices
Example:
Example with the Homeyscript THEN card âRun code with Argument and Return number-tagâ
(âTemporary variablesâ kept returning zeroes only, so skip that)
As Argument (=input value), youâd use the tag of the triggercard, in my example itâs called [Level]
When youâre going to select a tag, youâll find it on top of the list, under âThis flowâ
(also note the trigger card âglowingâ when you have the right one (in case of multiple trigger cards)):
It indeed did work when sending values between 0 and 1, hence I came to the conclusion that values send by KNX (showing pecentage in the diagnostics) required recalculation
I added all my KNX devices that are âphysicallyâ driven
I have added my Philips Hue devices
I have added my Sonos devices
âŚ
So all devices can be operated via Homey
But the goal would be to have certain KNX switches operate Philips Hue devices, Sonos devices,âŚ
Therefore I created âvirtualâ group addresses in ETS and linked them to the switches, dimmers that should operate them.
Homey would then be used to capture the value send to these group addresses and translate it to Philips Hue, Philips Hue actions by means of flows
It works for switching ON/OFF the Philips Hue lights or start fe. Sonos Favorites.
But everything that has to do with changeable values (being it dim value for Philips Hue, volume for Sonos,âŚ) does not work
So summarized I donât have a KNX dim card or something similar for Sonos as it does not exist in my setup.
I actually started working with the group addres cards as triggers as this is also the way you work in ETS
I donât understand how the communication works yet.
ETS is a KNX program that runs on a Windows computer.
In ETS you define groups. But the question is what does a KNX dimmer send, does that dimmer know that it has to use the group address? And who is that dimmer sending something to? To ETS or to Homey, or both?
Well actually in ETS you indeed configure group addresses, which you then link to switches etc so they can be manipulated.
When you then download them to the switches they hold these addresses and they can send/receive appropriate values on/from the bus.
In this case these values donât trigger actual âphysical actuatorsâ instead Homey picks them up (as a virtual actuator) and handles them in flows you can configure (hence building a gw between the knx environment and none KNX devices)
Homey, with the action I use will read values send on a specific address and further configured actions should then be triggered
Up until now this worked really well for me (all my Philips Hue lights fe. can be switches ON/OFF via KNX switches and I can trigger Sonos favorites,âŚ)
The only problem is: figuring out the actual data (DPT) being send when a dimmer action takes place, so Homey correctly interprets it
At least this is how I understand it and as I said I am kind of new in both KNX as well as HomeyâŚ
When running the flow manuelly it properly indicates the value given and the calculated value (meaning the value given divided by 100)
When triggering it via the switch it doesnât trigger it, so doesnât trigger the flow