ioBroker Tutorial-Reihe - Alfen-Wallbox per Modbus integrieren

Mit ** gekennzeichnete Links auf dieser Seite sind Affiliatelinks.

ioBroker Tutorial-Reihe - Alfen-Wallbox per Modbus integrieren
ioBroker Tutorial-Reihe - Alfen-Wallbox per Modbus integrieren
  • 21.10.2020
  • Level 1
  • Integration
  • Blockly
  • Hardware

Nachdem wir nun elektrisch fahren, musste natürlich auch eine integrierbare Lade-Lösung her. Nach etwas Recherche habe ich mich für die Alfen Single Pro-Line entschieden. Diese kann nicht nur per Software-Upgrade auf 22kW gebracht werden (was in ein paar Jahren ja interessant sein könnte), sondern hat auch viele Schnittstellen. Unter anderem kann man die Wallbox per Modbus in ein beliebiges anderes System aufnehmen. Wie genau das klappt, welche Register es gibt und wie man diese auslesen / schreiben kann, zeige ich Dir alles in diesem Beitrag.

Video

ioBroker-Kurs

Register

Die folgenden Register stehen unter Slave-Address 200 zur Verfügung:

Beschreibung Start Ende Länge Datentyp
Name 100 116 17 STRING
Manufacturer 117 121 5 STRING
Modbus table version 122 122 1 SIGNED16
Firmware version 123 139 17 STRING
Platform type 140 156 17 STRING
Station serial number 157 157 1 STRING
Date year 168 168 1 SIGNED16
Date month 169 169 1 SIGNED16
Date day 170 170 1 SIGNED16
Time hour 171 171 1 SIGNED16
Time minute 172 172 1 SIGNED16
Time second 173 173 1 SIGNED16
Uptime 174 177 4 UNSIGNED64
Time zone 178 178 1 SIGNED16
Station Active Max Current 1100 1101 2 FLOAT32
Temperature 1102 1103 2 FLOAT32
OCPP state 1104 1104 1 UNSIGNED16
Nr of sockets 1105 1105 1 UNSIGNED16

Da nicht alle Register interessant sind, hier eine gefilterte Liste mit relevanten Informationen:

Beschreibung Start Ende Länge Datentyp
Name 100 116 17 STRING
Firmware version 123 139 17 STRING
Uptime 174 177 4 UNSIGNED64
Temperature 1102 1103 2 FLOAT32

Die längere Liste mit Registern findet man dann unter Slave-Adress 1:

