openhab / openhab-addons

Add-ons for openHAB
https://www.openhab.org/
Eclipse Public License 2.0
1.88k stars 3.59k forks source link

[knx] Unexpected behavior using DTP 5.001 #4167

Closed lewie closed 3 years ago

lewie commented 6 years ago

Tested on a 2.4.0-SNAPSHOT Build #1401 on Windows, with only KNX2 binding installed.

Expected Behavior

  1. I would expect that DTP 5.001 can also be configured as a number thing.
  2. The loosing of the KNX packets when DTP 5.001 configured as number should minimum raise a warning?!

Current Behavior

DTP 5.001 correctly configured to get percent value: KNX Thing in ./conf/things/*.thing: it normally has to be Type dimmer

Type dimmer  :OG_mitte_Status_Stellwert_0_2_42  "OG mitte Status Stellwert" [ position="5.001:<0/2/42", autoupdate="true" ] //  1 byte K L - U - Prozent (0..100%)

KNX Item in ./conf/items/*.item: it normally has to be Dimmer Item

Dimmer  OG_mitte_Status_Stellwert_0_2_42    "OG mitte Status Stellwert [%d %%]" (OG, gHeizaktoren, gMitte, gSQLeveryDayChange)  { channel="knx:device:bridge:knx_heataktors:OG_mitte_Status_Stellwert_0_2_42" } 

Log output: Use dimmer thing as Dimmer Item:

2018-10-27 08:44:11.433 [vent.ItemStateChangedEvent] - OG_mitte_Status_Stellwert_0_2_42 changed from 100 to 8

Use dimmer thing as Number Item:

08:49:04.398 [INFO ] [smarthome.event.ItemStateChangedEvent] - OG_mitte_Status_Stellwert_0_2_42 changed from 0.08000000 to 1.00000000

When I switch my thing to Type number or Item AND Thing to number, I get no update from the KNX bus anymore. It does not matter if i have defined my thing with or without DTP definition position="5.001:<0/2/42".

It would be desirable if we could define DTP 5.001 alternatively as a number in the Things. It seems to me at least not logical because this behavior leads to confusion.

The loosing of the KNX packets is not correct. In addition, the KNX binding does not even raise a warning for this case.

Originally we discussed here: https://github.com/openhab/openhab2-addons/issues/4146

bjoernbrings commented 5 years ago

Can confirm the problem for controlling my heating (get values from 0.0 to 1.0 instead of 0.0 - 100.0 [%]). I thought with the new UoM system that could be solved but it couldn't.

zaphood1967 commented 5 years ago

After some testing I can add the following observations:

Stopping and starting OH2 alone has no effect in these cases. I have run These Tests on a RPi 3b+ as well as on a Ubuntu VM (18.04 LTS Server) on my Qnap Intel NAS.

zaphood1967 commented 5 years ago

Now this is where it gets REALLY weird. The above stated problem with the DPT types behaves DIFFERENTLY on an RPi as it does on my Ubuntu VM:

Both installations run the same 2.4 snapshot and have been installed using the OPENHABIAN.iso (RPi) and the repository to install on Ubuntu respectively.

lewie commented 5 years ago

@zaphood1967, I think "this very same configuration" of Items and Things is not exactly the same? I have tested now on a RPI on a standard Debian and Windows. I get exactly same behavior. If configuration is dimmer/dimmer (which is the correct configuration) there where no problems at all!

I suspect another error somewhere in your Item/Tings configuration.

@bjoernbrings, Items AND Things both have to be configured as Dimmer not as Number!! Then it works.

Dimmer Heizung_Stellwert_EG_Flur        "Heizung Stellwert EG Flur [%d %%]"                         (EG_Flur, Temperatur, Temperatur_EG)        {channel="knx:device:MDTBridge:MDT_AKH_EG:Kanal_C_stell"}
Dimmer Heizung_Stellwert_EG_Flur_test   "Heizung Test Stellwert EG Flur [%d %%]"                    (EG_Flur, Temperatur, Temperatur_EG)        {channel="knx:device:MDTBridge:MDT_AKH_EG:Kanal_C_stell"}

and in things file use like: (Type dimmer!)

Type dimmer :Kanal_C_stell   "Kanal_C_stell"   [ position="<0/2/22" ]   //  1 byte  K   L   -   U   -   Prozent (0..100%)
bjoernbrings commented 5 years ago

Thanks for the hint will give it a try.

Anyways it sounds very unintuitive to me having to configure a heating as dimmer to get correct values.

zaphood1967 commented 5 years ago

In fact, I copied the entire config-files from the RPi over to the VM (only changing the KNX HW adress of the machine in the knx.things file). So I would consider this as much identical as it can get between two slightly different OS environments?

Additionally, on the VM I was unable to receive just any data for 3 additional GA which did not work even after several reboots, leaving me somewhat puzzled.

Not sure what makes this Binding kind of tick differently here.

lewie commented 5 years ago

@bjoernbrings, knx2 is relatively new, we have to improve it bit by bit. @zaphood1967, currently I can not come up with a solution or reproduce the behavior. But I will keep your observation in mind.

lostcontrol commented 5 years ago

Nothing more than a "me too" from my side. I would expect 48 (%) here but get 0.48 instead:

2018-11-09 00:05:26.296 [vent.ItemStateChangedEvent] - Heating_Rez_SalleDeBainParents_Status changed from 0.49000000 to 0.48000000

I'm currently migrating my OpenHAB 1.8 installation to 2.4.0-M5, redoing my KNX config (well, using Python to automate most of the things).

I have channels defined as numbers:

Type number : Heating_SS_Disponible_Status "Disponible [%d %%]" [ ga="5.001:<5/2/20" ]

Number Heating_SS_Disponible_Status "Disponible [%d %%]" <heating> (Heating) { channel="knx:device:bridge:generic:Heating_SS_Disponible_Status" }

zaphood1967 commented 5 years ago

See updated comment here https://github.com/openhab/openhab2-addons/issues/4146#issuecomment-439604804

fivesails commented 5 years ago

Another "me too" from my side. On openHAB Version 2.3, the workaround described by @lewie and @zaphood1967 in (https://github.com/openhab/openhab2-addons/issues/4146) works for me with Channel configured as Number and Item configured as Dimmmer: knx.things:

Thing device foo [
   ...
] {
    Type number:         ActuatingValue                [ ga="5.001:<4/5/40" ]
    ...
}

knx.items:

Dimmer HVAC_AV_A   "ActuatingValue [%d %%]"  <heating> {channel="knx:device:bridge:foo:ActuatingValue"}
hmerk commented 3 years ago

closed due to inactivity