RE: Connecting Askoma Askoheat+ using the Modbus binding

Hi Community

Thank you Konfusius for sharing this information. I tried to get the values of the following registers:

> Register	Description			Datatype
> 108		Emergency Mode		1 word / byte / 0 = off, 255 = on	
> 109		status				1 word / uint16
> 110		heaterload			1 word / uint16 / 250-30000 watt
> 325+326	temperature s0		2 words / float32 / floating point °celcius	
> 510		legiotemp			1 word / byte / 50-65
> 612+613	relay1count			2 words / int32 / 0-100.000
> 614+615	relay2count			2 words / int32 / 0-100.000
> 616+617	relay3count			2 words / int32 / 0-100.000
> 618+619	relay4count			2 words / int32 / 0-100.000
> 620+621	relay5count			2 words / int32 / 0-100.000	
> 627		legiostatus			1 word / byte
> 629		legiopasttime		2 words / array[4][5.17] / dd:hh:mm
> 631		Errorstatus			1 word / uint16

I think I understand the data type byte, uint16, int32.
I don’t understand float32 (register 325+326). I get the values 0x41b1 and 0x7a02 which is 16’817 and 31’234 in decimal. How do I calculate the temperature (22.18) from these two values?

{325} MODBUS_EMA_TEMPERATURE_FLOAT_SENSOR0 = 0x41b1 → 22.18
{326} = 0x7a02

Can somebody explain how to get the value of register 628+629 to dd:hh:mm?

{628} MODBUS_VAL_LEGIO_PAST_TIME = 0x000c → 12d 12h 39m
{629} = 0x0c27

Any help would be much appreciated.

BR Thomas

check this

You need to look in the bits of the registers and get the number.
But sometimes the sequence of the bytes can be swapped

After reading more about the modbus binding I figured out how to do it.
Part of the Things file:

    Bridge poller asko_ema "EMA" [ start=325, length=2, refresh=10000, type="input" ]
    {
        Thing data wassertemp "Wassertemperatur" [ readStart="325", readValueType="float32" ]
    }

Part of the Items file:

Number    Wassertemperatur    "Wassertemperatur"      <energy>    {channel="modbus:data:askomatcp:asko_ema:wassertemp:number"}

This works fine.

Register 628 is defined as array according to the Askoma documentation:

But I think the modbus binding does no provide a proper item type.

Register 628 (last legionella protection) needs a transformation. I created this script:

openhabian@openhab3:/etc/openhab/transform $ cat float2date.js
(function(inp) {
    // input: the polled number as float
    // output: string
//  let log = require('openhab').log('my_logger');
//  log.info("f2di in: " + inp);
    var MperH = 60;             // minutes per hour
    var MperD = MperH * 24;     // minutes per day
    inp = inp * 100000000000000000000000000000000000000000;
    inp = MperD * inp;          // total minutes
    inp = Math.round(inp)       // make integer
    var Days = Math.floor(inp / MperD);
    var rest = inp % MperD;
    var Hours = Math.floor(rest / MperH);
    var Minutes = rest % MperH;
    Hours = ("0" + Hours).slice (-2);
    Minutes = ("0" + Minutes).slice (-2);
    var Output = Days + ":" + Hours + ":" + Minutes + " (D:H:M)";
//  log.info("f2d out: " + Output);
    return Output;
})(input)

The transformation script must be added to the thing:

Thing data AskLegio "Heizstab Letzter Legionellenschutz" [ readStart="628", readValueType="float32", readTransform="JS(float2date.js)" ]

And the item is a string type item:

String AskLegio "Heizstab Letzter Legionellenschutz"  {channel="modbus:data:askomatcp:AskInput3:AskLegio:string"}

The sitemap looks like this:

grafik

But for whatever reason it’s not very accurate. This is shown by the Askome web UI:

grafik

But I think it’s accurate enough.

Good luck
Reinhold