It is running now. I got my issue solved with a hint from the Lambda support (write multiple instead of single register). For reference for all, who are seeking to get a Lambda heat pump into thier openhab with text configuration files:
.thing Config
Bridge modbus:tcp:lambda [ host="192.168.xxx.xxx", port=502, id=1 ] {
Bridge poller LA_general [ start=0, length=5, refresh=10000, type="holding" ] {
Thing data temp [ readStart="2", readValueType="int16",readTransform="JS(divide10.js)"]
Thing data temp_av [ readStart="3", readValueType="int16",readTransform="JS(divide10.js)"]
}
Bridge poller LA_EMgr [ start=100, length=5, refresh=10000, type="holding" ] {
Thing data LA_EMgr_Actual_Power [ readStart="102", readValueType="uint16", writeStart="102", writeValueType="int16", writeType="holding",writeMultipleEvenWithSingleRegisterOrCoil="true",writeTransform="default"]
Thing data LA_EMgr_Consumption [ readStart="103", readValueType="int16"]
}
Bridge poller HeatPump [ start=1000, length=15, refresh=10000, type="holding" ] {
Thing data COP [ readStart="1013", readValueType="int16",readTransform="JS(divide10.js)"]
}
Bridge poller Buffer [ start=3000, length=4, refresh=10000, type="holding" ] {
Thing data HiTemp [ readStart="3002", readValueType="int16",readTransform="JS(divide10.js)"]
}
}
.items file
Number HeatPump_Temperature "Außentemperatur [%.1f °C]" <temperature> (gUG) { channel="modbus:data:lambda:LA_general:temp:number" }
Number HeatPump_Temperature_Av "Außentemperatur letzte Stunde [%.1f °C]" <temperature> (gUG) { channel="modbus:data:lambda:LA_general:temp_av:number" }
Number HeatPump_Actual_Power "Actual power [%.0f W]" (gUG) { channel="modbus:data:lambda:LA_EMgr:LA_EMgr_Actual_Power:number" }
Number HeatPump_Consumption "Wärmepumpe Verbrauch [%.1f W]" (gUG) { channel="modbus:data:lambda:LA_EMgr:LA_EMgr_Consumption:number" }
Number HeatPump_COP "Wärmepumpe COP [%.1f]" (gUG) { channel="modbus:data:lambda:HeatPump:COP:number" }
Number HeatPump_Buffer "Pufferspeicher [%.1f °C]" <temperature> (gUG) { channel="modbus:data:lambda:Buffer:HiTemp:number" }
.rules
rule "Adjust LA_EMgr_Actual_Power based on Solar and Power conditions"
when
Item Solar_Spot changed or
System started
then
// Check if Solar_Spot > 500 --> wenn mehr als 500 W produziert werden
if (Solar_Spot.state > 500) {
// Check if Power_Feedin_delta > 500
if (Power_Feedin_delta.state > 500) { //wenn seit 5 min kein Strombezug und Einspeisung >800 W
// Calculate the negative value of Power_Feedin_delta
val negativeFeedinDelta = -((Power_Feedin_delta.state as Number).intValue)
// Send the negative value to LA_EMgr_Actual_Power
HeatPump_Actual_Power.sendCommand(negativeFeedinDelta)
}
else{
HeatPump_Actual_Power.sendCommand(0)
}
}
else{
HeatPump_Actual_Power.sendCommand(0)
}
end
divide10.js
(function(inputData) {
// on read: the polled number as string
// on write: openHAB command as string
var DIVIDE_BY = 10;
return parseFloat(inputData) / DIVIDE_BY;
})(input)