Openhab-addons: [enocean] A5-20-30 not scaling correctly.

Created on 24 Oct 2019  路  4Comments  路  Source: openhab/openhab-addons

I am using an STM3xy temperature sensor which is configured to the A5-02-30 profile. Looking at the data in openhab the scaling seems to be off.

Expected Behavior

Temperature should be displayed correctly (~20掳)

Current Behavior

grafik

Possible Solution

Looking at the code, it seems to be that A5-20-30.java profile needs to overwrite getUnscaledMin and getUnscaledMax otherwise it uses the one from the base class which goes from 255-0 and not 1024-0

protected double getUnscaledMin() {
        return 255;
    }

    protected double getUnscaledMax() {
        return 0;
    }

should be inside A5-20-30 as

@override
protected double getUnscaledMin() {
        return 1023;
    }

@override
    protected double getUnscaledMax() {
        return 0;
    }

Steps to Reproduce (for Bugs)

Learn in a a5-02-30 sensor and see the wrong temperature

Context

Your Environment

bug

All 4 comments

Hey @tobiwan88, it seems you are right. Let me just correct two typos :-D
-> You are talking about EEP A5-02-30
-> getUnscaledMin() should return 1023
Furthermore, EEP A5-02-20 seems to be also wrong.

As you already dived into the code, do you want to make a PR?

Ups, yes you are right.

I did not have time yet to prepare the Java Development environment + Toolchains on my PC at home to make the changes and test them before making a PR.
It is on my personal TODO list for the weekend to get the environment ready. Afterwards I could make the PR after i got everything running and making a fast test with the sensor.

Should not this issue be closed after merge of #6363?

yep.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

pfink picture pfink  路  4Comments

mattnl picture mattnl  路  7Comments

smyrman picture smyrman  路  4Comments

DanielMalmgren picture DanielMalmgren  路  5Comments

mjcumming picture mjcumming  路  5Comments