Send value to KNX

Hi all,

I’ve switched to Openhabian 2.3.3 a few days ago and setup the new knx2 binding.
Nearly everything works as expected, but I´m struggling to forward some values from other bindings, like Xiaomi Mihome-, Wunderground-, NTP-binding to KNX.
With the old KNX-binding, there was no problem, all items were forwarded to the specific GA’s.

Some of my items look like this:

Number Xiaomi_Humidity_Bad <humidity>  (gXiaomiGateway) { channel="mihome:sensor_ht:a764dd18:humidity", knx="9.007:12/4/0"}

Number:Temperature Temperatur_aussen "Current temperature [%.1f %unit%]" <temperature> {channel="weatherunderground:weather:CGN:current#temperature", knx="9.001:12/0/0"}

DateTime    NTPServer_DateTime   "Datum und Zeit"   {channel="ntp:ntp:NTP:dateTime", knx="10.001:12/1/0"}

String      NTPServer_String     "Datum und Zeit"   {channel="ntp:ntp:NTP:string", knx="11.001:12/1/1"}

But nothing appears on the KNX-Bus. In Paperui and Basic UI the item values are all shown correct. I’m wondering if the way to forward to KNX has changed? I was seaching for a solution, but I could not find anything that helps me. So, I tried to add the channels of the GA’s above to the knx.thing.

The channel looks like this:

        Thing device Weather_GA "Wetterbinding Gruppenadressen KNX" @ "KNX" 
        {
                Type    number-control  :               LocalWeather_CurrentTemperature      "Aussentemperatur"                     [ ga="9.001:12/0/0"]
        }
        

        Thing device Xiaomi_GA "Xiaomi Gruppenadressen KNX" @ "KNX" 
        {
                Type    number-control  :   XiaomiAqaraBad_Temperature          "Temperatur Aquara Bad"                 [ ga="9.001:12/4/1"]
                Type    number-control  :   XiaomiAqaraBad_Humidity             "Luftfeuchtigkeit Aquara Bad"           [ ga="9.007:12/4/0"]
                Type    number-control  :   XiaomiAqaraKeller_Temperature       "Temperatur Aquara Keller"              [ ga="9.001:12/4/3"]
                Type    number-control  :   XiaomiAqaraKeller_Humidity          "Luftfeuchtigkeit Aquara Keller"        [ ga="9.007:12/4/2"]
        }
       

       Thing device NTP "NTP Data" @ "KNX" 
        {
                Type 	datetime-control : 		time 			[ ga="10.001:12/1/0" ]
                Type 	datetime-control : 		time 			[ ga="11.001:12/1/1" ]
        }

For example, if I try to read 12/4/0 via ETS, log throws out following:

22:04:45.355 [DEBUG] [calimero.link.224.0.23.12:3671 ] - indication 0.0.1->12/4/0 L_Data.ind, low priority hop count 4, tpdu 00 00
22:04:45.391 [DEBUG] [calimero.link.224.0.23.12:3671 ] - indication 1.1.62->12/4/0 L_Data.ind, low priority hop count 5, tpdu 00 40 00 00
22:04:45.391 [DEBUG] [x.internal.handler.DeviceThingHandler] - Thing ‘knx:device:KNXROUTER:Xiaomi_GA’ received a Group Write telegram from ‘1.1.62’ for destination ‘12/4/0’
22:04:45.411 [INFO ] [smarthome.event.ItemCommandEvent ] - Item ‘XiaomiAqaraBad_Humidity’ received command REFRESH
22:04:45.425 [WARN ] [ihome.handler.XiaomiSensorBaseHandler] - Cannot execute command - Sensors by definition only have read only channels
22:04:45.430 [INFO ] [smarthome.event.ItemCommandEvent ] - Item ‘XiaomiAqaraBad_Humidity’ received command 0
22:04:45.440 [DEBUG] [x.internal.handler.DeviceThingHandler] - None of the configured GAs on channel ‘knx:device:KNXROUTER:Xiaomi_GA:XiaomiAqaraBad_Humidity’ could handle the command ‘0.00000000’ of type ‘DecimalType’
22:04:45.451 [INFO ] [smarthome.event.ItemStateChangedEvent] - XiaomiAqaraBad_Humidity changed from 68.06999969482422 to 0

Honestly, I don’t know what to do with this. Can someone pleae give me some advice what could be wrong and how to forward to the new knx binding? Thanks in advance.

I think that DTP 9.007 is PercentType and your Number Item is sending DecimalType.
Try to use DTP 9.001 or Switch the Item definition to a Dimmer ? :slight_smile: (not sure if any of this will work)

Ref: https://github.com/openhab/openhab2-addons/issues/3416

Also, check out this:

I’m pretty sure that humidity is percentType anyway :wink:

