[SOLVED] Problem reading correctly 4-byte float from KNX

Tags: #<Tag:0x00007fd317ef0870> #<Tag:0x00007fd317ef0618>

(Orazio) #1
  • Platform information:
    Virtual Machine
    Debian 8
    Java 1.8.0
    OpenHAB 2.3.0

Hi all.
I’m a beginners in Openhab.
I’m trying to reading pressure value from KNX sensor, but I see a wrong value. I configured file .things as below
Number KNXTempUmidity_Pressure “Pressure [%.2f hPa]” {knx=“14.058:0/1/7”}

From ETS I see the correct value, which was 96880 Pa, but in OpenHAB I see a wrong value 5071.36.

[.internal.handler.DeviceThingHandler] - Thing ‘knx:device:xyz’ received a Group Write telegram from ‘1.1.3’ for destination ‘0/1/7’
[.internal.handler.DeviceThingHandler] - Thing ‘knx:device:xyz’ processes a Group Write telegram for destination ‘0/1/7’ for channel ‘knx:device:xyz:403’
[g.knx.internal.dpt.KNXCoreTypeMapper] - toType datapoint DPT = 9.001

Is there anything wrong in my .things file configuration? Or something was wrong in KNX binding installation?
All other items works.

Best regards

(Florian) #2

At first sight, I’d guess the problem lies here:

Openhab is obviously trying to convert the value to the wrong format, so have a look at that.

(Rich Koshak) #3

There is a feature in OH 2.3 that lets you define types for numerical values so, for example, if your sensor only reports temp in F, you can easily and relatively transparently transform that value into C. @vzorglub, you’ve been collecting information about how to work with these units. I couldn’t find anything about how to use them in Item labels. Can you advise?

(Vincent Regaud) #4

96880 Pa = 968.80 hPa

So Your Item:

Number KNXTempUmidity_Pressure “Pressure [%.2f Pa]” { knx=“14.058:0/1/7” }

Your Sitemap:

Text item=KNXTempUmidity_Pressure label=“Pressure [%.2f hPa]”

Will convert the Pa into hPa in the sitemap
Although there is a problem with unit prefixes at the moment it should still work with SI units like the Pascal (1N/m2)

(Orazio) #5

@geworfener @vzorglub @rlkoshak thanks all for response.

I configure my sitemap like that example, but nothing changed I see a wrong value 5071.36 hPa in place of correct read from ETS which is 97030 Pa (or 970.30 hPa).
I think isn’t a problem how value was displayied, but how openhab manage datatype: I’ve configured DTP 14.058 but it uses 9.001. Maybe something was wrong in KNX binding installation…

Best regards

(Vincent Regaud) #6

I missed somthing.
Your item should be:

Number:Pressure KNXTempUmidity_Pressure “Pressure [%.2f Pa]” { knx=“14.058:0/1/7” }

(Orazio) #7

I’ve done, but nothing changed :pensive:

(Vincent Regaud) #8

It look like the binding it reading the wrong value.
Or changing it somehow.
That not OH, it’s the binding

(Orazio) #9

I used definition of file .things used in this topic:

Now look like this:

Bridge knx:ip:bridge [ _
_ ipAddress=“X.X.X.X”, _
_ portNumber=3671, _
_ type=“TUNNEL”, _
_ readingPause=50, _
_ responseTimeout=10, _
_ readRetriesLimit=3, _
_ autoReconnectPeriod=1,

_ localSourceAddr=“1.1.255”_
] {
_ Thing device generic [_
_ address=“1.1.3”,_
_ fetch=true,_
_ pingInterval=300,_
_ readInterval=3600_
_ ] {_
_ _
_ Type number : Pressure “Pressure” [ ga=“14.058:<0/1/7” ]_
_ _
_ }_

So I resolved the problem to translate value with correct DTP, and now see the same value in ETS and OH2.