How to write modbus holding register (PV and heatpump)

Hi,

i want to write to a modbus tcp heatpump if my PV has enough Watt to start heating.

Reading out the Modbus Registers works but i want to make sure that im writing into the right registers because the heatpump isnt cheap :stuck_out_tongue:

How can i write into register for example:
117 = true or 1
125 = 900 Watt?

My things look like:
Write commands are outlined at the moment.

//Heliotherm Wärmepumpe 

Bridge modbus:tcp:Waermepumpe "Wärmepume" @ "Technikraum" [ 
    host="192.168.178.33",  
    port=502, 
    id=1
] { 
      
    //Input register // Read // 16 or 32 bits per register  
    //Read registers. Reading 37 registers, with index 10-60.
    Bridge poller Waermepumpe [ 
        start=10,
        length=60, 
        refresh=6000, 
        type="input" 
    ] {
        Thing data input10 "Wärmepume" @ "Technikraum"  [ readStart="10", readValueType="int16", readTransform="JS(divide10.js)"]
        Thing data input11 "Wärmepume" @ "Technikraum"  [ readStart="11", readValueType="int16", readTransform="JS(divide10.js)"]
        Thing data input12 "Wärmepume" @ "Technikraum"  [ readStart="12", readValueType="int16", readTransform="JS(divide10.js)"]
        Thing data input13 "Wärmepume" @ "Technikraum"  [ readStart="13", readValueType="int16", readTransform="JS(divide10.js)"]
        Thing data input14 "Wärmepume" @ "Technikraum"  [ readStart="14", readValueType="int16", readTransform="JS(divide10.js)"]
        Thing data input15 "Wärmepume" @ "Technikraum"  [ readStart="15", readValueType="int16", readTransform="JS(divide10.js)"]
        Thing data input16 "Wärmepume" @ "Technikraum"  [ readStart="16", readValueType="int16", readTransform="JS(divide10.js)"]
        Thing data input17 "Wärmepume" @ "Technikraum"  [ readStart="17", readValueType="int16", readTransform="JS(divide10.js)"]
        Thing data input18 "Wärmepume" @ "Technikraum"  [ readStart="18", readValueType="int16", readTransform="JS(divide10.js)"]
        Thing data input19 "Wärmepume" @ "Technikraum"  [ readStart="19", readValueType="int16", readTransform="JS(divide10.js)"]
        Thing data input20 "Wärmepume" @ "Technikraum"  [ readStart="20", readValueType="int16", readTransform="JS(divide10.js)"]
        Thing data input21 "Wärmepume" @ "Technikraum"  [ readStart="21", readValueType="int16", readTransform="JS(divide10.js)"]
        Thing data input22 "Wärmepume" @ "Technikraum"  [ readStart="22", readValueType="int16", readTransform="JS(divide10.js)"]
        Thing data input23 "Wärmepume" @ "Technikraum"  [ readStart="23", readValueType="int16"]        
        Thing data input24 "Wärmepume" @ "Technikraum"  [ readStart="24", readValueType="int16"]
        Thing data input25 "Wärmepume" @ "Technikraum"  [ readStart="25", readValueType="int16"]
        Thing data input26 "Wärmepume" @ "Technikraum"  [ readStart="26", readValueType="int16"]
        Thing data input27 "Wärmepume" @ "Technikraum"  [ readStart="27", readValueType="int16"]
        Thing data input28 "Wärmepume" @ "Technikraum"  [ readStart="28", readValueType="int16", readTransform="JS(divide10.js)"]
        Thing data input29 "Wärmepume" @ "Technikraum"  [ readStart="29", readValueType="int16"]
        Thing data input30 "Wärmepume" @ "Technikraum"  [ readStart="30", readValueType="int16", readTransform="JS(divide10.js)"]
        Thing data input31 "Wärmepume" @ "Technikraum"  [ readStart="31", readValueType="int16", readTransform="JS(divide10.js)"]
        Thing data input32 "Wärmepume" @ "Technikraum"  [ readStart="32", readValueType="int16"]
        Thing data input33 "Wärmepume" @ "Technikraum"  [ readStart="33", readValueType="int16", readTransform="JS(divide10.js)"]
        Thing data input34 "Wärmepume" @ "Technikraum"  [ readStart="34", readValueType="int16", readTransform="JS(divide10.js)"]
        Thing data input35 "Wärmepume" @ "Technikraum"  [ readStart="35", readValueType="int16", readTransform="JS(divide10.js)"]
        Thing data input36 "Wärmepume" @ "Technikraum"  [ readStart="36", readValueType="int16", readTransform="JS(divide10.js)"]
        Thing data input37 "Wärmepume" @ "Technikraum"  [ readStart="37", readValueType="int16"]
        Thing data input38 "Wärmepume" @ "Technikraum"  [ readStart="38", readValueType="int16"]
        Thing data input39 "Wärmepume" @ "Technikraum"  [ readStart="39", readValueType="int16"]
        Thing data input40 "Wärmepume" @ "Technikraum"  [ readStart="40", readValueType="int16"]
        Thing data input41 "Wärmepume" @ "Technikraum"  [ readStart="41", readValueType="int16"]

        Thing data input42 "Wärmepume" @ "Technikraum"  [ readStart="42", readValueType="uint32"]
        Thing data input43 "Wärmepume" @ "Technikraum"  [ readStart="43", readValueType="uint32"]
        Thing data input44 "Wärmepume" @ "Technikraum"  [ readStart="44", readValueType="uint32"]
        Thing data input45 "Wärmepume" @ "Technikraum"  [ readStart="45", readValueType="uint32"]
        Thing data input60 "Wärmepume" @ "Technikraum"  [ readStart="60", readValueType="uint32", readTransform="JS(divide1000.js)"]
        /*
        Thing data input61 "Wärmepume" @ "Technikraum"  [ readStart="61", readValueType="uint32"]
        Thing data input62 "Wärmepume" @ "Technikraum"  [ readStart="62", readValueType="uint32"]
        Thing data input63 "Wärmepume" @ "Technikraum"  [ readStart="63", readValueType="uint32"]
        Thing data input64 "Wärmepume" @ "Technikraum"  [ readStart="64", readValueType="uint32"]
        Thing data input65 "Wärmepume" @ "Technikraum"  [ readStart="65", readValueType="uint32"]
        Thing data input66 "Wärmepume" @ "Technikraum"  [ readStart="66", readValueType="uint32"]
        Thing data input67 "Wärmepume" @ "Technikraum"  [ readStart="67", readValueType="uint32"]
        Thing data input68 "Wärmepume" @ "Technikraum"  [ readStart="68", readValueType="uint32"]
        Thing data input69 "Wärmepume" @ "Technikraum"  [ readStart="69", readValueType="uint32"]
        Thing data input70 "Wärmepume" @ "Technikraum"  [ readStart="70", readValueType="uint32"]
        Thing data input71 "Wärmepume" @ "Technikraum"  [ readStart="71", readValueType="uint32"]
        Thing data input72 "Wärmepume" @ "Technikraum"  [ readStart="72", readValueType="uint32"]
        Thing data input73 "Wärmepume" @ "Technikraum"  [ readStart="73", readValueType="uint32"]
        Thing data input74 "Wärmepume" @ "Technikraum"  [ readStart="74", readValueType="uint32"]
        Thing data input75 "Wärmepume" @ "Technikraum"  [ readStart="75", readValueType="uint32"]
        */

        }

    
    //Holding register // Read-write // 16 bits per register  
    //Read-write for holding registers. Reading 1 registers, with index 100-.
    Bridge poller Waermepumpe_RW [ 
        start=100,
        length=25, 
        refresh=60000, 
        type="holding" 
    ] {
        
            // Betriebsart 0 = Aus 1 = Auto 2 = K√ľhl. 3 = Sommer 4 = Dauer. 5 = Absenk. 6 = Urlaub 7 = Party 8 = Ausheizen 9 = EVU Sperre 10 = Hauptschalter aus
            Thing data holding100 "Wärmepume_RW" @ "Technikraum"  [ readStart="100", readValueType="uint16"/*, writeStart="100", writeValueType="uint16", writeType="holding"*/ ]
            
            // 101 03, 06, 16 INT16 HKR Soll_Raum (Raumsolltemperatur) Einheit in 0,1¬įC 
            Thing data holding101 "Wärmepume_RW" @ "Technikraum"  [ readStart="101", readValueType="int16",readTransform="JS(divide10.js)"/*, writeStart="101", writeValueType="int16", writeType="holding", writeTransform="JS(multiply10.js)" */ ]
            
            // HKR Soll (Raumsolltemperatur) Einheit in 0,1¬įC 
            Thing data holding102 "Wärmepume_RW" @ "Technikraum"  [ readStart="102", readValueType="int16",readTransform="JS(divide10.js)"/*, writeStart="102", writeValueType="int16", writeType="holding", writeTransform="JS(multiply10.js)" */]
            
            // HKR Soll (Raumsolltemperatur) aktiv 0 oder 1 
            Thing data holding103 "Wärmepume_RW" @ "Technikraum"  [ readStart="103", readValueType="uint16"/*, writeStart="103", writeValueType="uint16", writeType="holding" */]
            
            // RLT min Kuehlen Einheit 0,1¬įC 
            Thing data holding104 "Wärmepume_RW" @ "Technikraum"  [ readStart="104", readValueType="int16",readTransform="JS(divide10.js)"/*, writeStart="104", writeValueType="int16", writeType="holding", writeTransform="JS(multiply10.js)" */]
            
            // WW Normaltemp. Einheit 0,1¬įC 
            Thing data holding105 "Wärmepume_RW" @ "Technikraum"  [ readStart="105", readValueType="int16",readTransform="JS(divide10.js)"/*, writeStart="105", writeValueType="int16", writeType="holding", writeTransform="JS(multiply10.js)" */]
            
            // WW Minimaltemp. Einheit 0,1¬įC 
            Thing data holding106 "Wärmepume_RW" @ "Technikraum"  [ readStart="106", readValueType="int16",readTransform="JS(divide10.js)"/*, writeStart="106", writeValueType="int16", writeType="holding", writeTransform="JS(multiply10.js)" */]
            
            // MKR1 Betriebsart Siehe Reg. 100 
            Thing data holding107 "Wärmepume_RW" @ "Technikraum"  [ readStart="107", readValueType="uint16"/*, writeStart="107", writeValueType="uint16", writeType="holding" */]

            // MKR1 Soll_Raum Einheit in 0,1¬įC 
            Thing data holding108 "Wärmepume_RW" @ "Technikraum"  [ readStart="108", readValueType="int16",readTransform="JS(divide10.js)"/*, writeStart="108", writeValueType="int16", writeType="holding", writeTransform="JS(multiply10.js)" */]
            
            // MKR1 Soll Einheit in 0,1¬įC 
            Thing data holding109 "Wärmepume_RW" @ "Technikraum"  [ readStart="109", readValueType="int16",readTransform="JS(divide10.js)"/*, writeStart="109", writeValueType="int16", writeType="holding", writeTransform="JS(multiply10.js)" */]
            
            // MKR1 Soll aktiv 0 oder 1 
            Thing data holding110 "Wärmepume_RW" @ "Technikraum"  [ readStart="110", readValueType="uint16"/*, writeStart="110", writeValueType="uint16", writeType="holding" */]
            
            // MKR1 Kuehlen RLT min. Einheit in 0,1¬įC 
            Thing data holding111 "Wärmepume_RW" @ "Technikraum"  [ readStart="111", readValueType="int16",readTransform="JS(divide10.js)"/*, writeStart="111", writeValueType="int16", writeType="holding", writeTransform="JS(multiply10.js)" */]
            
            // MKR2 Betriebsart Siehe Reg.100 
            Thing data holding112 "Wärmepume_RW" @ "Technikraum"  [ readStart="112", readValueType="uint16"/*, writeStart="112", writeValueType="uint16", writeType="holding" */]
            
            // MKR2 Soll_Raum Einheit in 0,1¬įC 
            Thing data holding113 "Wärmepume_RW" @ "Technikraum"  [ readStart="113", readValueType="int16",readTransform="JS(divide10.js)"/*, writeStart="113", writeValueType="int16", writeType="holding", writeTransform="JS(multiply10.js)" */]
            
            // MKR Soll Einheit in 0,1¬įC 
            Thing data holding114 "Wärmepume_RW" @ "Technikraum"  [ readStart="114", readValueType="int16",readTransform="JS(divide10.js)"/*, writeStart="114", writeValueType="int16", writeType="holding", writeTransform="JS(multiply10.js)" */]
            
            // MKR2 Soll aktiv 0 oder 1 
            Thing data holding115 "Wärmepume_RW" @ "Technikraum"  [ readStart="115", readValueType="uint16"/*, writeStart="115", writeValueType="uint16", writeType="holding" */]
            
            // MKR2 Kuehlen RLT min. Einheit in 0,1¬įC 
            Thing data holding116 "Wärmepume_RW" @ "Technikraum"  [ readStart="116", readValueType="int16",readTransform="JS(divide10.js)"/*, writeStart="116", writeValueType="int16", writeType="holding", writeTransform="JS(multiply10.js)" */]
            
            // PV Anf. 0 oder 1 (*1) 
            Thing data holding117 "Wärmepume_RW" @ "Technikraum"  [ readStart="117", readValueType="uint16", writeStart="117", writeValueType="uint16", writeType="holding"]
            
            // Leistungsaufnahmevorgabe Einheit in W (*2) 
            Thing data holding125 "Wärmepume_RW" @ "Technikraum"  [ readStart="125", readValueType="uint16", writeStart="125", writeValueType="uint16", writeType="holding"]
            
            // Verdichterdrehzahlvorgabe Einheit in ‚Äį(*3), (*4) 
            Thing data holding126 "Wärmepume_RW" @ "Technikraum"  [ readStart="126", readValueType="int16",readTransform="JS(divide10.js)"/*, writeStart="126", writeValueType="int16", writeType="holding", writeTransform="JS(multiply10.js)" */]  // 126 darf nicht beschrieben werden
            
            // Ext. Anf 0 oder 1 
            Thing data holding127 "Wärmepume_RW" @ "Technikraum"  [ readStart="127", readValueType="uint16"/*, writeStart="127", writeValueType="uint16", writeType="holding" */]
            
            // Entstoeren 0 oder 1 
            Thing data holding128 "Wärmepume_RW" @ "Technikraum"  [ readStart="128", readValueType="uint16"/*, writeStart="128", writeValueType="uint16", writeType="holding" */]
            
            // Aussentemperatur Wert Einheit in 0,1¬įC
            Thing data holding129 "Wärmepume_RW" @ "Technikraum"  [ readStart="129", readValueType="int16",readTransform="JS(divide10.js)"/*, writeStart="129", writeValueType="int16", writeType="holding", writeTransform="JS(multiply10.js)" */]
            
            //Aussentemperatur aktiv 0 oder 1 
            Thing data holding130 "Wärmepume_RW" @ "Technikraum"  [ readStart="130", readValueType="uint16"/*, writeStart="130", writeValueType="uint16", writeType="holding" */]
            //Thing data holding131 "Wärmepume_RW" @ "Technikraum"  [ readStart="131", readValueType="int16",readTransform="JS(divide10.js)"/*, writeStart="131", writeValueType="int16", writeType="holding", writeTransform="JS(multiply10.js)" */]
            //Thing data holding132 "Wärmepume_RW" @ "Technikraum"  [ readStart="132", readValueType="uint16"/*, writeStart="132", writeValueType="uint16", writeType="holding" */]
            //Thing data holding133 "Wärmepume_RW" @ "Technikraum"  [ readStart="133", readValueType="int16",readTransform="JS(divide10.js)"/*, writeStart="133", writeValueType="int16", writeType="holding", writeTransform="JS(multiply10.js)" */]
            //Thing data holding134 "Wärmepume_RW" @ "Technikraum"  [ readStart="134", readValueType="uint16"/*, writeStart="134", writeValueType="uint", writeType="holding" */]
            
        }
    
} 

