Supergiovane / node-red-contrib-knx-ultimate

Control your KNX intallation via Node-Red! A bunch of KNX nodes, with integrated Philips HUE control and ETS group address importer.
https://youtu.be/egRbR_KwP9I
MIT License
153 stars 34 forks source link

Hue Ambient White (tunable white) #247

Closed Graefer closed 1 year ago

Graefer commented 1 year ago

Hi, the new Hue nodes are exciting. What I am missing is support of Hue Ambient White (tunable white) in the Hue Light node. I hope we will see this in the future. Regards Graefe

Supergiovane commented 1 year ago

Hi I’m on that. I bought a tunable lightbulb, because i’ve none at home.

Graefer commented 1 year ago

Looking forward to that! Thank you.

Supergiovane commented 1 year ago

Hi Graefe wich KNX datapoint do you need, to control the tunable white light? Is ok 249.600?

Graefer commented 1 year ago

My MDT Glass Push-Button II Smart is using 3.007 (dimming control) for controlling tunable white. Tunable white status is 5.001.

Supergiovane commented 1 year ago

Hi Graefe MDT will never ceases to amaze me.

Supergiovane commented 1 year ago

2.1.12 is out. Please give it a try.

Graefer commented 1 year ago

Thank you. I tried it!

a) The color temperature is upside down: 0% in KNX should mean warm color and 100% should mean cold color. And the warmest HUE state results in 85% - not 100%. May be you need to rescale.
b) The handover of states from HUE to KNX and vice versa is not reliable: Switching on with KNX expects a dim level of 100% - but HUE seems to take the last dim level it remembers. But that HUE dim level is not handed over to the according group address. c) And the bit for dim direction (brighter/darker) in KNX seems to be misinterpreted (at least concerning single-button dimming): release and next long press should reverse the dim direction - but HUE does not reverse the dim direction but continues dimming in the same direction.

Obviously there is still some work. But I am looking forward to a functioning node which will replace my complex Node Red flows to translate KNX commands to HUE.

Supergiovane commented 1 year ago

Hi Graefe, Yup... i've done all wrong! Fortunately, they are fixable. As for scale, HUE colore temparature uses mired degrees, having a 153-500 scale range, while DPT5.001 is 0 to 100%, so yes, i could have miss something in the range conversion. As for the single button operation, i've tested with my Gira pushbutton and it does UP/DOWN as expected but... i'll give it a look again. If i've had your MDT Smartbutton to test with, it would get all simpler.

By future releases, there will be more options to select from. For example, HUE bulbs are capable of different mirek temperature values, so this will be taken into account as well.

Supergiovane commented 1 year ago

PS: can you please add a KNX-Device node to your flow and set it with datapoint and group address used by the MDT to dim, and write here what you read in the payload? You should read an object like { decr_incr: 1, data: 1 } or similar.

Supergiovane commented 1 year ago

PPS: 2.1.13 is out with fix for (hope) a and b.

Graefer commented 1 year ago

PS: can you please add a KNX-Device node to your flow and set it with datapoint and group address used by the MDT to dim, and write here what you read in the payload? You should read an object like { decr_incr: 1, data: 1 } or similar.

The Hue node seems to interfere the normal behavior of the button - but only when dimming down: it is not changing the dim direction anymore, until the dimming is on 0%. If the Hue node is deactivated, the behavior of the button is correct. Which means that it is changing the dim direction which each press.

false.pdf correct.pdf

Supergiovane commented 1 year ago

Hi Does the MDT send the stop dim telegram, once you release the button? Usually, once you keep pressing the button, a “start” dimming telegram is sent, toghether with the dim direction. Once you release the button, a “stop” dimming telegram is sent. You should verify this behavior using ETS debug window. There is no way the Hue node can interfere with such behavior.

Graefer commented 1 year ago

This is what DPT 3.007 outputs with your KNX device node: Long press down: decr_incr: 1, data: 1 (Start dim up) Press up: decr_incr: 0, data: 0 (Stop dim) Long press down: decr_incr: 0, data: 1 (Start dim down) Press up: decr_incr: 0, data: 0 (Stop dim)

a) if Hue node is activated: another long press down: decr_incr: 0, data: 1 (another one Start dim down) b) if Hue node is deactivated: another long press down: decr_incr: 1, data: 1 (start dim up, as expected)

May be this has to do something with Hue node‘s Switch Status preference?

Supergiovane commented 1 year ago

Hi Thanks. I’ll take a deep look and i’ll let you know. I’m currently in Tuscany for holidays, so please give me some more time…

Supergiovane commented 1 year ago

Hi Graefe Can you please use the MDT button to dim the HUE, instead of changing color temperature? In the HUE node, link the GA to the Dimming function, not to the color temp change. Please let me know if it works as expected. I'm thinking that the MDT button, acts more like a rolling shutter actuator, than like a dimmer actuator.

