Open splatch opened 2 years ago
If we are wishing things.. From the same point, having a datatype raw
and especially having the datatype string
would be fine. A lot of modbus devices and also devices implementing SunSpec on modbus have datafields that represent a String. In most cases i have seen a 8 register / 16 byte string. Being able to read that would be great.
This issue has been mentioned on openHAB Community. There might be relevant details there:
https://community.openhab.org/t/converting-int16-to-two-characters/146518/5
Currently modbus binding requires mapping of data to specific types such as
int
orfloat
. I would like to propose a way to letmodbus:data
to return a raw byte array (RawType
) via specific channel.I motivate such proposal to better cover situations where values are divided through multiple registers and they require an adjustment after retrieval. Once I managed to do it with ISG energy readings which divided
MWh
andkWh
part into two registers. I ended up reading it as uint64 and adjusting value in a profile. While working on a Wago PLC I found even worse register layout:[value_kwh][status1][gap][value_wh][status2]
. It does not fit into a limit of 8 bytes of data, so I either have to create two items and merge values, or adjust a binding. I prefer to limit amount of items early on so I come with an idea of reading a chunk of byte array into aRawType
to let transformation or profile produce a final value.