Group gWp "Waermepumpe" // Wärmepumpe

Number      Modbus_Waermepumpe_Temp_aussen    "Aussentemperatur [%.1f ¬įC]"  (gWp) { channel="modbus:data:Waermepumpe:Waermepumpe:input10:number" }
Number      Modbus_Waermepumpe_Temp_Brauchwasser "Brauchwassertemperatur [%.1f ¬įC]"  (gWp) { channel="modbus:data:Waermepumpe:Waermepumpe:input11:number" }
Number      Modbus_Waermepumpe_Temp_Vorlauf "Vorlauftemperatur [%.1f ¬įC]"  (gWp) { channel="modbus:data:Waermepumpe:Waermepumpe:input12:number" }
Number      Modbus_Waermepumpe_Temp_Ruecklauf "Ruecklauftemperatur [%.1f ¬įC]"  (gWp) { channel="modbus:data:Waermepumpe:Waermepumpe:input13:number" }
//Number      Modbus_Waermepumpe_Temp_Pufferspeicher "Pufferspeichertemperatur [%.1f ¬įC]"  (gWp) { channel="modbus:data:Waermepumpe:Waermepumpe:input14:number" }
Number      Modbus_Waermepumpe_EQ_Eintritt "EQ Eintritttemperatur [%.1f ¬įC]"  (gWp) { channel="modbus:data:Waermepumpe:Waermepumpe:input15:number" }
Number      Modbus_Waermepumpe_EQ_Austritt "EQ Austritttemperatur [%.1f ¬įC]"  (gWp) { channel="modbus:data:Waermepumpe:Waermepumpe:input16:number" }
Number      Modbus_Waermepumpe_Sauggas "Sauggastemperatur [%.1f ¬įC]"  (gWp) { channel="modbus:data:Waermepumpe:Waermepumpe:input17:number" }
Number      Modbus_Waermepumpe_Verdampfung "Verdampfertemperatur [%.1f ¬įC]"  (gWp) { channel="modbus:data:Waermepumpe:Waermepumpe:input18:number" }
Number      Modbus_Waermepumpe_Kondensation "Kondensationtemperatur [%.1f ¬įC]"  (gWp) { channel="modbus:data:Waermepumpe:Waermepumpe:input19:number" }
Number      Modbus_Waermepumpe_Heissgas "Heissgastemperatur [%.1f ¬įC]"  (gWp) { channel="modbus:data:Waermepumpe:Waermepumpe:input20:number" }
Number      Modbus_Waermepumpe_Niederdruck "Niederdruck [%.1f bar]"  (gWp) { channel="modbus:data:Waermepumpe:Waermepumpe:input21:number" }
Number      Modbus_Waermepumpe_Hochdruck "Hochdruck [%.1f bar]"  (gWp) { channel="modbus:data:Waermepumpe:Waermepumpe:input22:number" }
Number      Modbus_Waermepumpe_Heizkreispumpe "Heizkreispumpe [%d]"  (gWp) { channel="modbus:data:Waermepumpe:Waermepumpe:input23:number" }
Number      Modbus_Waermepumpe_Pufferladepumpe "Pufferladepumpe [%d]"  (gWp) { channel="modbus:data:Waermepumpe:Waermepumpe:input24:number" }
Number      Modbus_Waermepumpe_Verdichter "Verdichter [%d]"  (gWp) { channel="modbus:data:Waermepumpe:Waermepumpe:input25:number" }
Number      Modbus_Waermepumpe_Stoerung "Stoerung [%d]"  (gWp) { channel="modbus:data:Waermepumpe:Waermepumpe:input26:number" }
Number      Modbus_Waermepumpe_Vierwegeventil_Luft "Vierwegeventil Luft [%d]"  (gWp) { channel="modbus:data:Waermepumpe:Waermepumpe:input27:number" }
Number      Modbus_Waermepumpe_WMZ_Durchfluss "WMZ Durchfluss [%.1f l/min]"  (gWp) { channel="modbus:data:Waermepumpe:Waermepumpe:input28:number" }
Number      Modbus_Waermepumpe_nSoll_Verdichter "n-Soll Verdichter [%d %%]"  (gWp) { channel="modbus:data:Waermepumpe:Waermepumpe:input29:number" }
Number      Modbus_Waermepumpe_COP "COP [%d]"  (gWp) { channel="modbus:data:Waermepumpe:Waermepumpe:input30:number" }
Number      Modbus_Waermepumpe_Frischwasser "Frischwassertemperatur [%.1f ¬įC]"  (gWp) { channel="modbus:data:Waermepumpe:Waermepumpe:input31:number" }
Number      Modbus_Waermepumpe_EVU_Sperre "EVU Sperre [%d]"  (gWp) { channel="modbus:data:Waermepumpe:Waermepumpe:input32:number" }
Number      Modbus_Waermepumpe_Temp_aussen_verz    "Aussentemperatur verz√∂gert [%.1f ¬įC]"  (gWp) { channel="modbus:data:Waermepumpe:Waermepumpe:input33:number" }
Number      Modbus_Waermepumpe_HKR_Solltemp    "Heizkreis Solltemperatur [%.1f ¬įC]"  (gWp) { channel="modbus:data:Waermepumpe:Waermepumpe:input34:number" }
Number      Modbus_Waermepumpe_MKR1_Solltemp    "MKR1 Solltemperatur [%.1f ¬įC]"  (gWp) { channel="modbus:data:Waermepumpe:Waermepumpe:input35:number" }
Number      Modbus_Waermepumpe_MKR2_Solltemp    "MKR2 Solltemperatur [%.1f ¬įC]"  (gWp) { channel="modbus:data:Waermepumpe:Waermepumpe:input36:number" }
Number      Modbus_Waermepumpe_EQ_Ventilator    "EQ-Ventilator [%d]"  (gWp) { channel="modbus:data:Waermepumpe:Waermepumpe:input37:number" }
Number      Modbus_Waermepumpe_WW_Vorrang    "WW-Vorrang [%.1f ¬įC]"  (gWp) { channel="modbus:data:Waermepumpe:Waermepumpe:input38:number" }
Number      Modbus_Waermepumpe_Kuehlen_UMV_passiv    "Kuehlen UMV passiv [%d]"  (gWp) { channel="modbus:data:Waermepumpe:Waermepumpe:input39:number" }
Number      Modbus_Waermepumpe_Expansionsventil    "Expansionsventil [%d %%]"  (gWp) { channel="modbus:data:Waermepumpe:Waermepumpe:input40:number" }
Number      Modbus_Waermepumpe_Verdichteranforderung    "Verdichteranforderung [%d]"  (gWp) { channel="modbus:data:Waermepumpe:Waermepumpe:input41:number" }