Beschreibung Start Ende Länge Datentyp
Meter state 300 300 1 UNSIGNED16
Meter type 301 304 4 UNSIGNED64
Meter last value timestamp 305 305 1 UNSIGNED16
Voltage Phase V(L1-N) 306 307 2 FLOAT32
Voltage Phase V(L2-N) 308 309 2 FLOAT32
Voltage Phase V(L3-N) 310 311 2 FLOAT32
Voltage Phase V(L1-L2) 312 313 2 FLOAT32
Voltage Phase V(L2-L3) 314 315 2 FLOAT32
Voltage Phase V(L3-L1) 316 317 2 FLOAT32
Current N 318 319 2 FLOAT32
Current Phase L1 320 321 2 FLOAT32
Current Phase L2 322 323 2 FLOAT32
Current Phase L3 324 325 2 FLOAT32
Current Sum 326 327 2 FLOAT32
Power Factor Phase L1 328 329 2 FLOAT32
Power Factor Phase L2 330 331 2 FLOAT32
Power Factor Phase L3 332 333 2 FLOAT32
Power Factor Sum 334 335 2 FLOAT32
Frequency 336 337 2 FLOAT32
Real Power Phase L1 338 339 2 FLOAT32
Real Power Phase L2 340 341 2 FLOAT32
Real Power Phase L3 342 343 2 FLOAT32
Real Power Sum 344 345 2 FLOAT32
Apparent Power Phase L1 346 347 2 FLOAT32
Apparent Power Phase L2 348 349 2 FLOAT32
Apparent Power Phase L3 350 351 2 FLOAT32
Apparent Power Sum 352 353 2 FLOAT32
Reactive Power Phase L1 354 355 2 FLOAT32
Reactive Power Phase L2 356 357 2 FLOAT32
Reactive Power Phase L3 358 359 2 FLOAT32
Reactive Power Sum 360 361 2 FLOAT32
Real Energy Delivered Phase L1 362 365 4 FLOAT64
Real Energy Delivered Phase L2 366 369 4 FLOAT64
Real Energy Delivered Phase L3 370 377 4 FLOAT64
Real Energy Delivered Sum 374 377 4 FLOAT64
Real Energy Consumed Phase L1 378 381 4 FLOAT64
Real Energy Consumed Phase L2 382 385 4 FLOAT64
Real Energy Consumed Phase L3 386 389 4 FLOAT64
Real Energy Consumed Sum 390 393 4 FLOAT64
Apparent Energy Phase L1 394 397 4 FLOAT64
Apparent Energy Phase L2 398 401 4 FLOAT64
Apparent Energy Phase L3 402 405 4 FLOAT64
Apparent Energy Sum 406 409 4 FLOAT64
Reactive Energy Phase L1 410 413 4 FLOAT64
Reactive Energy Phase L2 414 417 4 FLOAT64
Reactive Energy Phase L3 418 421 4 FLOAT64
Reactive Energy Sum 422 425 4 FLOAT64
Availability 1200 1200 1 UNSIGNED16
Mode 3 state 1201 1205 5 STRING
Active Max Current 1206 1207 2 FLOAT32
Max Current valid time 1208 1209 2 UNSIGNED32
Max Current 1210 1211 2 FLOAT32
Safe Current 1212 1213 2 FLOAT32
Max Current enable 1214 1214 1 UNSIGNED16
Charge phases 1215 1215 1 UNSIGNED16

Davon sind allerdings auch längst nicht alle Infos spannend. Ich würde nur die folgenden Register anlegen:

Beschreibung Start Ende Länge Datentyp
Voltage Phase V(L1-N) 306 307 2 FLOAT32
Voltage Phase V(L2-N) 308 309 2 FLOAT32
Voltage Phase V(L3-N) 310 311 2 FLOAT32
Current Phase L1 320 321 2 FLOAT32
Current Phase L2 322 323 2 FLOAT32
Current Phase L3 324 325 2 FLOAT32
Frequency 336 337 2 FLOAT32
Real Power Sum 344 345 2 FLOAT32
Real Energy Delivered Sum 374 377 4 FLOAT64
Active Max Current 1206 1207 2 FLOAT32
Max Current valid time 1208 1209 2 UNSIGNED32
Max Current 1210 1211 2 FLOAT32
Safe Current 1212 1213 2 FLOAT32
Charge phases 1215 1215 1 UNSIGNED16

Besonders spannend ist das Register 1215, welches die Umschaltung zwischen 1- und 3-phasigem laden erlaubt. Dort kann man eine 1 oder eine 3 schreiben. Dazu aber wann anders etwas mehr.

JavaScript

Blockly weiter unten

const kWhPrice = 0.28;

let startWh = 0;
let charging = false;

createState('0_userdata.0.energy.wallbox.lastChargingkWh', {
    name: 'Charged kWh',
    type: 'number',
    unit: 'kWh',
    role: 'value'
});

createState('0_userdata.0.energy.wallbox.currentChargingkWh', {
    name: 'Charged kWh',
    type: 'number',
    unit: 'kWh',
    role: 'value'
});

createState('0_userdata.0.energy.wallbox.totalPrice', {
    name: 'Price for charging',
    type: 'number',
    unit: '',
    role: 'value'
});

