KNX Cookbook

From 2021.3.4 to 2021.04 it makes trouble.

Today I updatet from 2021.3.4 to 2021.05.04 and everything works fine. Strange but no matter and thank you for your help.

Hey :wave:!
I’ve added a chapter to the HA Knx docs about this.
HA KNX Troubleshooting
Feel free to add things I haven’t thought about!

2 Likes

Thanks very much.

Seems that some of the addresses for the HVAC were not included in the ETS Report. However I have found other addresses in the AMX code and other addresses from the KNX Log.

From AMX Code

10/1/17 - Set Temp
9/2/17 - Set Heat/cool
9/1/17 - on/off

From KNX Log on HA. From pushing button on the KNX wall panel the log listed these addresses.

10/4/4 Turn on LED HVAC unit on/off
10/4/7 - Turn off LED HVAC unit on/off
10/4/18 -Raise Temperature
10/0/17 - Lower Temperature
10/4/13 - Also appeared in Log
10/4/16 Also Appeared in log

It’s starting to work.

      temperature_address: "10/1/17"
      setpoint_shift_address: "10/1/17"
      target_temperature_address: "10/1/17"
      target_temperature_state_address: "10/1/17"
      setpoint_shift_mode: "DPT9002"
      operation_mode_address: "9/2/17"
      #operation_mode_state_address: "9/2/17"
      on_off_address: "9/1/17"
      on_off_state_address: "9/1/17"
      # min_temp: 16.0
      # max_temp: 25.0

I can switch the HVAC on/off on the the KNX wall panel and move the temperature dial from Lovelace. However the Lovelace temp dial does not change the KNX wall panel and the only option is heat

Screenshot 2021-05-18 01.45.06

Setting temperature, target temperature and setpoint shift to the same address will definitely fail.

The only modes you configured are “heat” and “off”. operation_mode_address provides presets in HA.

Also setpoint_shift_address needs setpoint_shift_state_address to be set and the value has to be read from the bus to initialize.

See HA knx climate documentation for basic configuration help and Link to Logs – My Home Assistant for logs. There are usually error messages telling you why something was not working.

Hey :wave:!
In the next release some HA core changes to Lights are accounted for. But I don’t have any colored lights so I can’t test it on actual hardware.

Can please anyone with actual KNX RGB or RGBW lights test this: Fix KNX rgb(w) color (again) by farmio · Pull Request #51060 · home-assistant/core · GitHub
I’d be very interested in configuration and resulting behavior in brightness and color changing from HA and from bus.

Update: there is a version of this in the current beta. But I think it is somewhat broken yet.

1 Like

Hi All,

does anybody know how to create the template sensor for a KNX weatherstation now that create_sensors is deprecated? I have no clue how to do that…
Thanks for any hint :slight_smile:

template:
  - sensor:
    - name: <Name for the Sensor>
      unit_of_measurement: "°C"
      state: "{{ state_attr('<climate.<entity_id>', 'current_temperature') }}"
      unique_id: <any unique_id>

Should be the same for climate and weather. I have not tested it for keeping the recorded history, but with the same entity_id this should work fine.

See Link to Developer Tools: States – My Home Assistant for the ids and the attribute names.

1 Like

I will try that as soon as possible :slight_smile:

Do I also get the brightness this way? I could not see the brightness values as attributes.

Hm… looks like brightness is no HA Weather entity attribute (it’s used for condition only).
Just create a knx sensor - will do the same.

This is how my sensor looks like now but something seem to be wrong:


platform: template

sensors:

  wetterstation_homefs_temperature:

    friendly_name: "Wetterstation HomeFS Temperatur"

    unit_of_measurement: "°C"

    state: "{{ state_attr('weather.wetterstation_homefs', 'current_temperature') }}"

    unique_id: wetterstation_homefs_temperature

The error shown is:

Invalid config for [sensor.template]: [state] is an invalid option for [sensor.template]. Check: sensor.template->sensors->wetterstation_homefs_temperature->state. (See ?, line ?)

Look at my example above, or just copy it.
No “platform:” and lists “-” where necessary.

Invalid config for [sensor]: required key not provided @ data['platform']. Got None. (See ?, line ?).

This is what i got now. The file is where all my other sensors are placed as well.

template:

  - sensor:

    - name: wetterstation_homefs_temperature

      unit_of_measurement: "°C"

      state: "{{ state_attr('weather.wetterstation_homefs', 'current_temperature') }}"

      unique_id: wetterstation_homefs_temperature

It belongs in the root of configuration.yaml, not under a sensor: key

It doesn’t have to be in configuration.yaml though. I have them in a separate file sensors.yaml.

- platform: template
  sensors:
    living_temperature:
      unique_id: living_temperature
      value_template: "{{ state_attr('climate.living', 'current_temperature') }}"
      unit_of_measurement: "°C"

That gets referenced then in configuration.yaml:

sensor: !include sensors.yaml
1 Like

In my setup I can’t see brightness anymore, only the interpreted velue (eg “cloudy”) as a state:

<template TemplateState(<state weather.utemaler_ost=cloudy; temperature=29.2, friendly_name=Utemåler øst @ 2021-06-04T07:36:34.793353+02:00>)>

You can also just configure it as knx sensor.

2 Likes

Solved my isses it needs to be value_template instead of just state :slight_smile:

Hey :wave:!
There are lots of KNX news in 2021.7.

  • new Number platform
  • new Select platform for dropdown menus
  • XY-Color lights
  • some climate attributes to support current active mode
  • switches that can respond to Knx GroupValueRead requests and restore their state from HA!

Try it in the current beta! :woman_technologist:

3 Likes

Hi Matthias,
great news! Thanks for all the hard work and free time that you offer to help all of us.

I’m especially looking forward to the HA switches with “Read flag”.
Are the new number and select platforms a general new HA feature that you adapted the KNX integration to?

1 Like