Number      Modbus_Waermepumpe_BetriebsstundenWW1    "Betriebsstunden im WW-Betrieb1 [%s h]"  (gWp) { channel="modbus:data:Waermepumpe:Waermepumpe:input42:number" }
//Number      Modbus_Waermepumpe_BetriebsstundenWW2    "Betriebsstunden im WW-Betrieb2 [%d h]"  (gWp) { channel="modbus:data:Waermepumpe:Waermepumpe:input43:number" }

Number      Modbus_Waermepumpe_BetriebsstundenHZG1    "Betriebsstunden im HZG-Betrtieb1 [%s h]"  (gWp) { channel="modbus:data:Waermepumpe:Waermepumpe:input44:number" }
//Number      Modbus_Waermepumpe_BetriebsstundenHZG2    "Betriebsstunden im HZG-Betrtieb2 [%d h]"  (gWp) { channel="modbus:data:Waermepumpe:Waermepumpe:input45:number" }

//Number      Modbus_Waermepumpe_WMZ_Heizung    "WMZ Heizung [%d kW/h]"  (gWp) { channel="modbus:data:Waermepumpe:Waermepumpe:input60:number" }
//Number      Modbus_Waermepumpe_Stromz_Heizung    "Stromzaehler Heizung [%d kW/h]"  (gWp) { channel="modbus:data:Waermepumpe:Waermepumpe:input41:number" }


