HomeAssistant as MQTT bridge to KNX

Never tabs, always indent with 2 spaces.
Your yaml isn’t readable here unless you wrap it in code tags (tripple backticks a Line before and after ```).
You can edit your post to add these.

There is a lot of documentation about yaml - just search the web for it or stick to the examples from the HA documentation.

Best advice ever.

Ignoring the non readable issue - Is my approach correct (ie, expose the GA 6/1/23)

I have tried using this -
#knx EVENTS

event:
- address:
- “6/1/23”

Assuming that everytime 6/1/23 changes, HA event is triggered (again how do i debug?- where do I see these events)

I am trying to read a lot of documentation but it just isnt getting into me.

:person_facepalming: it’s not only non readable - one can’t tell if it is correct or not since indentation is lost. Just insert the backticks :person_shrugging:

In developer tools → Events
See

And see here for correct Knx event config syntax

Hello
Was able to read the knx events (using knx_events as listener)

So - again- trying to do this -

~
`
¬

#FAN CONTROL

  • alias: “Switch Fan”
    trigger:
    platform: event
    event_type: knx_event
    event_data:
    address: ‘6/1/23’
    data: 1
    action:
    • service: fan.turn_on
      entity_id: fan.sahilfan
      
  • alias: “switch off”
    trigger:
    platform: event
    event_type: knx_event
    event_data:
    address: ‘6/1/23’
    data: 0
    action:
    • service: fan.turn_off
      entity_id: fan.sahilfan
      

~
¬
`

PS - backticks DONOT work. I have never faced this issue - Maybe because we dont use US kbd? I have tried all combinations. We use qwerty UK kbd. Its frustrating - Why use some obscure backtick which cannot be even used by not american keyboards

Lol I use german layout without any problem. You can even copy and paste them ```

This is how it goes

``` # start code block
# insert your yaml 
knx:
   events: 
    - name: "all readable"
      number: 1
``` # end code block

Or just use the button here

And I lost my ability to see knx_events.

Here is my cut paste (removed fan example)
`
##KNX EVENTS

event:

  • address:
    • “7/6/*”
    • “6/1/*”

#Automation#############################################################

automation:

#SPEAKER CONTROL

  • alias: speaker control 1
    trigger:
    platform: event
    event_type: knx_event
    event_data:
    address: “7/6/1”
    data: 1
    action:
    service: switch.turn_on
    data: {}
    target:
    entity_id: switch.inside_speakers
  • alias: speaker control off
    trigger:
    platform: event
    event_type: knx_event
    event_data:
    address: “7/6/1”
    data: 0
    action:
    service: switch.turn_off
    entity_id: switch.inside_speakers
    `

BTW - I did use the </> button on top.
Still it doesnt work.(posting the preformatted text- it still doesnt work)

See my earlier post - I used all possible symbols. One of them IS cut and paste of the character from website. It still doesnt work for me.

Makes me think twice…

You seem to have used single backticks instead of tripple… single is for inline, tripple for multi line

Anyway, there is no address key in knx_events event_data and the data key is a subkey of event_data.

trigger:
  - platform: event
    event_type: knx_event
    event_data:
      destination: "1/2/3"
      data: 0

Caught this - Got events firing again.
Can you please check why the action is not firing.
I tried this also ```

  - alias: speaker control off
    trigger:
      - platform: event
        event_type: knx_event
        event_data: 
          address: "7/6/1"
          data: 0
    condition: []
    action:
      - service: switch.turn_off
        target:
          entity_id: switch.inside_speakers

Come on…

Frankly - This yaml seems to be beyond me (and I can see why I was frustrated earlier with KNX - Its actually my lack of yaml)

Since I am able to post properly now (finally!!!), here is -

`##KNX EVENTS

  event:
    - address:
      - "7/6/*"
      - "6/1/*"

#Automation#############################################################

automation:

#SPEAKER CONTROL

  - alias: speaker control 1
    trigger:
      - platform: event
        event_type: knx_event
        event_data: 
          address: "7/6/1"
          data: 1
    condition: []
    action:
      - service: switch.turn_on
        target:
          entity_id: switch.inside_speakers
  - alias: speaker control off
    trigger:
      - platform: event
        event_type: knx_event
        event_data: 
          address: "7/6/1"
          data: 0
    condition: []
    action:
      - service: switch.turn_off
        target:
          entity_id: switch.inside_speakers

#FAN CONTROL

  - alias: "Switch Fan"
    trigger:
      platform: event
      event_type: knx_event
      event_data:
        address: '6/1/23'
        data: 1
    action:
    -     service: fan.turn_on
          entity_id: fan.sahilfan
  - alias: "switch off"
    trigger:
      platform: event
      event_type: knx_event
      event_data:
        address: '6/1/23'
        data: 0`

farmio already pointed this out 2 times, but still its in your code
There is no address in knx_event, its destination
So there is no valid event and the trigger will never “trigger” thus no action.

adress: ‘6/1/23’ → destination: ‘6/1/23’

1 Like

I read that but I am confused by old threads saying “destination” is now replaced by “address”.

I have tried replacing address with destination - still doesnot work.

`##KNX EVENTS

  event:
    - address:
      - "7/6/*"
      - "6/1/*"

#Automation#############################################################

automation:

#SPEAKER CONTROL

  - alias: speaker control 1
    trigger:
      - platform: event
        event_type: knx_event
        event_data: 
        destination: "7/6/1"
        data: 1
    condition: []
    action:
      - service: switch.turn_on
        target:
          entity_id: switch.inside_speakers
  - alias: speaker control off
    trigger:
      - platform: event
        event_type: knx_event
        event_data: 
        destination: "7/6/1"
        data: 0
    condition: []
    action:
      - service: switch.turn_off
        target:
          entity_id: switch.inside_speakers
`

Thats what you should use. With version changes old threads will become invalid.

As for the trigger itself: in the automation you cann see if a trigger is being activated.
If you send an 1 to the knx group 7/6/1 does it show as triggered on the automation?
And in the developer tools, what was the exact trigger you saw?

Just noticed that your indentation is wrong:

  - alias: speaker control 1
    trigger:
      - platform: event
        event_type: knx_event
        event_data: 
        destination: "7/6/1"
        data: 1

Should be:

  - alias: speaker control 1
    trigger:
      - platform: event
        event_type: knx_event
        event_data: 
          destination: "7/6/1"
          data: 1

thats exactly right. If it helps you can think of yaml as cut-down json (in fact json is valid yaml).
So

- platform: event
  event_type: knx_event
  event_data: 
    destination: "7/6/1"
    data: 1

would be equal to JSON

[
  {
    "platform": "event",
    "event_type": "knx_event",
    "event_data": {
      "destination": "7/6/1",
      "data": 1
    }
  }
]

so indendated sub-blocks are dicts (objects) and - prefixed sub-blocks are lists (arrays).

Got this.

Anyway - To remove my confusion - I have now started using this purely using automation(in settings).

Yaml isnt my cup of tea…