KNX add support for DPT 249.600

Any chance to get support for DPT 249.600? It’s the only reason not to switch to HomeAssistant fully for KNX setup :slight_smile: ?

Hi :wave:!
You can always use knx.send to create your payloads from templates - this can be used to forge any DPT. Same for incoming telegrams via knx_event.

I guess if this DPT was supported directly, you would still need to use knx.send , but save the template logic.

Thanks, will investigate how to get there.

I remembered there was reusable template macros added a few releases ago. So I gave this a try.

If you create a new file dpt.jinja in config/custom_template/

{% macro dpt_ct_transition(duration, color_temp, brightness) %}
{% set ns = namespace(result=[]) %}
{% set duration_ms = (duration * 10) | int }
{% for byte in duration | pack("!H") %}
  {% set ns.result = ns.result + [byte] %}
{% endfor %}
{% for byte in color_temp | pack("!H") %}
  {% set ns.result = ns.result + [byte] %}
{% endfor %}
{% set ns.result = ns.result + [brightness, 0b111] %}
{{ ns.result }}
{% endmacro %}

you can use the dpt_ct_transition function like

sequence:
  - service: knx.send
    data:
      address: "0/4/7"
      payload: >
        {% from 'dpt.jinja' import dpt_ct_transition %}  
        {{ dpt_ct_transition(1, 2700, 50) }}

call it with

  • seconds time for transition
  • kelvin target color temperature
  • brightness value 0-255

Maybe this can be improvement / cleaned up a bit - I’m no jinja template expert :grimacing:

Thanks @farmio, appreciate your support.

So after your feedback, I’ve started looking for easy ways :slight_smile:

What I tried first, is to move to separate keys for brightness (5.001) and color temperature (7.600) rather than a single dpt 249.600 setup. It works out of the box with Homekit/Hass. The Thinka gw doesn’t have a setting for ‘seconds time for transition’, so I’m assuming they actually might have been ignoring it to some default. And since hass/homekit controls still default to separate brightness/color temperature there might not be extra value. Will explore it, just a heads up, my pace on these things is much slower than yours. :slight_smile:

You can just ignore some of the 3 settings - that is supported by the DPT by setting one of the values “invalid” in the last 8 bit.

I’m not sure how HomeKit would play a role here. We can only bridge KNX telegrams to Home Assistant concepts.

Anyhow, I think it has value to support this DPT as you can use automations / scripts to generate smooth transitions - ignoring default transition time of the actuator. So eg. create a smooth fade-out for some cases, whereas default transition time is tailored towards manual interaction - which requires immediate visual feedback.

Native support for DPTs having multiple values is currently not possible, but there are already some ideas how to implement this in a scalable and maintainable way. See https://github.com/XKNX/xknx/pull/1276 and https://github.com/XKNX/xknx/pull/1277 - unfortunately I didn’t have time to pursue these lately.