//Read/Write


Number      Modbus_Waermepumpe_Betriebsart    "Betriebsart [%d]"  (gWp) { channel="modbus:data:Waermepumpe:Waermepumpe_RW:holding100:number" }
Number      Modbus_Waermepumpe_HKR_SOLL_RAUM    "Raumsolltemperatur [%.1f ¬įC]"  (gWp) { channel="modbus:data:Waermepumpe:Waermepumpe_RW:holding101:number" }
Number      Modbus_Waermepumpe_HKR_SOLL_    "HKR Solltemperatur [%.1f ¬įC]"  (gWp) { channel="modbus:data:Waermepumpe:Waermepumpe_RW:holding102:number" }
Number      Modbus_Waermepumpe_HKR_SOLL_aktiv    "HKR Solltemperatur aktiv [%d]"  (gWp) { channel="modbus:data:Waermepumpe:Waermepumpe_RW:holding103:number" }
Number      Modbus_Waermepumpe_RLT_Kuehlen    "RLT min Kuehlen [%.1f ¬įC]"  (gWp) { channel="modbus:data:Waermepumpe:Waermepumpe_RW:holding104:number" }
Number      Modbus_Waermepumpe_WW_Normaltemp    "WW Normaltemperatur [%.1f ¬įC]"  (gWp) { channel="modbus:data:Waermepumpe:Waermepumpe_RW:holding105:number" }
Number      Modbus_Waermepumpe_WW_Minimaltemp    "WW Minimaltemperatur [%.1f ¬įC]"  (gWp) { channel="modbus:data:Waermepumpe:Waermepumpe_RW:holding106:number" }
Number      Modbus_Waermepumpe_MKR1_Betriebsart    "MKR1 Betriebsart [%d]"  (gWp) { channel="modbus:data:Waermepumpe:Waermepumpe_RW:holding107:number" }
Number      Modbus_Waermepumpe_MKR1_SOLL_RAUM    "MKR1 Raumsolltemperatur [%.1f ¬įC]"  (gWp) { channel="modbus:data:Waermepumpe:Waermepumpe_RW:holding108:number" }
Number      Modbus_Waermepumpe_MKR1_SOLL_    "MKR1 Solltemperatur [%.1f ¬įC]"  (gWp) { channel="modbus:data:Waermepumpe:Waermepumpe_RW:holding109:number" }
Number      Modbus_Waermepumpe_MKR1_SOLL_aktiv    "MKR1 Solltemperatur aktiv [%d]"  (gWp) { channel="modbus:data:Waermepumpe:Waermepumpe_RW:holding110:number" }
Number      Modbus_Waermepumpe_MKR1_RLT_Kuehlen    "MKR1 RLT min Kuehlen [%.1f ¬įC]"  (gWp) { channel="modbus:data:Waermepumpe:Waermepumpe_RW:holding111:number" }
Number      Modbus_Waermepumpe_MKR2_Betriebsart    "MKR2 Betriebsart [%d]"  (gWp) { channel="modbus:data:Waermepumpe:Waermepumpe_RW:holding112:number" }
Number      Modbus_Waermepumpe_MKR2_SOLL_RAUM    "MKR2 Raumsolltemperatur [%.1f ¬įC]"  (gWp) { channel="modbus:data:Waermepumpe:Waermepumpe_RW:holding113:number" }
Number      Modbus_Waermepumpe_MKR2_SOLL_    "MKR2 Solltemperatur [%.1f ¬įC]"  (gWp) { channel="modbus:data:Waermepumpe:Waermepumpe_RW:holding114:number" }
Number      Modbus_Waermepumpe_MKR2_SOLL_aktiv    "MKR2 Solltemperatur aktiv [%d]"  (gWp) { channel="modbus:data:Waermepumpe:Waermepumpe_RW:holding115:number" }
Number      Modbus_Waermepumpe_MKR2_RLT_Kuehlen    "MKR2 RLT min Kuehlen [%.1f ¬įC]"  (gWp) { channel="modbus:data:Waermepumpe:Waermepumpe_RW:holding116:number" }
Number      Modbus_Waermepumpe_PV_Anf    "PV Anforderung [%d]"  (gWp) { channel="modbus:data:Waermepumpe:Waermepumpe_RW:holding117:number" }
Number      Modbus_Waermepumpe_Leistungsaufnahmevorgabe    "Leistungsaufnahmevorgabe [%.1f W]"  (gWp) { channel="modbus:data:Waermepumpe:Waermepumpe_RW:holding125:number" }
Number      Modbus_Waermepumpe_Verdichterdrehzahlvorgabe    "Verdichterdrehzahlvorgabe [%d %%]"  (gWp) { channel="modbus:data:Waermepumpe:Waermepumpe_RW:holding126:number" }
Number      Modbus_Waermepumpe_Ext_Anf    "Ext. Anforderung [%d]"  (gWp) { channel="modbus:data:Waermepumpe:Waermepumpe_RW:holding127:number" }
Number      Modbus_Waermepumpe_Entstoeren    "Entstoeren [%d]"  (gWp) { channel="modbus:data:Waermepumpe:Waermepumpe_RW:holding128:number" }
Number      Modbus_Waermepumpe_Aussentemperatur    "Aussentemperatur [%.1f ¬įC]"  (gWp) { channel="modbus:data:Waermepumpe:Waermepumpe_RW:holding129:number" }
Number      Modbus_Waermepumpe_Aussentemperatur_aktiv    "Aussentemperatur aktiv [%d]"  (gWp) { channel="modbus:data:Waermepumpe:Waermepumpe_RW:holding130:number" }
//Number      Modbus_Waermepumpe_Puffertemperatur    "Puffertemperatur [%.1f ¬įC]"  (gWp) { channel="modbus:data:Waermepumpe:Waermepumpe_RW:holding131:number" }
//Number      Modbus_Waermepumpe_Puffertemperatur_aktiv    "Puffertemperatur aktiv [%d]"  (gWp) { channel="modbus:data:Waermepumpe:Waermepumpe_RW:holding132:number" }
//Number      Modbus_Waermepumpe_Brauchwassertemperatur    "Brauchwassertemperatur [%.1f ¬įC]"  (gWp) { channel="modbus:data:Waermepumpe:Waermepumpe_RW:holding133:number" }
//Number      Modbus_Waermepumpe_Brauchwassertemperatur_aktiv    "Brauchwassertemperatur aktiv [%d]"  (gWp) { channel="modbus:data:Waermepumpe:Waermepumpe_RW:holding134:number" }


