KNX Cookbook

It looks fine

state_class: measurement
source: 1.1.24
unit_of_measurement: Wh
device_class: energy
friendly_name: Total Active Energy
last_reset: 1970-01-01T00:00:00+00:00

I will try your solution with removing the sensor and readding it. I am still wondering what the correct state_class is. Is it measurement or total_increasing?

Nope, thats wrong. It should be total_increasing.

1 Like

You are right. I still had my global customize active which did overwrite it. Now it is working.
This problem was driving me nuts. Thanks for your help :grinning:

1 Like

Hi @Jpsy ,
I have some kind of the same question.
My house is full with Gira RF Wall Switches.
I would love the wall switches to trigger my Home Assistant environment. No need for the reverse way.
What would I need to make this happen

  • RF Line Coupler?
  • KNX IP Router or just KNX IP Interface?
    The company who installed my Gira system does not exist any more.
    Would I need ETS (how to get it) or can I manage without it?

Thx!

KNX interface should be good enough. KNX router is needed if you want to couple two KNX buses over IP.
Regarding the ETS it will be difficult if you donā€™t have the project. ETS free version supports up to 5 devices only. Than there is the next up which is around 200 EUR although there might be some good promos e.g. some time ago there was a limited time offer for newly registered users for ETS Home or Lite.
Not sure if you can reverse engineer your system though. With demo ETS version you can monitor your KNX system and this might be good enough to get required info for HA integration.

Hassio to connect with Gira KNX RF :eyes:

Are there any examples of how the ā€œNew entity: textā€ can be used in combination with KNX?

If you have some kind of display next to your front door, you could leave some nice message for your loved ones from time to time :wink:
Other than that, I have no idea šŸ¤· but Iā€™m sure someone will find a good use for it.

Has anyone tried secure routing yet?

Or are there any problems with the new ConfigFlow and OptionFlow (ā€œConfigureā€ button on HAs integrations panel)? Like eg. ā€œAutomaticā€ connection mode suddenly not available?

I have the following automation:

alias: EG Schlafen
description: ""
trigger:
  - platform: event
    event_type: knx_event
    event_data:
      destination: "0/7/0"
      direction: "Incoming"
condition: []
action:
  - service: light.turn_off
    target:
      entity_id: light.eg_alle
    data: {}
  - service: cover.close_cover
    target:
      entity_id: cover.eg_alle
    data: {}
mode: single

the action part works perfectly, when I trigger the automation manually through the frontend, however the trigger does not work at all.
I have a KNX button, when I press it it sends a 1 to the group address 0/7/0. I get this event in my ETS, so I know it is there. However, the group address is always on 1, as I never need to change it to something else - so this might by an issue. In my previous used system I just needed to add "enforce_updates: true" to my yaml file and it fired events also when the value was not changed. Is there something similiar in home assistant? If this is probably not my issue: do you have any ideas what I could try next?

solved: I missed to add the address to the knx event section in the configuration.yaml:

knx:
    event:
        - address:
            - "0/7/0"

Iā€™m new to home assistant and wanted to check if Iā€™ve done it right.

My roller shutters use DTP9.* for reading the position (response is between 0 (open) and 100,34 (closed)) and DTP5.001 (0-100%) for setting the position. Thus I had to convert the read shutter position (cover expects 5.001 for both values).

I created a virtual address with the correct DTP5.001 for the current position. In addition I also reversed the read value to reflect the correct position (opened/closed)

1st: read position, response will be between 0 and 100,34

  - sensor:
    - name: "Rolladenposition KĆ¼che"
      state_address: "2/0/13"
      type: "2byte_float"
      sync_state: "init"
      state_class: "measurement"

2nd: convert values (100 = 0 and 0=100):

template:
  - sensor:
      - name: "Rolladenpos KĆ¼che"
        state: >
          {% set val = states('sensor.rolladenposition_kuche') | float - 100 | round(0) | int  %}
          {{ val*-1 }}

3rd: expose new entity with value from 2nd step (dummy knx address, not known to ETS)

  expose:
    - type: percent
      entity_id: sensor.rolladenpos_kuche
      address: "2/0/130"

4th: define cover with new entity as position_state_address:

  cover:
    - name: "Rolladen KĆ¼che"
      move_long_address: "2/0/4"
      stop_address: "2/0/5"
      position_address: "2/0/12"
      position_state_address: "2/0/130"