But there are some other things…

  1. There is no openHABian 2.3.3, the current release is 1.4.1, according to https://github.com/openhab/openhabian/releases
  2. There is no openHAB2.3.3 either (see https://github.com/openhab/openhab-distro/releases)
  3. If using knx2 Binding, the item definition is with channels, not the binding itself
  4. If using knx2 Binding, you have to define a bridge and at least one (generic) thing. you have to ensure that all channels are of the correct type (number vs. number-control, datetime vs. datetime-control and so on)

It took a few ours of further research, but now I’m a little bit wiser :smiley:
& nearly all the problems are solved.
All the values are shown on the displays of my room controllers, that was the first goal.

I have changed to DTP9.001 and followed Udo´s point 3.
Point 4 was fine before with the rest of my knx devices. Just didn´t show the whole config of that.

So, thanks a lot for pointing me in the right way! :slightly_smiling_face:

Using channels also helped me. But I could only make it work with the right channel order or with profiles.

I solved it by either set the ntp channel in the items channel definition to the end:

 { channel="knx:device:bridge:NTP:datetime", channel="ntp:ntp:local:dateTime"}

or

 { channel="knx:device:bridge:NTP:datetime, ntp:ntp:local:dateTime"}

or using “follow” profile

{ channel="ntp:ntp:local:dateTime",  channel="knx:device:bridge:NTP:datetime" [profile="follow] }

Hey Bakkashan,

I’m currently struggling the same problem, and couldn’t find a solution yet.

how did you managed to get the temperature to the knx world? i tried to define a channel within the bridge-thing setup, but didn’t get far with this.

is it possible for you to share your configuration so that i could try to set it up the same way you did?

many thanks in advance
Florian

Hey Florian,

sorry for late reply. Here is my current configuration. I forward values from weather binding, mihome binding and NTP binding to my knx bus. Maybe this will help you.

knx.things

Bridge	knx:ip:KNXROUTER "MERTEN KNX/IP Router" @ "KNX" [
	type="ROUTER",
	ipAddress="224.0.23.12",
	portNumber=3671,
	localIp="192.168.178.80",
	readingPause=50,
	responseTimeout=10,
	readRetriesLimit=3,
	autoReconnectPeriod=1,
	localSourceAddr="0.0.4" ]
	{
              
                Thing device Weather_GA "Wetterbinding Gruppenadressen KNX" @ "KNX" 
                {
                        Type    number-control  :   LocalWeather_CurrentTemperature      "Aussentemperatur"       [ ga="9.001:12/0/0"]
                }

                Thing device Xiaomi_GA "Xiaomi Gruppenadressen KNX" @ "KNX" 
                {
                        Type    number-control  :   XiaomiAqaraBad_Humidity             "Luftfeuchtigkeit Aquara Bad"           [ ga="9.001:12/4/0"]
                        Type    number-control  :   XiaomiAqaraBad_Temperature          "Temperatur Aquara Bad"                 [ ga="9.001:12/4/1"]
                        Type    number-control  :   XiaomiAqaraKeller_Humidity          "Luftfeuchtigkeit Aquara Keller"        [ ga="9.001:12/4/2"]
                        Type    number-control  :   XiaomiAqaraKeller_Temperature       "Temperatur Aquara Keller"              [ ga="9.001:12/4/3"]
                }
               
               Thing device NTP "NTP Data" @ "KNX" 
                {
                        Type 	datetime-control : 		time 			[ ga="10.001:12/1/0"]
                        Type    switch-control   :      Daytime         [ ga="1.002:12/1/2"]
                }

	}

NTP.items

DateTime    NTPServer_DateTime   "Zeit"   {channel="ntp:ntp:NTP:dateTime", channel="knx:device:KNXROUTER:NTP:time"}
Switch      Tageszeit           "Tag-Nacht"   {channel="knx:device:KNXROUTER:NTP:Daytime"}

Mihome.items

Number   XiaomiAqaraKeller_Humidity       "Aqara Humidity Keller"          <humidity>     (G_Sensoren, G_XiaomiGateway)         {channel="mihome:sensor_weather_v1:158d0001ab2d4d:humidity", channel="knx:device:KNXROUTER:Xiaomi_GA:XiaomiAqaraKeller_Humidity"}
Number   XiaomiAqaraKeller_Temperature    "Aqara Temperatur Keller [%.1f °C]"        <temperature>  (G_Sensoren, G_XiaomiGateway)          {channel="mihome:sensor_weather_v1:158d0001ab2d4d:temperature", channel="knx:device:KNXROUTER:Xiaomi_GA:XiaomiAqaraKeller_Temperature"}

Weatherbinding.items

Number                 LocalWeather_CurrentTemperature                            "Aussentemperatur"                 {channel="weatherunderground:weather:local:current#temperature", channel="knx:device:KNXROUTER:Weather_GA:LocalWeather_CurrentTemperature"}