// Switch WP_PV_Anforderung "Manuelle WP PV Anforderung" (gWp)

Thanks and BR

You can‚Äôt write ‚Äútrue‚ÄĚ. Modbus deals in numbers.
You can‚Äôt write ‚Äú800 Watt‚ÄĚ. Modbus does not understand units.
Better find out exactly what you need to write?

In general, to write to a modbus register, set up a data Thing with write parameters, link it to an Item, send the Item a command.

Thing data holding117 "Wärmepume_RW" @ "Technikraum"  [ readStart="117", readValueType="uint16", writeStart="117", writeValueType="uint16", writeType="holding"]

Looks promising.

Number      Modbus_Waermepumpe_PV_Anf    "PV Anforderung [%d]"  (gWp) { channel="modbus:data:Waermepumpe:Waermepumpe_RW:holding117:number" }

So
Modbus_Waermepumpe_PV_Anf.sendCommand(1)

If that is just an on/off, true/false function, you could set it up as a witch type instead.

Thanks for the help.

Ive created an dummy switch for the sitemap and a rule which checks the dummy switch but nothing happens

Switch Switch_WP_Betriebsart "Betriebsart"
rule "WP PV Anforderung AN"
when 
  Item Switch_WP_Betriebsart changed from OFF to ON
  then 
    //if (Tag_Nacht.state==ON  && (now.getHourOfDay() >= 16 && now.getHourOfDay() <= 20 ))
    {
      Modbus_Waermepumpe_PV_Anf.sendCommand(1)
    }
