Dim Philips Hue Lights triggered by KNX

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

Thx in advance!
Tim

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 }}

Hi Peter

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

For testing purposes use a fixed value like 0.5 instead of a calculated value, and show your flow.

You’re welcome, Tim.

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)):

The code to use:
(I used divide by 100 as example)

I send the [result] tag of the HS card to a light, you can (temporary) send it to a notification card as well (to check what happens!)

Check:
Screenshot from 2024-09-02 18-04-56

If the input was 12, the output would be 0.12

Hi Peter

Capabilities of Philips Hue light

Whereas now the light is fully on (at value 1)

Then I created the following:


0/6/12 being the group address I assigned to the Dimming Object Function and 3.001 being the DPT

When I do a manual test using fe. 50 as value I get the lamp dimmed to 50%
Input value: 50
Output value: 0,5

So the flow works

However, triggered from the KNX switch it doesn’t
I can switch the lamp ON/OFF but diming (long pressing it) doesn’t do anything

When I do another diagnostics in ETS however , I can see it only sends +100% and -100% values when dimming.
Switching (ON/OFF) works fine

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

In addition; I didn’t get the notification during runtime

So the flow might not be triggered and doesn’t run at all. You can verify by adding a notication direct behind the trigger card.

Which app are you running as I cannot find the trigger card you are using.

1 Like

All Homey attached lights use 0 - 1 as dim range.

Actually I needed the value range of the KNX trigger device, to determine the calculation, but this card looks like chinese to me :wink:
Screenshot from 2024-09-02 20-10-13

I found the card. The parameters passed might be wrong, either value or format.
Cannot a simpler card be used, the dimmer card for example?

Well actually what I have done is:

  • 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?

But does it trigger the flow in Homey?

For everything up until now yes
Only the things that set specific values do not work

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…

The only you can do is follow your flow step by step and add notications to see what are the values of the parameters at every step.

This is currently what I am doing and was a very valuable tip!

Just curieus: what does the notication in your script above mention for #waarde and #resultaat.

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