on({id: 'modbus.0.holdingRegisters.1.41202_Mode_3 State', change: 'ne'}, async (obj) => {
    const value = String(obj.state.val);

    if (!charging && value.startsWith('C')) {
        charging = true;
        startWh = getState('modbus.0.holdingRegisters.1.40375_Real_Energy Delivered Sum').val;
        sendTo('pushover', 'send', {
            message: 'Ladevorgang gestartet.',
            sound: '',
            title: 'Wallbox'
        });
    } else if (charging && !value.startsWith('C')) {
        charging = false;

        // Noch kurz warten, damit sich der Zähler nochmal aktualisieren kann
        setTimeout(async () => {
            const kWhCharged = (getState('modbus.0.holdingRegisters.1.40375_Real_Energy Delivered Sum').val - startWh) / 1000;
            const chargingCosts = kWhCharged * kWhPrice;

            setState('0_userdata.0.energy.wallbox.lastChargingkWh', kWhCharged, true);
            setState('0_userdata.0.energy.wallbox.currentChargingkWh', 0, true);

            sendTo('pushover', 'send', {
                message: `Laden abgeschlossen. ${formatValue(kWhCharged, 3)} kWh geladen. Preis: ${formatValue(chargingCosts, 2)} €.`,
                sound: '',
                title: 'Wallbox'
            });
        }, 5000);
    }
});

schedule('*/10 * * * * *', async () => {
    if (charging) {
        // Alle 10 Sekunden die geladenen kWh in einen Datenpunkt schreiben
        const kWhCharged = (getState('modbus.0.holdingRegisters.1.40375_Real_Energy Delivered Sum').val - startWh) / 1000;
        setState('0_userdata.0.energy.wallbox.currentChargingkWh', kWhCharged, true);
    }
});

on({id: 'modbus.0.holdingRegisters.1.40375_Real_Energy Delivered Sum', change: 'ne'}, async (obj) => {
    const value = obj.state.val;

    setState('0_userdata.0.energy.wallbox.totalPrice', Math.round((value / 1000 * kWhPrice) * 100) / 100, true);
});

Blockly-Script

Das Blockly-Script aus dem Video kannst Du hier einfach kopieren und importieren.

