[SOLVED] Aqara Multisensor Temperature is displayed with wrong decimal

Hi there,
I got a new pair of the Aqara Multisensors with Temp, Humidity and Pressure. Adding them to Phoscon App worked really easy. Defining them in .things and .items also. Unfortunately the Temperature is displayed way too high. It’s 2675,00°C instead of 26,75°C. In Phoscon App all Values are displayed correctly.
In the .items file the were defined as:

number              WoZi_MultiSens_Temp         "Temperatur [%.1f °C]"      <temperature>       (DG_Wohnzimmer, gHeating)                                {channel="deconz:temperaturesensor:homeserver:WoZi_MultiSens_Temp:temperature" }

I tried to move the comma via java formatter class, but nothing worked out.
I’m using Openhab 2.4.0 + ConBee + DresdenElektronik DeConz Binding on RaspPi 3+.

Does someone have same issues or does someone know a solution for that?

Thanks.

cheers Hannes

This kind of thing is common in modbus sensors, e.g. the value read is an integer 2675 and you need to divide by 100.
The modbus binding allows you to apply a read transformation to the channel, where you can use a JS script to do the divide. But to do that, the binding needs to support transforms and the deconz binding docs make no mention of that, so I guess unsupported.

Hope is not lost; the new openHAB feature “profiles” allows you to manipulate data between a channel and an Item. So you can apply a divide-by-100 javascript JS transform in the profile.

1 Like

Hi,
thanks for the quick reply. Will try this today.
Just wondering, it seems to be not a steady issue around the aqara multisensor + conbee users around. Saw different tutorials and forum posts just a few days old, an they don’t have these issues.

Hi rossko57,

yesterday I tried to divide by 100 as follow:
divide_by_100.js file:

(function(i) {
    return parseFloat(i) / 100;
})(input)

.items file:

Number              WoZi_MultiSens_Temp         "Temperatur [JS(divide_by_100.js):%.1f °C]"      <temperature>       (DG_Wohnzimmer, gHeating)                                {channel="deconz:temperaturesensor

On my Sitemap its now displayed as “25.76” but without the Unit “°C”.
Also putting °C behind the [ ] doesn’t work.

In the logs the following Warning ist displayed:

[WARN ] [rest.core.item.EnrichedItemDTOMapper] - Failed transforming the state '2352.0' on item 'WoZi_MultiSens_Temp' with pattern 'JS(divide_by_100.js):%.1f °C': Cannot format state '2352.0' to format '%.1f °C'

I tried different Formatclasses like s, g, a, etc. but nothing worked as expected.
Do you have any hints whats wrong in my code?

Thx for your help!

cheers
Hannes

First, bear in mind that using a transform in the label of your Item only affects the way they are displayed.
The Item state is unaffected, and will still be 2352. You’ll need to remember that if using rules

JS transforms always return a string, “2352.0”
The string won’t format with numeric %.1f
Try

Number WoZi_MultiSens_Temp  "Temperatur [JS(divide_by_100.js):%s °C]"

Just a final note: The wrong temperature calculation has been fixed in the binding a few days after OH 2.4 release (see https://github.com/openhab/openhab2-addons/pull/4406) and in the future the transformation will not be necessary anymore.

Hi @cweitkamp and @rossko57,
long time no see. After the summer pause I started to fix this issue again.

Rossko57’s solution did not work out in the end, I still got no units displayed in the sitemap.

Cweitkamp’s solution worekd out in the end.
Took me a while to figure out how to get the bugfixes (and in the end the milestones) into my system. But now it worked as designed, w/o transformation.

Thanks a lot guys for your support!
cheers
Hannes

PS: For someone who got simmilar issues, take a look at openHab Milestones at the download section at openhab website.

Apparently battery level is not available… Is there a solution for this?

Habve a look here:

I have that .jar file in my addons folder. for aqara door/window sensors it seems to work (temperature is not that exact, but battery level is now updated, so it seems).
Before i added the jar file, the channels for battery level and temperature were created (discovered), but nt updated.
But for the aqara Multisensor, the channels for battery level are not even discovered…

I can investigate on that if you like. But you have to help me with that. Best option will be to get some insight in your REST results. Can you try request your sensor data via deCONZ REST interface and post the relevant sections of your multisensor?

I Will try this next week. In the meantime i also found out that although the deconz tells that one of my sensors was unreachable, the thing appears in openhab as online…

It seems okay now.
What I did:
some time ago I added the jar file with the latest changes as I mentioned. After your message a few days ago, I removed it , and updated openhab. Nothing changed. I restarted openhab, nothing changed.
Today, after a lot of searching after my apikey :wink: , I managed to get that sensor data in json.
I saw in it that battery level was included for every sensor i have. I went back to paperui, and saw … battery level! But, my sensor was OFFLINE according to paperui. I regenerated my sensor data, and it stayed telling me on:true, reachable:true… After disabling my sensor things, and then enabling them, they stay online.
That was a bit strange… From time to time I do an update of my openhab… But I don’t know what changed.
Is there a project page, with the core and addons and their status, and the changes that were made?
As a programmer, at work, i have to document all my changes, put it in JIRA, so everyone can see what’s going on. I didn’t find something like that for openhab.
A page with all addons, issues, what’s fixed, what’s will be fixed, what won’t be fixed…

Anyway, for now, thank you very much for reacting on my message.

around three o’clock, the sensor stopped sending data. Though,phoscon app tells me it’s online and openhab too.
Since I have a mesh wifi and a zigbee hue network, together with de conbee zigbee, I’m first going to do some testing. The two zigbee networks operate on a different channel, but, maybe the channel if de conbee zigbee, is not good… OR, it could just be the cheap aqara sensor that just doesn’t work well.
to be continued…

I added an osram on/off plugin. I guess, the quality of it was not good. Bad connection…
Then, I bought an philips hue on/off plugin , and that is very good. Good connection between conbee stick and the on/off plugin. AND, a good connection to the aqara sensor. It’s now reliable…