openHAB 4.0 Milestone discussion

A fix has already been proposed: Fix NPE in UpgradeTool when no pattern present by J-N-K · Pull Request #3630 · openhab/openhab-core · GitHub. Press Ctrl-C to end the hanging tool.

1 Like

Upgrade fro SNAPSHOT to M3. This was possible for openHAB 3.4 without any issue on my side.

I am not sure if I made some mistake or if this might be a bug.

As I had to review my unit of measurement configuration before upgrading to M3 I wanted to adapt my KNX configuration to use units as well.

I have the following KNX thing definition for absolute humidity:

...
Type number : Feuchte_Abs_Keller_HV  "Feuchte abs. Keller HV"  [ ga="14.017:11/1/203" ]
...

With the following item attached to the channel:

Number:Density Feuchte_Abs_Keller_HV "Feuchte abs. Keller HV [%.2f g/m³]"    <water>      (gMesswerte, gSemTempHumKellerHV)   ["Measurement", "Humidity"] { unit="g/m³", channel="knx:device:bridge:knx-tw-1_1_200:Feuchte_Abs_Keller_HV",                                                                          widgetOrder="6204" }

I checked with a KNX bus monitor, the value is indeed send as g/cm³, e.g. the device sends 0x410C0000 , which, as float, is 8.75. But in the UI the value is shown as 8750 g/m³.

As I understood it, the metadata unit=“g/m³” should have ensured, that the value is in the correct unit, but this is probably a misunderstanding?

If I connect the channel to a simple Number item the value is displayed correctly:

Number Feuchte_Abs_Keller_HV "Feuchte abs. Keller HV [%.2f g/m³]"    <water>      (gMesswerte, gSemTempHumKellerHV)   ["Measurement", "Humidity"] { channel="knx:device:bridge:knx-tw-1_1_200:Feuchte_Abs_Keller_HV", widgetOrder="6204" }

What am I doing wrong?

The default unit for density in OH is kg/m³, which is assumed that the value is in if it doesn’t have a unit. 8.75 kg/m³ = 8750 g/m³

According to Calimero code the unit for DPT 14.017 is kg/m³. So 8.75 kg/m³ indeed is 8750 g/m³, so it looks fine to me.

Edit: https://www.knx.org/wAssets/docs/downloads/Certification/Interworking-Datapoint-types/03_07_02-Datapoint-Types-v02.02.01-AS.pdf also states that the values are kg/m³.

The internal unit does not matter in this case, the KNX binding already sends the value with correct unit.

I’m having the exact same issue on my Raspberry PI with Enocean USB300. It worked ok on OH 4.0.0.M1 and is broken both on OH 4.0.0.M2 and M3.
Any ideas anyone?

1 Like

No, it is not. Forcing update to M3 says it is a downgrade, eve the SNAPSHOT is older than M3 :thinking:

That’s exactly the case here too. Nevertheless, I am now on Build #3481, which was done after M3.

Yes and this is consistent with the KNX specification. But as I understood the unit metadata description I thougt, that it would „overwrite“ this unit.

If this is not the case I will continue to use Number items without units, as I can not change what my device is sending.

But I specified the unit as g/m³, apparently without effect.

I think you misunderstand the meaning of the item’s unit. It is applied to values that don’t have a unit (which is not the case here, the value already has a unit) and used for persisting values. What you want to do is change the unit of a value. I have a profile in development for that, until then you you be able to use a simple JS transformation profile that divides the value by 1000.

2 Likes

Hello,

what is wrong with this transformation?

DateTime	date_actualntptimestamp	"Date  [SCRIPT:graaljs:timetotimestamp.script:%s]"	<time>	{channel="ntp:ntp:smarthome:dateTime"}

timetotimestamp.script

(function(i) {
    var date = new Date(i); 
    var response = date.getTime(); 
    return response.toString();
}) (input)

there is no error but it’s not correctly transformed

this is the result

SCRIPT:graaljs:timetotimestamp.script:2023-05-25T23:06:26.595+02:00
DateTime	date_actualntptimestamp	"Date  [JS(timetotimestamp.script):%s]"	<time>	{channel="ntp:ntp:smarthome:dateTime"}

My fault.

1 Like

Now the output is

JS:timetotimestamp.script:2023-05-25T23:08:31.920+02:00

See my edit.

Found it out :slight_smile:

1 Like

You can (and probably should) also rename the file to .js

Thanks for clarifying, than indeed I misinterpreted the documentation.

I think the easiest solution for me would be using a Number item without unit, as I did in the past. But a profile is also a good idea.

M3 did not turn out well for me …
No rules were executed! Tried rebooting several times. Could control items, but no rules triggered.
Downgraded to M2 and all was well again.

omr@shs2:~$ uname -a
Linux shs2 5.15.0-72-generic #79-Ubuntu SMP Wed Apr 19 08:22:18 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
omr@shs2:~$ java --version
openjdk 17.0.7 2023-04-18
OpenJDK Runtime Environment (build 17.0.7+7-Ubuntu-0ubuntu122.04.2)
OpenJDK 64-Bit Server VM (build 17.0.7+7-Ubuntu-0ubuntu122.04.2, mixed mode, sharing)

Thanks @hmerk, I’ll look into it because the behaviour you expected is the way it should have worked.

For now: Even though it says downgrade it will still perform the correct steps.

2 Likes

what rules language? How many rules, how triggered?? UI rules or file?
more info please