If it works ā€¦ its one way.

You are aware that the knx cover entity has an invert option.

See here.

Any particular reason to not just define a cover entity in knx?

You could try

        state: "{{ 100 - (states('sensor.rolladenposition_kuche') | int(0)) }}"

You may also use address: i-rolladenpos_kuche_percent in the expose and for position_state_address. The i- with some string appended denotes an internal GA - this is only used internally and never sent to the bus.

Other than that - the value returned from position_state_address has to match the value sent from position_address. So if you send 0% to the actuator it shall, at the end of travel return 0 on the state.

@airmax please tell me the manufacturer and model of this device so I never ever fall into the trap of buying a device from them :woozy_face:

1 Like

Hi All!

Thanks for all your contribution, this is soo helpfoul,
Im quite new to both KNX and HA but Im on my way understanding both :slight_smile:
Im trying to set up some minor functionality between HA and my KNX (Wiser KNX)

I have started to add in configuration yaml, the following
knx: !include /config/knx.yaml
and in the knx.yaml, I started to set up some minor things.

First I started with reading a temperature from KNX and it worked fine, but then I tried to add a switch. But for some reason that did not work at all?

  • Can any of you sharp minds see what is going wrong?
    I get error message ā€œInvalid config for [knx]: [Switch] is an invalid option for [knx]. Check: knx->knx->Switch. (See /config/configuration.yaml, line 31).ā€ when checking the configuration?
    ā€˜ā€”knx.yaml----ā€™
    sensor:
    ā€˜- name: ā€œBadrum tempā€ā€™
    state_address: ā€œ2/1/21ā€
    type: temperature
    sync_state: every 30
    ā€™
    Switch:
    ā€™ - name: ā€œFasadbelysning Garageā€ā€™
    address: ā€œ5/0/11ā€
    state_address: ā€œ5/0/12ā€

Best regards
Lasse

Hi :wave:!

You should use lowercase switch:

Please use code tags for yaml ```

Hi Farmio!

But f* me, tanks sooo much for you Sharp eye :wink:
The need to take care of the upper and lower case in yaml is killing me.

Thank you so much
Best regards
Lasse

Hi Farmio!

Let me see if you can solve my next question. I got the Switch and sensor working fine. So my next step is to see if I can control my floor heating. I got 6 group addresses that are controlling 12 floor heating valves/pipes. In addition to this I have one group address connected to the 6 controllers where I can switch HVAC mode on all 6 at once. I have HVAC mode (Comfort/night/eco/auto) with different temperature settings on each address. SO now I want one controller in HA to switch HVAC mode, from Comfort to Eco and backā€¦
I have one central group address and I have no temperature addresses for the central addressā€¦ I canā€™t get it to work in HA?
I have tried the following in my knx.yaml file

climate:

  • name: ā€œCentral floor heatingā€
    operation_mode_address: ā€˜0/5/30ā€™
    operation_mode_status_address: ā€˜0/5/30ā€™

Any ideas?

Iā€™m not interested at the moment to control every room, only to change HVAC mode.

Best regards
Lasse

You canā€™t use a climate entity without the required keys - which are temperature things mostly. Its main purpose is changing temperatures.
Please have a look at the documentation https://www.home-assistant.io/integrations/knx/#climate

You can use the same mode address in multiple climate entities - so changing ones mode would change all while eg a target temperature change only counts for one room. Thats perfectly fine.

If you want a pure mode selector, use a select entity.

Please always use code tags for yaml ```. See https://community.home-assistant.io/t/how-to-help-us-help-you-or-how-to-ask-a-good-question/114371#oneone-format-it-properly-16

1 Like

Thanks Farmio!

Was struggeling with getting a good format on the code, but I thought you were refering to how I was using " in my code :slight_smile:
I understood that the controller needed temperature and thats why I asked if there were any other way to do this, You are reffering to select entity.
And Im quite new to both KNX and HA, but Im learning fast :slight_smile: can you perhaps send me in the right direction to ware I can find some referens material? Cause im not sure what to do with select entityā€¦

Thanks for your swift support
Lasse

The official documentation is probably the best reference šŸ¤·
https://www.home-assistant.io/integrations/knx/#select