Integrate mqtt with KNX

Problem with MQTT2.

I am trying to set up a gateway between KNX and MQTT2 where everything from the MQTT2 to the KNX addresses has to be sent and from knx to mqtt.

I can not do this with the things files. If I do it via paperui and I select system: follow it works.
There is also a possibility to do this more simply. I have many items and I would like to arrange this via the files.

Or is there a simpler way to create a gateway between 2 systems where the statuses and the commands are sent?

I’ve been playing around with it for days, but I can not get it done.

Things

Bridge mqtt:broker:myUnsecureBroker [ host="127.0.0.1", secure=false, username="username", password="pw" ]
{
    Thing topic mything {
    Channels:
      
        Type switch : knxswitch    "KNX switch"       [ stateTopic="/knx switch", commandTopic="/knx switch", postCommand="true" ]

Item

Switch knxswitch “knxswitch” { channel=“mqtt:topic:myUnsecureBroker:mything:knxswitch”, channel=“knx:device:eb02cdb0:test”, autoupdate=“true” }

For what purpose do you need a gateway like this?

OH is intended to be a hub, not a gateway to some other hub. So it really isn’t going to make this job easy for you. I know of no way to do it without creating Items for each and every device.

I’d look to see if someone has already written a KNX to MQTT gateway and use that. If not I’d consider writing something external to OH that can interrogate the KNX and set up the mapping to MQTT topics automatically. OH is really a sub optimal tool to set something like this up.

It is more intended to use the power to easily link it with other programs. The gate is therefore not specific about KNX but about all connections.

Is it therefore not possible to set a system follow option via the things or items files?

You can set the follow profile. But you will have to manually create an Item for each and every KNX Channel, manually create a corresponding MQTT Thing and Channel, and set up the follow profile individually. That’s a ton of manual work and something that will have to be kept up to date every time you get new Things. This is why OH is a poor choice for this use.

OH is intended to be the central thing that the technologies connect to, not as a gateway to expose this technology or that technology to MQTT. That is why we see programs like zigbee2mqtt which is pretty popular among OH users. You will want to find or build a knx2mqtt program that can automate some of the discovery of devices and publishing to the MQTT so you don’t have to create all that stuff manually.