KNX Cookbook (legacy)

It’s ok. The ignore_internal_state goes on the binary_sensor config - See documentation.

If you once don’t turn on all of your lights with 0/0/1, the state will be still 0. When you press your button now and send a 0 the internal state has not changed, but you want tonprocess it anyway. This is what the config does.

You could also use a scene for these things.

@farmio I just don’t see where the ignore_internal_state needs to go… I looked at the config for the knx-binary sensor and it’s not there?


Or am I blind???

Also googling for “ignore_internal_state” brings surprisingly little search results… But I learned that you are one of the main xknx-github contributors though! Thanks a lot for that!!! Really cool!

Oh, I’m sorry. This isn’t even integrated to HA yet :rofl:
It was merged to xknx 4 month ago but hasn’t found its way to HA. With the next version (HA 0.115 or current dev) you will be able to try this.

1 Like

Update:
I changed all config examples in the original posting to reflect the changes that were introduced to the KNX integration with the release of Home Assistant v0.115. (platform: knx was removed from the entity definitions.)
AFAICT the old definitions are still accepted and working in v0.115 (at least they did for me). But it’s surely commendable to keep the cookbook in sync with the latest documentation.

2 Likes

Thanks for update. For me the old config did not work after upgrade to 115, had to change the config to make it work.

Same here, I’m going to need to rework all of the KNX stuff in my config. Perhaps it’s a good time to separate it out into dedicated YAML files instead of just piling it all into the main config YAML.

My wife told me this morning, “did you change something in the app?” (she usually only interfaces with HA via the HA app) I told her I updated it before realizing the KNX updates were going to take me a lot longer to sort out than I thought. She then tells me, “you mean I have to get out of my chair and press a button?!” :rofl:

If you have plenty of KNX devices it could indeed take some time but in general was not difficult - search/replace in notepad++ was enough for 99% of changes :slight_smile:

1 Like

I have the problem that the exposition of time / date is not working anymore in 0.115 and as another downside - my overall temperature which i expose to the knx-bus is updated only every hour (was different in 0.114 before):
expose:
- type: ‘time’
address: ‘0/0/1’
- type: ‘date’
address: ‘0/0/2’
- type: ‘temperature’
entity_id: ‘sensor.temp_min’
address: ‘0/0/5’

Look at the sync-state attribute. The default is every 60 minutes unless it gets info from the bus. You can change it as needed.

1 Like

Good to see a KNX community adapting HA!

I have a small question, maybe someone tackled it already.
I have a Central GA for ‘All Off’ and configured a switch inside HA, but I want to disable the On part of the switch, I only want it to sent Off, any idea or suggestion?

Use a knx scene or some logic with a filter - but your switch can have the wrong state then.
Or knx.send service.

You could use a template switch. You then need to define the on/off actions. The off action is: service: switch.turn_off but you could change the on action to anything else like, HAL9000 saying, “I’m sorry, Dave. I’m afraid I can’t do that.” :smiley:

Thanks.
I was just testing with this, seems to work, it goes back to On but that’s fine it’s for Off anyway.
Wil test with knxsend too.

switch:
  - platform: template
    switches:
      alles_uit_off:
        value_template: "{{ is_state('switch.alles_uit', 'off') }}"
        turn_on:
          service: switch.turn_off
          data:
            entity_id: switch.alles_uit
        turn_off:
          service: switch.turn_off
          data:
            entity_id: switch.alles_uit

I’m having problems updating my config file for v.115. Previously, I had it all included in my main configuration.yaml. The KNX sensors were under “sensors:” along with other non-KNX sensors, switches under “switch:”, etc. With the 115 changes, I assumed all I needed to do was pile it all under the “knx:” and remove all the “platform: knx” lines. Basically it looks like this now:

knx:
  tunneling:
    xxx
    xxx
    xxx
  sensors:
    - name:
      state_address: '1/1/1'
      type: 'temperature'
    - xx
  binary_sensors:
    - xx
    - xx
  climate:
    - xx
    - xx
  covers:
    - xx
    - xx

Just to give you an idea of how it’s formatted. Then, re-reading the docs I see this:

In order to make use of the various platforms KNX offers you will need to have the following configuration inside configuration.yaml depending on what platforms you intend to use:

knx:
  binary_sensor: !include knx_binary_sensor.yaml
  switch: !include knx_switch.yaml
  sensor: !include knx_sensor.yaml
  cover: !include knx_cover.yaml
  light: !include knx_light.yaml
  notify: !include knx_notify.yaml
  scene: !include knx_scene.yaml

Looking in the different platform docs it gives a format of:

knx:
  sensors:
    - name: xxx
      state_address: xxx
    - etc

So, do I have to break out the platforms into separate files like it says in the main KNX doc? Or can I keep it all together? If I can keep it all together, what formatting did I screw up?

Thanks,
Fork

It’s

knx:
  sensor:

not

knx:
  sensors:

(No plural “s”!)

Ha, good catch! That mistake was only in my post :smiley:

Just to clear up, here’s the beginning of my KNX section in my config:

knx:
  tunneling:
    host: '192.168.xx.xx'
    port: 3671
    local_ip: '192.168.xx.xx'
    
  binary_sensor:
    - state_address: '4/1/4'
      name: weatherstation.rain
      device_class: moisture
    - state_address: '4/1/1'
      name: wind_alarm

  sensor:
    - name: weatherstation.temp
      state_address: '4/2/1'
      type: 'temperature'
    - name: weatherstation.wind
      state_address: '4/2/2'
      type: 'wind_speed_ms'
    - name: weatherstation.lux
      state_address: '4/2/3'

You don’t need to break it up, this is optional.

OK, then I need to work on finding my formatting mistake. Thank you and Jörg for the input so far. I’ll keep plugging away.

I started to break it before I saw your reply. I decided to finish the process as I kind of needed to clean up my config file anyway as it was 70% KNX line items. After a reboot I thought I was going to have to start debugging but now it’s working! I’m guessing I had perhaps a duplicate platform name or something else stupid :smiley:

2 Likes

I just moved the KNX Cookbook to the Community Guide section of this forum.

Let us continue all discussions there:

The advantage of the Community Guide section is that it is a Wiki. You can all participate in updating my original posting. I have also placed a back-link to this thread in the very first posting of the new Cookbook. So the discussions here are not lost.

2 Likes