end
Switch		item=Switch_WP_Betriebsart

Log from changing ‚Äúon‚ÄĚ to ‚Äúoff‚ÄĚ triggered by the switch:

2022-03-07 09:56:06.983 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'Switch_WP_Betriebsart' received command OFF
2022-03-07 09:56:06.988 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Switch_WP_Betriebsart' changed from ON to OFF
2022-03-07 09:56:06.994 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'Modbus_Waermepumpe_PV_Anf' received command 0
2022-03-07 09:56:06.996 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item 'Modbus_Waermepumpe_PV_Anf' predicted to become 0

You tried it with your original number before changing everything, how did that go?

I’m not sure what you are about there. You don’t need rules to deal with switches. If you command ON or OFF to a modbus channel, it will automatically send 1 or 0.

I want to find out if i can write to my Heating Pump in a safe way. Therefore ill try only to change the operating mode to on or off in my example.

The switch shows me the Operating mode ‚Äú1‚ÄĚ but if i want to switch it to ‚Äúoff‚ÄĚ by the switch nothing happens and the switch stays on ‚Äú1‚ÄĚ. Log shows nothing.

If you are frightened of this stuff, then don’t do it. But it is simple underneath, you just have to be precise. Go one step at a time.

I don’t know where you are looking. I don’t know what log shows nothing - you showed us a log earlier. I understand there may be language difficulties, but we can only rely on what you tell us.