Graefer commented 1 year ago

I think I misunderstood the meaning of the MDT’s GA for ‚status‘. I thought this would represent on/off state but in fact it represents the state of dim direction. Actually there is no GA for on/off state and the display of the button only works with the grade of dimming. When I am at home I will delete the GA from the Hue node - let’s see. Now enjoy Tuscony, I have been there couple of years ago.

Graefer commented 1 year ago

The MDT manual says: „ With the one-button function "dimming“, the direction (brighter/darker) is reversed as a function of the communication object "value for toggle". The dimming function is a start-stop dimming, that means as soon as the dimming function becomes active, a light or dark command is assigned to the input until it is released. After releasing, a stop telegram is sent which terminates the dimming process.“ So, there is only one communication object which serves for both: dimming direction AND value for toggle. I suppose this is the problem, as your Hue node writes the status on/off to that communication object which interferes the dimming direction?

Supergiovane commented 1 year ago

Hi Nope. The dim command is one-way. The mdt toggles between “up” and “down” using an internal state flag. This is how it usually works. If the MDT takes the “switch” on/off status also into account, it could be the culprit. You can try to disconnect the switch status from the hue node and verify the bevaviour. Yet i cannot test the things , i must wait to be at home.

Graefer commented 1 year ago

This is what I wanted to say. MDT takes the switch status into account for the dim direction. This explains alle the mess.

Supergiovane commented 1 year ago

I’ll fix that once at home.

Supergiovane commented 1 year ago

Hi Have you made further tests? What options do you need to overcome your issues? I’ll add it to the config window.

Graefer commented 1 year ago

I think we agree, that MDT uses the GA switch status when dimming. Hence, whilst active dimming your node should not send a TRUE to the GA switch status. Have you made any changes concerning to that in the meantime?

Supergiovane commented 1 year ago

Hi Graefe I'm back. Today i'll setup a test bed and i'll try to reproduce your issue.

Supergiovane commented 1 year ago

Hi Graefe This is my config

https://github.com/Supergiovane/node-red-contrib-knx-ultimate/assets/37666636/924a9621-f333-415e-8f60-8f04c7ff68e5

and this is what i get

https://github.com/Supergiovane/node-red-contrib-knx-ultimate/assets/37666636/23b1e000-0c8e-4b80-8914-4c23cce7f166

Every time i click the button, the light becomes more white and more reddish respectively. Can you please show me a screenshot of your config?

Graefer commented 1 year ago

MDT uses the GA status switch for two different things: a) the status of the switch (when not dimming) and b) the dim direction (when dimming). This refers to single-button dimming, only! If your Hue node updates the GA status switch whilst dimming, the dimming gets faulty.

Bildschirmfoto 2023-07-04 um 08 07 36 Bildschirmfoto 2023-07-04 um 08 07 01
Supergiovane commented 1 year ago

Hi while changing the color temp, only the "tunable white status" GA is updated with the current color temperature. The Switch Status" GA 1/4/23 doesn't change until you switch on/off the light. If you want me to disable this update of the "tunable white status" GA, let me know and please tell me one more time, the model of your MDT, so i can check the manual.

PS: Please install the v. 2.1.19 from the node-red palette, in the meantime.

Supergiovane commented 1 year ago

Hi node-red-contrib-knx-ultimate@2.1.20 is out with some config options you could find useful

Graefer commented 1 year ago

Just testing 2.1.24: dimming works like a charm, now. Great work! Many thanks!! But: if I switch off with KNX, the display of the KNX switch shows that the lamp is still turned on (as the dim level is still >0%). What about (optionally) putting the dim level to 0% when switching off and to 100% when switching on? This behavior seems to be more KNX like. And dimming up starting from 0% does not turn the lamp on, but the dim level, only. I think this is rather un-KNX, too.

Supergiovane commented 1 year ago

Hi, Try now with the v 2.1.25

Supergiovane commented 1 year ago

Sorry, i mean 2.1.26

Graefer commented 1 year ago

Yes! 2.1.26 is even better and highly usable! Last issue: if the lamp is switched off and I start dimming with KNX, the lamp jumps to 100% instead of increasing from 0%. Can you make the node recognize, if the lamp is turned on by switch or by dimming and react depending to that?

Supergiovane commented 1 year ago

Hi Yes, i know. There are still some hiccups with dimming. I’m working on that…

Supergiovane commented 1 year ago

Hi node-red-contrib-knx-ultimate@2.1.28 is out. It should work as expected.

Graefer commented 1 year ago

Tested 2.1.29 - no issues, absolut perfectly!

Supergiovane commented 1 year ago

Thank you! Please STAR my node and have a nice weekend.

Graefer commented 1 year ago

Cannot star twice. So I just spent you a „cup of coffee“ and started a thread on your node on Knx-user-Forum.de

Supergiovane commented 1 year ago

Thank you!!!! I appreciate that!!