<xml xmlns="https://developers.google.com/blockly/xml">
  <variables>
    <variable id="bvIdrI/KD0F#xDpn5ZA9">charging</variable>
    <variable id=")7(cpn3ml1ALb@RqN4{T">startWh</variable>
    <variable type="timeout" id="timeout">timeout</variable>
    <variable id="l/fHA:kG3u53]imug=L@">kWhCharged</variable>
    <variable id="Rt*eqqg?Wq9]76Gy^^^I">chargingCosts</variable>
  </variables>
  <block type="create" id="=*VwIKX4mMR{/)vzJdEv" x="113" y="-88">
    <field name="NAME">lastChargingkWh</field>
    <value name="COMMON">
      <block type="text" id="?OFFY]/tD62$Vho9dX2e">
        <field name="TEXT">{"name": "Charged kWh", "type": "number", "unit": "kWh", "role": "value"}</field>
      </block>
    </value>
    <next>
      <block type="create" id="yDb]E#Bb#)8idLKALM9%">
        <field name="NAME">currentChargingkWh</field>
        <value name="COMMON">
          <block type="text" id="4$:aF~4o7fsocFdIB~5a">
            <field name="TEXT">{"name": "Charged kWh", "type": "number", "unit": "kWh", "role": "value"}</field>
          </block>
        </value>
        <next>
          <block type="variables_set" id="BINa1GAmgM:yVfe3`WpM">
            <field name="VAR" id="bvIdrI/KD0F#xDpn5ZA9">charging</field>
            <value name="VALUE">
              <block type="logic_boolean" id="R$quShY!c~S+HdIr{,lD">
                <field name="BOOL">FALSE</field>
              </block>
            </value>
            <next>
              <block type="variables_set" id="ddZm_:,Ji;BYd5R;+i9N">
                <field name="VAR" id=")7(cpn3ml1ALb@RqN4{T">startWh</field>
                <value name="VALUE">
                  <block type="math_number" id="le[ov~Xx6oG90$+p3Y_)">
                    <field name="NUM">0</field>
                  </block>
                </value>
                <next>
                  <block type="on" id="%RpeyRRH,~7P8H[)_dMz">
                    <field name="OID">modbus.0.holdingRegisters.1.41202_Mode_3 State</field>
                    <field name="CONDITION">ne</field>
                    <field name="ACK_CONDITION"></field>
                    <statement name="STATEMENT">
                      <block type="controls_if" id="ZPN0WhA#[QpD6g+nU#cB">
                        <mutation elseif="1"></mutation>
                        <value name="IF0">
                          <block type="logic_operation" id="*w{KmXD`ch[ts+jKG8ot" inline="false">
                            <field name="OP">AND</field>
                            <value name="A">
                              <block type="logic_negate" id="tq}Y{rkzS(OO6rcupyRH">
                                <value name="BOOL">
                                  <block type="variables_get" id="3|mmUTcq:Y_{~DzVYKZB">
                                    <field name="VAR" id="bvIdrI/KD0F#xDpn5ZA9">charging</field>
                                  </block>
                                </value>
                              </block>
                            </value>
                            <value name="B">
                              <block type="logic_compare" id="PO4F,c:}2Y8qyX1:KIZt">
                                <field name="OP">EQ</field>
                                <value name="A">
                                  <block type="text_charAt" id="4lV=@yQjMU79_!sgt2=5">
                                    <mutation at="true"></mutation>
                                    <field name="WHERE">FROM_START</field>
                                    <value name="VALUE">
                                      <block type="on_source" id="VheG_l,=r`utiN.S/~ZG">
                                        <field name="ATTR">state.val</field>
                                      </block>
                                    </value>
                                    <value name="AT">
                                      <block type="math_number" id="z._@fipL|s2QJ.|B,(Io">
                                        <field name="NUM">1</field>
                                      </block>
                                    </value>
                                  </block>
                                </value>
                                <value name="B">
                                  <block type="text" id="i?b:UL#-=2cxp@]$;0H9">
                                    <field name="TEXT">C</field>
                                  </block>
                                </value>
                              </block>
                            </value>
                          </block>
                        </value>
                        <statement name="DO0">
                          <block type="variables_set" id="kW/y5vMvS);}}JAulV^j">
                            <field name="VAR" id="bvIdrI/KD0F#xDpn5ZA9">charging</field>
                            <value name="VALUE">
                              <block type="logic_boolean" id="lAGa]Qrj{bP$+`ToV+-f">
                                <field name="BOOL">TRUE</field>
                              </block>
                            </value>
                            <next>
                              <block type="variables_set" id="Zz53S8#;1NNJ/K;~T6`q">
                                <field name="VAR" id=")7(cpn3ml1ALb@RqN4{T">startWh</field>
                                <value name="VALUE">
                                  <block type="get_value" id="iNh!aF[dZMnj3=19).E+">
                                    <field name="ATTR">val</field>
                                    <field name="OID">modbus.0.holdingRegisters.1.40375_Real_Energy Delivered Sum</field>
                                  </block>
                                </value>
                                <next>
                                  <block type="pushover" id="lst6ts?4)`#}3upcr`n`">
                                    <field name="INSTANCE"></field>
                                    <field name="SOUND"></field>
                                    <field name="PRIORITY">0</field>
                                    <field name="LOG"></field>
                                    <value name="MESSAGE">
                                      <shadow type="text" id="SgO/:Ct7{0-%~#8^KW}3">
                                        <field name="TEXT"></field>
                                      </shadow>
                                      <block type="text" id="wU/G.vvB,[+(axO,YO;4">
                                        <field name="TEXT">Ladevorgang gestartet.</field>
                                      </block>
                                    </value>
                                    <value name="TITLE">
                                      <block type="text" id="cCbuvO^oEdC%K-X9Ka_h">
                                        <field name="TEXT">Wallbox</field>
                                      </block>
                                    </value>
                                  </block>
                                </next>
                              </block>
                            </next>
                          </block>
                        </statement>
                        <value name="IF1">
                          <block type="logic_operation" id="x,Vb/Hi%@5zd3f*}t^H@" inline="false">
                            <field name="OP">AND</field>
                            <value name="A">
                              <block type="variables_get" id="B7;`T_%ZJYeUu9)Vsl_l">
                                <field name="VAR" id="bvIdrI/KD0F#xDpn5ZA9">charging</field>
                              </block>
                            </value>
                            <value name="B">
                              <block type="logic_compare" id="MBVGem~hfIh7K7v/UMcb">
                                <field name="OP">NEQ</field>
                                <value name="A">
                                  <block type="text_charAt" id="5A}?V!7|]ZTGD2Twz##q">
                                    <mutation at="true"></mutation>
                                    <field name="WHERE">FROM_START</field>
                                    <value name="VALUE">
                                      <block type="on_source" id="QfEm.~;^n`}?Z7FV/WWO">
                                        <field name="ATTR">state.val</field>
                                      </block>
                                    </value>
                                    <value name="AT">
                                      <block type="math_number" id=";-9GTO5q_4@n~n8=S9/[">
                                        <field name="NUM">1</field>
                                      </block>
                                    </value>
                                  </block>
                                </value>
                                <value name="B">
                                  <block type="text" id="?x|A[I+|YA]sKc?[NTTZ">
                                    <field name="TEXT">C</field>
                                  </block>
                                </value>
                              </block>
                            </value>
                          </block>
                        </value>
                        <statement name="DO1">
                          <block type="variables_set" id="SQsWCOk+t/y#]$8lQ5ya">
                            <field name="VAR" id="bvIdrI/KD0F#xDpn5ZA9">charging</field>
                            <value name="VALUE">
                              <block type="logic_boolean" id="!r{cQu74IXQLNRsFO3LQ">
                                <field name="BOOL">FALSE</field>
                              </block>
                            </value>
                            <next>
                              <block type="comment" id="(T=O)C/XDO`e^OS1K**5">
                                <field name="COMMENT">Noch kurz warten, damit sich der Zähler nochmal aktualisieren kann</field>
                                <next>
                                  <block type="timeouts_settimeout" id="Q6eqy/{K%`#Wb@*#W]=L">
                                    <field name="NAME">timeout</field>
                                    <field name="DELAY">5</field>
                                    <field name="UNIT">sec</field>
                                    <statement name="STATEMENT">
                                      <block type="variables_set" id="4a9x:WNq2/wvXrnbtb[]">
                                        <field name="VAR" id="l/fHA:kG3u53]imug=L@">kWhCharged</field>
                                        <value name="VALUE">
                                          <block type="math_arithmetic" id="_e#B2CHMBE4N*4rP9!!q">
                                            <field name="OP">DIVIDE</field>
                                            <value name="A">
                                              <shadow type="math_number" id="WmHIe%7QvM@!-Y;:AmC_">
                                                <field name="NUM">1</field>
                                              </shadow>
                                              <block type="math_arithmetic" id="K@Z#2c]xPp1^|k0/xG6.">
                                                <field name="OP">MINUS</field>
                                                <value name="A">
                                                  <shadow type="math_number" id="{E5AW9S(08]Ebp5!N,SH">
                                                    <field name="NUM">1</field>
                                                  </shadow>
                                                  <block type="get_value" id="4C`*Jo_Nm]rGv#4pgLcL">
                                                    <field name="ATTR">val</field>
                                                    <field name="OID">modbus.0.holdingRegisters.1.40375_Real_Energy Delivered Sum</field>
                                                  </block>
                                                </value>
                                                <value name="B">
                                                  <shadow type="math_number" id=")9|n7jlEWOkz7]Ht(^i`">
                                                    <field name="NUM">1</field>
                                                  </shadow>
                                                  <block type="variables_get" id="74fd-e!-q:4a}A:%2Zhh">
                                                    <field name="VAR" id=")7(cpn3ml1ALb@RqN4{T">startWh</field>
                                                  </block>
                                                </value>
                                              </block>
                                            </value>
                                            <value name="B">
                                              <shadow type="math_number" id="erK#xD|saV8|o5UZ(?fx">
                                                <field name="NUM">1000</field>
                                              </shadow>
                                            </value>
                                          </block>
                                        </value>
                                        <next>
                                          <block type="variables_set" id="c9IX!R;RAwTB:|F4LB@0">
                                            <field name="VAR" id="Rt*eqqg?Wq9]76Gy^^^I">chargingCosts</field>
                                            <value name="VALUE">
                                              <block type="math_arithmetic" id="i_rAj3PAQ*}h$?;v8A#s">
                                                <field name="OP">MULTIPLY</field>
                                                <value name="A">
                                                  <shadow type="math_number" id="+iR+{JaRX9)8m(=9~{7O">
                                                    <field name="NUM">1</field>
                                                  </shadow>
                                                  <block type="variables_get" id="Wb#cklOVBR_e6#Ryf}PB">
                                                    <field name="VAR" id="l/fHA:kG3u53]imug=L@">kWhCharged</field>
                                                  </block>
                                                </value>
                                                <value name="B">
                                                  <shadow type="math_number" id="8Iwmb]r%jc4dZ`g/;/]Y">
                                                    <field name="NUM">0.28</field>
                                                  </shadow>
                                                </value>
                                              </block>
                                            </value>
                                            <next>
                                              <block type="update" id="`Vp1(QZ%bEPZNNpA$r)T">
                                                <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                <field name="OID">javascript.0.lastChargingkWh</field>
                                                <field name="WITH_DELAY">FALSE</field>
                                                <value name="VALUE">
                                                  <block type="variables_get" id="#wxV]x]pY#Phegup65:=">
                                                    <field name="VAR" id="l/fHA:kG3u53]imug=L@">kWhCharged</field>
                                                  </block>
                                                </value>
                                                <next>
                                                  <block type="update" id="cXqv#(TWP*#[NfYa:ub!">
                                                    <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                                    <field name="OID">javascript.0.currentChargingkWh</field>
                                                    <field name="WITH_DELAY">FALSE</field>
                                                    <value name="VALUE">
                                                      <block type="math_number" id="ol=hR?|n6PuTz+0x|L0F">
                                                        <field name="NUM">0</field>
                                                      </block>
                                                    </value>
                                                    <next>
                                                      <block type="pushover" id="$h6}gW)tl:t({QeEW5fg">
                                                        <field name="INSTANCE"></field>
                                                        <field name="SOUND"></field>
                                                        <field name="PRIORITY">0</field>
                                                        <field name="LOG"></field>
                                                        <value name="MESSAGE">
                                                          <shadow type="text" id="~1C-1Rwp~_}nSWXu-OnE">
                                                            <field name="TEXT"></field>
                                                          </shadow>
                                                          <block type="text_join" id=";P#*2zRsF3g1__QWeo=b">
                                                            <mutation items="5"></mutation>
                                                            <value name="ADD0">
                                                              <block type="text" id="Yp(~(0bEoaRE;mFO2Y_=">
                                                                <field name="TEXT">Laden abgeschlossen. </field>
                                                              </block>
                                                            </value>
                                                            <value name="ADD1">
                                                              <block type="math_rndfixed" id="^:FngU%?d?0:7gR;P:EP">
                                                                <field name="n">1</field>
                                                                <value name="x">
                                                                  <shadow type="math_number" id="3:4mg+4EGai~U9]=*lW%">
                                                                    <field name="NUM">3.1234</field>
                                                                  </shadow>
                                                                  <block type="variables_get" id="{D:e0mhd[:(z9Ss|^AwA">
                                                                    <field name="VAR" id="l/fHA:kG3u53]imug=L@">kWhCharged</field>
                                                                  </block>
                                                                </value>
                                                              </block>
                                                            </value>
                                                            <value name="ADD2">
                                                              <block type="text" id=",w+P}~C$gQHUP:zwOLgU">
                                                                <field name="TEXT"> kWh geladen. Preis: </field>
                                                              </block>
                                                            </value>
                                                            <value name="ADD3">
                                                              <block type="math_rndfixed" id="!-zaX@=zUTx`)(h-=#,%">
                                                                <field name="n">2</field>
                                                                <value name="x">
                                                                  <shadow type="math_number" id="_QT42-3W~d+se:a+Z6)q">
                                                                    <field name="NUM">3.1234</field>
                                                                  </shadow>
                                                                  <block type="variables_get" id="8|8/fP$=;AD:z%75m:-{">
                                                                    <field name="VAR" id="Rt*eqqg?Wq9]76Gy^^^I">chargingCosts</field>
                                                                  </block>
                                                                </value>
                                                              </block>
                                                            </value>
                                                            <value name="ADD4">
                                                              <block type="text" id="WOK3rKD)z#/YBK~/-gBv">
                                                                <field name="TEXT"> €.</field>
                                                              </block>
                                                            </value>
                                                          </block>
                                                        </value>
                                                        <value name="TITLE">
                                                          <block type="text" id="7xmE?h]%,bzvrJ[4Ca{=">
                                                            <field name="TEXT">Wallbox</field>
                                                          </block>
                                                        </value>
                                                      </block>
                                                    </next>
                                                  </block>
                                                </next>
                                              </block>
                                            </next>
                                          </block>
                                        </next>
                                      </block>
                                    </statement>
                                  </block>
                                </next>
                              </block>
                            </next>
                          </block>
                        </statement>
                      </block>
                    </statement>
                    <next>
                      <block type="schedule" id="Wdo=_Y4fb5%yOD4to-i)">
                        <field name="SCHEDULE">*/10 * * * * *</field>
                        <statement name="STATEMENT">
                          <block type="controls_if" id="0I6q+MTZ#}ZuP*;s8%,J">
                            <value name="IF0">
                              <block type="variables_get" id="vT.z=D+;9|G^HBi~!$nY">
                                <field name="VAR" id="bvIdrI/KD0F#xDpn5ZA9">charging</field>
                              </block>
                            </value>
                            <statement name="DO0">
                              <block type="comment" id=";b1JE6qYesP25bEiyX/p">
                                <field name="COMMENT">Alle x Sekunden die geladenen kWh in einen Datenpunkt schreiben</field>
                                <next>
                                  <block type="update" id="%(+,cxzx,*$wFV%^XZBC">
                                    <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                    <field name="OID">javascript.0.currentChargingkWh</field>
                                    <field name="WITH_DELAY">FALSE</field>
                                    <value name="VALUE">
                                      <block type="math_arithmetic" id="yD~S=MVeh^y@OXWIT3k=">
                                        <field name="OP">DIVIDE</field>
                                        <value name="A">
                                          <shadow type="math_number">
                                            <field name="NUM">1</field>
                                          </shadow>
                                          <block type="math_arithmetic" id="F%/*h)!5Pf#x)N}f[K-X">
                                            <field name="OP">MINUS</field>
                                            <value name="A">
                                              <shadow type="math_number">
                                                <field name="NUM">1</field>
                                              </shadow>
                                              <block type="get_value" id="|kF[As]i/^ch|CN//`9V">
                                                <field name="ATTR">val</field>
                                                <field name="OID">modbus.0.holdingRegisters.1.40375_Real_Energy Delivered Sum</field>
                                              </block>
                                            </value>
                                            <value name="B">
                                              <shadow type="math_number">
                                                <field name="NUM">1</field>
                                              </shadow>
                                              <block type="variables_get" id="0_/?X-uUzkC*B%77CLsH">
                                                <field name="VAR" id=")7(cpn3ml1ALb@RqN4{T">startWh</field>
                                              </block>
                                            </value>
                                          </block>
                                        </value>
                                        <value name="B">
                                          <shadow type="math_number" id="?nrp:HWI29umY/*/@Q]e">
                                            <field name="NUM">1000</field>
                                          </shadow>
                                        </value>
                                      </block>
                                    </value>
                                  </block>
                                </next>
                              </block>
                            </statement>
                          </block>
                        </statement>
                      </block>
                    </next>
                  </block>
                </next>
              </block>
            </next>
          </block>
        </next>
      </block>
    </next>
  </block>
</xml>

Transparenz-Hinweis (Level 1)

An diesem Beitrag ist kein Hersteller beteiligt! Sämtliche Produkte habe ich selbst gekauft und trage die kompletten Kosten für diesen Beitrag alleine! Die Inhalte wurden somit von niemandem gesehen oder abgestimmt. Es handelt sich zu 100% um meine persönliche Meinung und Erfahrung!

Du willst mehr?

Smart-Home-Trainings von A-Z

Steig' noch tiefer in die Themen ein und meistere Deine Projekte! Über 14.000 Teilnehmer konnten sich schon von der Qualität der Online-Kurse überzeugen.

ioBroker-Master-Kurs

ioBroker-Master-Kurs

Mehr Infos
Hausbau-Kurs

Hausbau mit KNX

Mehr Infos
Lox-Kurs

Lox-Kurs

Mehr Infos
Node-RED-Master-Kurs

Node-RED-Master-Kurs

Mehr Infos