As said earlier, this looks promising -

Of course I have no idea if that is the correct register to write to, or correct values, that part depends on you. If you are reading the expected values in other channels, you probably have the right settings.

Alright, so that channel is linked to this number Item. That’s a nuisance to treat as an on-off switch in the GUI, so let’s avoid that.

For testing, you can use the ‚ÄúAPI explorer‚ÄĚ tool in the GUI to send a number command directly to that Item.

or

Don’t mess with numbers, use a switch type to begin with. Your data Thing offers switch type channel, which can be linked to a new switch type Item.

Switch      Modbus_Waermepumpe_PV_Anf_sw    "PV Anforderung [%s]"  (gWp) { channel="modbus:data:Waermepumpe:Waermepumpe_RW:holding117:switch" }

Note different channel here.
When switch commanded ON from GUI, binding will transmit 1

1 Like

Thanks Rossko for helping me.

When I speak from logging i meaning the events.log from Openhab.

So I tried the switch thing but when i turn off or on the switch in the openhab sitemap only the current status is showing but nothing happens, neither in the events.log or showing at the sitemap. The current status remains…

That’s a serious problem. When you click widgets in the GUI, you should get Item commands in your events.log
You showed us a log of command events earlier, what have you changed since then?
So let’s look at that, what can go wrong?

Sure you are looking in the correct log, are there other records? There are two separate logs of most interest, openhab.log and events.log

If you are really using a sitemap (with BasicUI or an app), perhaps you have a typo in the Item name. Then you would see an error about unknown Item in your openhab.log

Perhaps you are using an inappropriate widget with your Item type. It’s no use trying to use a switch type widget with a number type Item, for example - sending ON commands to number will again give an error in your openhab.log

Ok, now i got the error in openhab.log:

2022-03-08 15:18:10.302 [INFO ] [el.core.internal.ModelRepositoryImpl] - Loading model 'heliotherm.items'
2022-03-08 15:18:12.650 [ERROR] [org.influxdb.impl.BatchProcessor    ] - Batch could not be sent. Data will be lost
org.influxdb.InfluxDBException$FieldTypeConflictException: partial write: field type conflict: input field "value" on measurement "Modbus_Waermepumpe_PV_Anf" is type integer, already exists as type float dropped=1
	at org.influxdb.InfluxDBException.buildExceptionFromErrorMessage(InfluxDBException.java:144) ~[bundleFile:?]
	at org.influxdb.InfluxDBException.buildExceptionForErrorState(InfluxDBException.java:173) ~[bundleFile:?]
	at org.influxdb.impl.InfluxDBImpl.execute(InfluxDBImpl.java:827) ~[bundleFile:?]
	at org.influxdb.impl.InfluxDBImpl.write(InfluxDBImpl.java:460) ~[bundleFile:?]
	at org.influxdb.impl.OneShotBatchWriter.write(OneShotBatchWriter.java:22) ~[bundleFile:?]
	at org.influxdb.impl.BatchProcessor.write(BatchProcessor.java:340) [bundleFile:?]
	at org.influxdb.impl.BatchProcessor$1.run(BatchProcessor.java:287) [bundleFile:?]
	at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515) [?:?]
	at java.util.concurrent.FutureTask.run(FutureTask.java:264) [?:?]
	at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:304) [?:?]
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128) [?:?]
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628) [?:?]
	at java.lang.Thread.run(Thread.java:829) [?:?]

This is a message from your Influxdb persistence service.
Have you changed an Item type, i.e. the new type will not fit in the old Influxdb table type?
You’ll need to delete the offending table so Influxdb can recreate it - or change the Item name so that it’s not trying to stuff it in the wrong shape hole.

I changed the number to switch as you mentioned above in the example.

The example given showed creating a new Item with a new name …

From Off to On and then automatically switched back to Off.

events.log

2022-03-08 15:30:42.090 [INFO ] [openhab.event.ItemCommandEvent      ] - Item 'Modbus_Waermepumpe_PV_Anf_sw' received command ON
2022-03-08 15:30:42.094 [INFO ] [penhab.event.ItemStatePredictedEvent] - Item 'Modbus_Waermepumpe_PV_Anf_sw' predicted to become ON
2022-03-08 15:30:42.098 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Modbus_Waermepumpe_PV_Anf_sw' changed from OFF to ON
...
2022-03-08 15:31:37.095 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Modbus_Waermepumpe_PV_Anf_sw' changed from ON to OFF

Yes, it is linked to your Modbus register which is reporting value 00 (interpreted as off) at the next read poll.

What you are interested in is the effect of the ON command, which should be transmitting 0001 over Modbus.
If that is in doubt, get DEBUG info from the binding as described in the docs.

I don’t know if that is the right stuff sent to the right place, that all depends on your device.

Setting up the binding really expects you to know what you want, it is not at all convenient for experimenting.

is easy to solve. But if you are not sure about the 117 or what you are supposed to write to it, experimenting with a third party Modbus tool like Radzio or modbus-poll to establish how your device works is going to go a lot quicker.

Thanks for helping me.
Ive got an openhab.log for the above Switch. For me it looks like it is working but you are right i need to implement step-by-step. First i want to make sure that my write is working then i go on with the whole function. I will describe it soon because its necessary to write 3 register in parallel because of an ‚ÄúPhotovoltaic request‚ÄĚ.

2022-03-09 09:16:29.058 [DEBUG] [rt.modbus.internal.ModbusManagerImpl] - Scheduling one-off write task BasicWriteTask [endpoint=ModbusIPSlaveEndpoint [address=192.168.178.33, port=502], request=ModbusWriteRegisterRequestBlueprint [slaveId=1, reference=117, registers=ModbusRegisterArray(0001), maxTries=3, getFunctionCode()=WRITE_SINGLE_REGISTER], resultCallback=org.openhab.binding.modbus.internal.handler.ModbusDataThingHandler$$Lambda$1365/0x00000001012cb440@394d77cd, failureCallback=org.openhab.binding.modbus.internal.handler.ModbusDataThingHandler$$Lambda$1366/0x00000001012cd040@2c67dc0b]
2022-03-09 09:16:29.061 [DEBUG] [rt.modbus.internal.ModbusManagerImpl] - Will now execute one-off write task BasicWriteTask [endpoint=ModbusIPSlaveEndpoint [address=192.168.178.33, port=502], request=ModbusWriteRegisterRequestBlueprint [slaveId=1, reference=117, registers=ModbusRegisterArray(0001), maxTries=3, getFunctionCode()=WRITE_SINGLE_REGISTER], resultCallback=org.openhab.binding.modbus.internal.handler.ModbusDataThingHandler$$Lambda$1365/0x00000001012cb440@394d77cd, failureCallback=org.openhab.binding.modbus.internal.handler.ModbusDataThingHandler$$Lambda$1366/0x00000001012cd040@2c67dc0b], waited in thread pool for 3
2022-03-09 09:16:29.065 [DEBUG] [ernal.handler.ModbusDataThingHandler] - Successful write, matching request ModbusWriteRegisterRequestBlueprint [slaveId=1, reference=117, registers=ModbusRegisterArray(0001), maxTries=3, getFunctionCode()=WRITE_SINGLE_REGISTER]
2022-03-09 09:16:29.066 [DEBUG] [rt.modbus.internal.ModbusManagerImpl] - Modbus operation ended, timing info: {total: 5 ms, connection: 1, transaction=2, callback=2} [operation ID 9e92060e-9e7a-43cd-a54c-8ccc859b303f]

Well, that looks good from openHAB’s end. Modbus is a hand-shaking protocol, if the remote device did not accept the write, then the binding would tell you about an error.

Does this do what you want at the device?

next step is to set those two registers to the written numbers:

102 = 28
103 = 1

My idea is to set it up by a switch and a rule which send the commands then. Is a timer between the two commands necessary?

As said before, it is far easier to experiment with Modbus using some other tool than openHAB.

No idea, what does your device want?

The binding manages a queue of read/write requests for the bus, you need not worry about that.

1 Like

Thanks for your help. Finally it is working now.