Skip to content

Staubsauger Roboter als Lüfter mit Anwesenheitssensor Xiaomi Mi Robot oder Roborock S50

Nico Hartung edited this page Jun 9, 2020 · 2 revisions

Ich habe hier meine zwei Staubsauger-Roboter inkl. Geschwindigkeitseinstellungen über den Slider in Apple Home abgebildet. Diese sind über den Adapter mihome-vacuum in ioBroker zu finden.

Ein- und ausschalten würden ohne Blockly Skript funktionieren, allerdings kann man dann nicht die Geschwindigkeit in HomeKit sehen und einstellen.

Im Beispiel geht es um Xiaomi Mi Robot (Generation 1) und Roborock S50 (Generation 2) mit unterschiedlichen Geschwindigkeits-Mappings.

In meiner Konfiguration muss für jeden Staubsauger-Roboter ein Datenpunkt (number) erzeugt werden und ein Blockly Skript.

ioBroker

Datenpunkt erzeugen, in meinem Fall 0_userdata.0.staubsauger.varRotationSpeedVacuumFlurEG

Yahka

Service-Typ: Fan

Characteristic: RotationSpeed
InOut: ioBroker.State
 State: 0_userdata.0.staubsauger.varRotationSpeedVacuumFlurEG
Conversion: passthrough
Characteristic: On
InOut: ioBroker.State
 State: mihome-vacuum.1.control.clean_home
Conversion: passthrough

Service-Typ: OccupancySensor

Characteristic: OccupancyDetected
InOut: ioBroker.State
 State: mihome-vacuum.1.info.state
Conversion: script
 To HomeKit: return value === 8;
 To IOBroker: 

Skript

🚨 Aufgrund der unterschiedlichen Geschwindigkeiten, sind die Skripts für Xiaomi Mi Robot (Generation 1) und Roborock S50 (Generation 2) unterschiedlich.

Nutzen:

  • grundlegende Funktionalität abbilden
  • ständige HomeKit-Slider Änderungen abfangen (teilweise 4-5 Änderungen pro Sekunde)
  • manuelle, nicht über HomeKit gesteuerte, Geschwindkeitsänderungen erkennen

🚨 Natürlich müssen die Datenpunkte ausgetauscht werden!

Roborock S50 (Generation 2)

<xml xmlns="https://developers.google.com/blockly/xml">
  <variables>
    <variable id="?Mztia}$iK,QEhVSirfQ">Name</variable>
    <variable type="timeout" id="timeout_homekit">timeout_homekit</variable>
  </variables>
  <block type="comment" id="opdmjN(U/8Q+k,Kyy]X+" x="37" y="13">
    <field name="COMMENT">Steuerung über HomeKit</field>
    <next>
      <block type="on_ext" id="_9Cs]-)|bynSj=HbW^(5">
        <mutation xmlns="http://www.w3.org/1999/xhtml" items="1"></mutation>
        <field name="CONDITION">ne</field>
        <field name="ACK_CONDITION"></field>
        <value name="OID0">
          <shadow type="field_oid" id="@42b,1,,ydQ$r%:ABI5X">
            <field name="oid">0_userdata.0.staubsauger.varRotationSpeedVacuumFlurEG</field>
          </shadow>
        </value>
        <statement name="STATEMENT">
          <block type="variables_set" id=":I6xw![8T3iO5TgY-~$n">
            <field name="VAR" id="?Mztia}$iK,QEhVSirfQ">Name</field>
            <value name="VALUE">
              <block type="text" id="+pypvAW.o90Od{%MaaZJ">
                <field name="TEXT">Staubsauger Flur EG</field>
              </block>
            </value>
            <next>
              <block type="controls_if" id="C=8Xc2?J9?F{Tkao0@BV">
                <value name="IF0">
                  <block type="logic_compare" id="Nr=9:gtc_`QiN4e60q`*">
                    <field name="OP">EQ</field>
                    <value name="A">
                      <block type="on_source" id="EkPcGrLu2r*(6%g/gX9U">
                        <field name="ATTR">state.from</field>
                      </block>
                    </value>
                    <value name="B">
                      <block type="text" id="$xZ5B(8zgupC/BdY5Gvn">
                        <field name="TEXT">system.adapter.yahka.0</field>
                      </block>
                    </value>
                  </block>
                </value>
                <statement name="DO0">
                  <block type="update" id="kXa(tK-CT+l-s![qExJS">
                    <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                    <field name="OID">0_userdata.0.staubsauger.varRotationSpeedVacuumFlurEG</field>
                    <field name="WITH_DELAY">FALSE</field>
                    <value name="VALUE">
                      <block type="math_round" id=".GqH#|ScT=!XPo5^ug1P">
                        <field name="OP">ROUND</field>
                        <value name="NUM">
                          <shadow xmlns="http://www.w3.org/1999/xhtml" type="math_number" id=".oaXbAW5[Uu*v2T0ebw|">
                            <field name="NUM">3.1</field>
                          </shadow>
                          <block type="on_source" id="}RJI1eC-+2#n)B2r*hvo">
                            <field name="ATTR">state.val</field>
                          </block>
                        </value>
                      </block>
                    </value>
                    <next>
                      <block type="timeouts_settimeout" id="w7F/y~}F%M+-zK)B~}u7">
                        <field name="NAME">timeout_homekit</field>
                        <field name="DELAY">1500</field>
                        <field name="UNIT">ms</field>
                        <statement name="STATEMENT">
                          <block type="controls_if" id="yCIv$GuGwkd!:0du:M1x">
                            <value name="IF0">
                              <block type="logic_compare" id="@)qi^kcyVJJrbgj2Rw2r">
                                <field name="OP">EQ</field>
                                <value name="A">
                                  <block type="math_round" id="`YhlVvOJ]!m#]w@=zo1c">
                                    <field name="OP">ROUND</field>
                                    <value name="NUM">
                                      <shadow xmlns="http://www.w3.org/1999/xhtml" type="math_number" id="S-95rd@s(C2(Pe7asv/u">
                                        <field name="NUM">3.1</field>
                                      </shadow>
                                      <block type="on_source" id="m`MfW@l^KXO8oJ:;@8_I">
                                        <field name="ATTR">state.val</field>
                                      </block>
                                    </value>
                                  </block>
                                </value>
                                <value name="B">
                                  <block type="get_value" id="d7-}`bv5pmd%x$M#C[4A">
                                    <field name="ATTR">val</field>
                                    <field name="OID">0_userdata.0.staubsauger.varRotationSpeedVacuumFlurEG</field>
                                  </block>
                                </value>
                              </block>
                            </value>
                            <statement name="DO0">
                              <block type="controls_if" id="gw3z%TckVQ#2E{H4YC;*">
                                <mutation elseif="4"></mutation>
                                <value name="IF0">
                                  <block type="logic_operation" id="q6ySt5t]M11DMBo=If;4">
                                    <field name="OP">AND</field>
                                    <value name="A">
                                      <block type="logic_compare" id="CLW=H=4*(nXzLIELBTUj">
                                        <field name="OP">GTE</field>
                                        <value name="A">
                                          <block type="get_value" id="@h1jV!mMy#$idk;KfJ5M">
                                            <field name="ATTR">val</field>
                                            <field name="OID">0_userdata.0.staubsauger.varRotationSpeedVacuumFlurEG</field>
                                          </block>
                                        </value>
                                        <value name="B">
                                          <block type="math_number" id="S=/FPa^wi(Rj+t3pus@z">
                                            <field name="NUM">1</field>
                                          </block>
                                        </value>
                                      </block>
                                    </value>
                                    <value name="B">
                                      <block type="logic_compare" id="%+:p68r~%I*[3BJNcOHC">
                                        <field name="OP">LTE</field>
                                        <value name="A">
                                          <block type="get_value" id=".j*Q#S;B77_YO*2W:%Qc">
                                            <field name="ATTR">val</field>
                                            <field name="OID">0_userdata.0.staubsauger.varRotationSpeedVacuumFlurEG</field>
                                          </block>
                                        </value>
                                        <value name="B">
                                          <block type="math_number" id="K9S7IqBWJQcIz8:{BRl,">
                                            <field name="NUM">15</field>
                                          </block>
                                        </value>
                                      </block>
                                    </value>
                                  </block>
                                </value>
                                <statement name="DO0">
                                  <block type="control" id="?vKcpLf9h2Eg$.=+BNO1">
                                    <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                    <field name="OID">mihome-vacuum.1.control.fan_power</field>
                                    <field name="WITH_DELAY">FALSE</field>
                                    <value name="VALUE">
                                      <shadow xmlns="http://www.w3.org/1999/xhtml" type="math_number" id="^uemxS.,(:*M]Iofse23">
                                        <field name="NUM">90</field>
                                      </shadow>
                                      <block type="math_number" id="C+CdsK6$.IR.x.[kUFP2">
                                        <field name="NUM">105</field>
                                      </block>
                                    </value>
                                  </block>
                                </statement>
                                <value name="IF1">
                                  <block type="logic_operation" id="I!jDCVJ.NPGvmA02H/lb">
                                    <field name="OP">AND</field>
                                    <value name="A">
                                      <block type="logic_compare" id="M,`9tE!~(@I(F29;nr/9">
                                        <field name="OP">GTE</field>
                                        <value name="A">
                                          <block type="get_value" id=")}vNzt=E#]mHA3|5@jX$">
                                            <field name="ATTR">val</field>
                                            <field name="OID">0_userdata.0.staubsauger.varRotationSpeedVacuumFlurEG</field>
                                          </block>
                                        </value>
                                        <value name="B">
                                          <block type="math_number" id="AwW|r#G`4@lQrp_IGfN{">
                                            <field name="NUM">16</field>
                                          </block>
                                        </value>
                                      </block>
                                    </value>
                                    <value name="B">
                                      <block type="logic_compare" id="fwanxB*]j};P8wbdW/gz">
                                        <field name="OP">LTE</field>
                                        <value name="A">
                                          <block type="get_value" id="1cJl4a`^3k;/6jq|)#vD">
                                            <field name="ATTR">val</field>
                                            <field name="OID">0_userdata.0.staubsauger.varRotationSpeedVacuumFlurEG</field>
                                          </block>
                                        </value>
                                        <value name="B">
                                          <block type="math_number" id="1YLt6n/b|}aEWV3!1g}E">
                                            <field name="NUM">38</field>
                                          </block>
                                        </value>
                                      </block>
                                    </value>
                                  </block>
                                </value>
                                <statement name="DO1">
                                  <block type="control" id="b*M(3+zLROHPG;_A^yKq">
                                    <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                    <field name="OID">mihome-vacuum.1.control.fan_power</field>
                                    <field name="WITH_DELAY">FALSE</field>
                                    <value name="VALUE">
                                      <shadow xmlns="http://www.w3.org/1999/xhtml" type="math_number" id="^uemxS.,(:*M]Iofse23">
                                        <field name="NUM">90</field>
                                      </shadow>
                                      <block type="math_number" id="5!GvE9q0j%Z/.Sg*UMDY">
                                        <field name="NUM">101</field>
                                      </block>
                                    </value>
                                  </block>
                                </statement>
                                <value name="IF2">
                                  <block type="logic_operation" id="7gi=*3*Qxi+97,sQNgBQ">
                                    <field name="OP">AND</field>
                                    <value name="A">
                                      <block type="logic_compare" id="Ycb]Dv%EtP_rs/Lj`Y-6">
                                        <field name="OP">GTE</field>
                                        <value name="A">
                                          <block type="get_value" id="5!)3gn`F0Fm,b*(;Tj|D">
                                            <field name="ATTR">val</field>
                                            <field name="OID">0_userdata.0.staubsauger.varRotationSpeedVacuumFlurEG</field>
                                          </block>
                                        </value>
                                        <value name="B">
                                          <block type="math_number" id="A_UQ){285K_MULqN5!~J">
                                            <field name="NUM">39</field>
                                          </block>
                                        </value>
                                      </block>
                                    </value>
                                    <value name="B">
                                      <block type="logic_compare" id="GTp(|zeht=E9?.GV8#pp">
                                        <field name="OP">LTE</field>
                                        <value name="A">
                                          <block type="get_value" id="z2@iE^@Yw2:EgqW]LM(r">
                                            <field name="ATTR">val</field>
                                            <field name="OID">0_userdata.0.staubsauger.varRotationSpeedVacuumFlurEG</field>
                                          </block>
                                        </value>
                                        <value name="B">
                                          <block type="math_number" id=":O{h,o?e:vV=cjrL#Lgl">
                                            <field name="NUM">60</field>
                                          </block>
                                        </value>
                                      </block>
                                    </value>
                                  </block>
                                </value>
                                <statement name="DO2">
                                  <block type="control" id="S:kM2|G;Qad2VRIDy2Gk">
                                    <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                    <field name="OID">mihome-vacuum.1.control.fan_power</field>
                                    <field name="WITH_DELAY">FALSE</field>
                                    <value name="VALUE">
                                      <shadow xmlns="http://www.w3.org/1999/xhtml" type="math_number" id="^uemxS.,(:*M]Iofse23">
                                        <field name="NUM">90</field>
                                      </shadow>
                                      <block type="math_number" id="KZG{Bv/0Kit5/P*5Nj[#">
                                        <field name="NUM">102</field>
                                      </block>
                                    </value>
                                  </block>
                                </statement>
                                <value name="IF3">
                                  <block type="logic_operation" id="sH{Y`VBlo(?Yj}0v*-Sa">
                                    <field name="OP">AND</field>
                                    <value name="A">
                                      <block type="logic_compare" id="I{)`7R570_%XdSIVZN]8">
                                        <field name="OP">GTE</field>
                                        <value name="A">
                                          <block type="get_value" id="!x[Y5(Hg;M1eb)FbrO+I">
                                            <field name="ATTR">val</field>
                                            <field name="OID">0_userdata.0.staubsauger.varRotationSpeedVacuumFlurEG</field>
                                          </block>
                                        </value>
                                        <value name="B">
                                          <block type="math_number" id="Y$*3Z*dPd(FI8;yDUjoi">
                                            <field name="NUM">61</field>
                                          </block>
                                        </value>
                                      </block>
                                    </value>
                                    <value name="B">
                                      <block type="logic_compare" id="ki=ez/738$f~gQ{8R.2i">
                                        <field name="OP">LTE</field>
                                        <value name="A">
                                          <block type="get_value" id="sa$o9f;-VLX=o*y||]y0">
                                            <field name="ATTR">val</field>
                                            <field name="OID">0_userdata.0.staubsauger.varRotationSpeedVacuumFlurEG</field>
                                          </block>
                                        </value>
                                        <value name="B">
                                          <block type="math_number" id="nQP]t,4])*idOF_(02mH">
                                            <field name="NUM">77</field>
                                          </block>
                                        </value>
                                      </block>
                                    </value>
                                  </block>
                                </value>
                                <statement name="DO3">
                                  <block type="control" id="-$;3%b`Qy)g9M$8n`ja{">
                                    <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                    <field name="OID">mihome-vacuum.1.control.fan_power</field>
                                    <field name="WITH_DELAY">FALSE</field>
                                    <value name="VALUE">
                                      <shadow xmlns="http://www.w3.org/1999/xhtml" type="math_number" id="^uemxS.,(:*M]Iofse23">
                                        <field name="NUM">90</field>
                                      </shadow>
                                      <block type="math_number" id="[@|%:=JZYPL#{^T=TP^_">
                                        <field name="NUM">103</field>
                                      </block>
                                    </value>
                                  </block>
                                </statement>
                                <value name="IF4">
                                  <block type="logic_operation" id="WA?x:Uk}U}HsV#mVz[b;">
                                    <field name="OP">AND</field>
                                    <value name="A">
                                      <block type="logic_compare" id="JO9x3xN;0TY9J6q%nz3c">
                                        <field name="OP">GTE</field>
                                        <value name="A">
                                          <block type="get_value" id="woB3i/#h%1v(i$=uLP/0">
                                            <field name="ATTR">val</field>
                                            <field name="OID">0_userdata.0.staubsauger.varRotationSpeedVacuumFlurEG</field>
                                          </block>
                                        </value>
                                        <value name="B">
                                          <block type="math_number" id="{Vw0]?G1KwdC2{{@Lu/6">
                                            <field name="NUM">78</field>
                                          </block>
                                        </value>
                                      </block>
                                    </value>
                                    <value name="B">
                                      <block type="logic_compare" id="/!2hf94hL_Cm$VZaT^Du">
                                        <field name="OP">LTE</field>
                                        <value name="A">
                                          <block type="get_value" id="M8+YlHCz_,]E@%3U[:T.">
                                            <field name="ATTR">val</field>
                                            <field name="OID">0_userdata.0.staubsauger.varRotationSpeedVacuumFlurEG</field>
                                          </block>
                                        </value>
                                        <value name="B">
                                          <block type="math_number" id="EX$zTY})CM8HK0}{nHjQ">
                                            <field name="NUM">100</field>
                                          </block>
                                        </value>
                                      </block>
                                    </value>
                                  </block>
                                </value>
                                <statement name="DO4">
                                  <block type="control" id="f*Gq8!zYf5V:TXh6Sc`(">
                                    <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                    <field name="OID">mihome-vacuum.1.control.fan_power</field>
                                    <field name="WITH_DELAY">FALSE</field>
                                    <value name="VALUE">
                                      <shadow xmlns="http://www.w3.org/1999/xhtml" type="math_number" id="^uemxS.,(:*M]Iofse23">
                                        <field name="NUM">90</field>
                                      </shadow>
                                      <block type="math_number" id="W{4Y7xT!dvL+tfq;?LT5">
                                        <field name="NUM">104</field>
                                      </block>
                                    </value>
                                  </block>
                                </statement>
                                <next>
                                  <block type="timeouts_cleartimeout" id="AoOP0X^K?fGn?3ioso+/">
                                    <field name="NAME">timeout_homekit</field>
                                  </block>
                                </next>
                              </block>
                            </statement>
                          </block>
                        </statement>
                      </block>
                    </next>
                  </block>
                </statement>
              </block>
            </next>
          </block>
        </statement>
        <next>
          <block type="comment" id="N@|Kl;@%,;kfZzx$vH6u">
            <field name="COMMENT">Steuerung nicht über HomeKit</field>
            <next>
              <block type="on_ext" id="vBq,r{Qpn`TqKSX^YcDP">
                <mutation xmlns="http://www.w3.org/1999/xhtml" items="1"></mutation>
                <field name="CONDITION">ne</field>
                <field name="ACK_CONDITION"></field>
                <value name="OID0">
                  <shadow type="field_oid" id="8D0UpVvGeyA/#;o`H.xr">
                    <field name="oid">mihome-vacuum.1.control.fan_power</field>
                  </shadow>
                </value>
                <statement name="STATEMENT">
                  <block type="variables_set" id="AV6V=hP-X2W4ofe`5`Wz">
                    <field name="VAR" id="?Mztia}$iK,QEhVSirfQ">Name</field>
                    <value name="VALUE">
                      <block type="text" id="L[oK5q](UUY7j3(-C4__">
                        <field name="TEXT">Staubsauger Flur EG</field>
                      </block>
                    </value>
                    <next>
                      <block type="controls_if" id="a~DVlEt8^3ATAfF@uHcF">
                        <mutation elseif="4" else="1"></mutation>
                        <value name="IF0">
                          <block type="logic_compare" id="MQja)w95/*bC2bW!F`bp">
                            <field name="OP">EQ</field>
                            <value name="A">
                              <block type="on_source" id="DntGo_oVmodtSchERo5b">
                                <field name="ATTR">state.val</field>
                              </block>
                            </value>
                            <value name="B">
                              <block type="math_number" id="WsS.:C*A~|q/u}F3#Ana">
                                <field name="NUM">104</field>
                              </block>
                            </value>
                          </block>
                        </value>
                        <statement name="DO0">
                          <block type="update" id="osw6sXJP^8?.i~8Zl|`0">
                            <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                            <field name="OID">0_userdata.0.staubsauger.varRotationSpeedVacuumFlurEG</field>
                            <field name="WITH_DELAY">FALSE</field>
                            <value name="VALUE">
                              <block type="math_number" id="$[Bo.D*N`-x#|{54[7JW">
                                <field name="NUM">100</field>
                              </block>
                            </value>
                          </block>
                        </statement>
                        <value name="IF1">
                          <block type="logic_compare" id=".{/.N*8;*hMP=u5kz,x)">
                            <field name="OP">EQ</field>
                            <value name="A">
                              <block type="on_source" id="fX@MaFwE:k43`9rY4O:_">
                                <field name="ATTR">state.val</field>
                              </block>
                            </value>
                            <value name="B">
                              <block type="math_number" id="9W})4#]OKM6+N6O!3W)G">
                                <field name="NUM">103</field>
                              </block>
                            </value>
                          </block>
                        </value>
                        <statement name="DO1">
                          <block type="update" id="Vv^W/0TAKwq*;}#H/jZV">
                            <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                            <field name="OID">0_userdata.0.staubsauger.varRotationSpeedVacuumFlurEG</field>
                            <field name="WITH_DELAY">FALSE</field>
                            <value name="VALUE">
                              <block type="math_number" id="~z?%$hh[tX.HrdsU-dur">
                                <field name="NUM">77</field>
                              </block>
                            </value>
                          </block>
                        </statement>
                        <value name="IF2">
                          <block type="logic_compare" id="[CLv[M^l]z{?VW^K=VM,">
                            <field name="OP">EQ</field>
                            <value name="A">
                              <block type="on_source" id="M(g,ObNq31s2eUI[q.6Y">
                                <field name="ATTR">state.val</field>
                              </block>
                            </value>
                            <value name="B">
                              <block type="math_number" id="G9-L?f@fEJGu/m+ni*#a">
                                <field name="NUM">102</field>
                              </block>
                            </value>
                          </block>
                        </value>
                        <statement name="DO2">
                          <block type="update" id="n@+4A~1o+{iKw+!Wd%b?">
                            <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                            <field name="OID">0_userdata.0.staubsauger.varRotationSpeedVacuumFlurEG</field>
                            <field name="WITH_DELAY">FALSE</field>
                            <value name="VALUE">
                              <block type="math_number" id="F_2g8BDg-/e%LOD|1puX">
                                <field name="NUM">60</field>
                              </block>
                            </value>
                          </block>
                        </statement>
                        <value name="IF3">
                          <block type="logic_compare" id="1=_}@9X.qKU5wamR-(}s">
                            <field name="OP">EQ</field>
                            <value name="A">
                              <block type="on_source" id="Knt}n/IS;)~fWGbNJS$,">
                                <field name="ATTR">state.val</field>
                              </block>
                            </value>
                            <value name="B">
                              <block type="math_number" id="]j4YE?/=KW)lW[q?@w);">
                                <field name="NUM">101</field>
                              </block>
                            </value>
                          </block>
                        </value>
                        <statement name="DO3">
                          <block type="update" id="KPhlXy6tCVZVv2P-=f}Y">
                            <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                            <field name="OID">0_userdata.0.staubsauger.varRotationSpeedVacuumFlurEG</field>
                            <field name="WITH_DELAY">FALSE</field>
                            <value name="VALUE">
                              <block type="math_number" id="T#ysbBITrVGE0(L:YKp~">
                                <field name="NUM">38</field>
                              </block>
                            </value>
                          </block>
                        </statement>
                        <value name="IF4">
                          <block type="logic_compare" id="u9g7n.BTQpFKv;*)kOcq">
                            <field name="OP">EQ</field>
                            <value name="A">
                              <block type="on_source" id="nGrh64[8{9De!x#tg%N~">
                                <field name="ATTR">state.val</field>
                              </block>
                            </value>
                            <value name="B">
                              <block type="math_number" id="C!={asgpt+d.[D4zTb3j">
                                <field name="NUM">105</field>
                              </block>
                            </value>
                          </block>
                        </value>
                        <statement name="DO4">
                          <block type="update" id="K1~rjO7^g3{[==2Yd7Oq">
                            <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                            <field name="OID">0_userdata.0.staubsauger.varRotationSpeedVacuumFlurEG</field>
                            <field name="WITH_DELAY">FALSE</field>
                            <value name="VALUE">
                              <block type="math_number" id="9QQQF~1|(3UD+?R?|Dkm">
                                <field name="NUM">15</field>
                              </block>
                            </value>
                          </block>
                        </statement>
                        <statement name="ELSE">
                          <block type="debug" id="t/#wL]_axB6@)g=~%~qb">
                            <field name="Severity">warn</field>
                            <value name="TEXT">
                              <shadow xmlns="http://www.w3.org/1999/xhtml" type="text" id="xNW1kQjq3/g;=Z4JFNf(">
                                <field name="TEXT">test</field>
                              </shadow>
                              <block type="text_join" id="hD|2=MPX+hV.xM*Jxqlp" inline="false">
                                <mutation items="7"></mutation>
                                <value name="ADD0">
                                  <block type="text" id="CIe6^zeER_EODMk`%]0a">
                                    <field name="TEXT">🧽 Rotationsgeschwindigkeit von </field>
                                  </block>
                                </value>
                                <value name="ADD1">
                                  <block type="variables_get" id="]}DlOJ{*lZ#mR4+-2$f%">
                                    <field name="VAR" id="?Mztia}$iK,QEhVSirfQ">Name</field>
                                  </block>
                                </value>
                                <value name="ADD2">
                                  <block type="text" id="|B5Au65QuNCiQVO!8[.,">
                                    <field name="TEXT"> wurde durch '</field>
                                  </block>
                                </value>
                                <value name="ADD3">
                                  <block type="on_source" id="gDoa8[0-MspY6_GJ-c;A">
                                    <field name="ATTR">state.from</field>
                                  </block>
                                </value>
                                <value name="ADD4">
                                  <block type="text" id="qg6-Do|YuelOTs_Y}vbo">
                                    <field name="TEXT">' auf Modus '</field>
                                  </block>
                                </value>
                                <value name="ADD5">
                                  <block type="on_source" id="~%nAYEMPAK3^B/Fz^:TA">
                                    <field name="ATTR">state.val</field>
                                  </block>
                                </value>
                                <value name="ADD6">
                                  <block type="text" id="|8qX|G;UTuyR{~A(d:no">
                                    <field name="TEXT">' geändert, dieser ist UNBEKANNT! Was tun?</field>
                                  </block>
                                </value>
                              </block>
                            </value>
                          </block>
                        </statement>
                      </block>
                    </next>
                  </block>
                </statement>
              </block>
            </next>
          </block>
        </next>
      </block>
    </next>
  </block>
</xml>

Xiaomi Mi Robot (Generation 1)

<xml xmlns="https://developers.google.com/blockly/xml">
  <variables>
    <variable id="?Mztia}$iK,QEhVSirfQ">Name</variable>
    <variable type="timeout" id="timeout_homekit">timeout_homekit</variable>
  </variables>
  <block type="comment" id="opdmjN(U/8Q+k,Kyy]X+" x="37" y="13">
    <field name="COMMENT">Steuerung über HomeKit</field>
    <next>
      <block type="on_ext" id="_9Cs]-)|bynSj=HbW^(5">
        <mutation xmlns="http://www.w3.org/1999/xhtml" items="1"></mutation>
        <field name="CONDITION">ne</field>
        <field name="ACK_CONDITION"></field>
        <value name="OID0">
          <shadow type="field_oid" id="@42b,1,,ydQ$r%:ABI5X">
            <field name="oid">0_userdata.0.staubsauger.varRotationSpeedVacuumBad</field>
          </shadow>
        </value>
        <statement name="STATEMENT">
          <block type="variables_set" id=":I6xw![8T3iO5TgY-~$n">
            <field name="VAR" id="?Mztia}$iK,QEhVSirfQ">Name</field>
            <value name="VALUE">
              <block type="text" id="+pypvAW.o90Od{%MaaZJ">
                <field name="TEXT">Staubsauger OG Bad</field>
              </block>
            </value>
            <next>
              <block type="controls_if" id="C=8Xc2?J9?F{Tkao0@BV">
                <value name="IF0">
                  <block type="logic_compare" id="Nr=9:gtc_`QiN4e60q`*">
                    <field name="OP">EQ</field>
                    <value name="A">
                      <block type="on_source" id="EkPcGrLu2r*(6%g/gX9U">
                        <field name="ATTR">state.from</field>
                      </block>
                    </value>
                    <value name="B">
                      <block type="text" id="$xZ5B(8zgupC/BdY5Gvn">
                        <field name="TEXT">system.adapter.yahka.0</field>
                      </block>
                    </value>
                  </block>
                </value>
                <statement name="DO0">
                  <block type="update" id="kXa(tK-CT+l-s![qExJS">
                    <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                    <field name="OID">0_userdata.0.staubsauger.varRotationSpeedVacuumBad</field>
                    <field name="WITH_DELAY">FALSE</field>
                    <value name="VALUE">
                      <block type="math_round" id=".GqH#|ScT=!XPo5^ug1P">
                        <field name="OP">ROUND</field>
                        <value name="NUM">
                          <shadow xmlns="http://www.w3.org/1999/xhtml" type="math_number" id=".oaXbAW5[Uu*v2T0ebw|">
                            <field name="NUM">3.1</field>
                          </shadow>
                          <block type="on_source" id="}RJI1eC-+2#n)B2r*hvo">
                            <field name="ATTR">state.val</field>
                          </block>
                        </value>
                      </block>
                    </value>
                    <next>
                      <block type="timeouts_settimeout" id="w7F/y~}F%M+-zK)B~}u7">
                        <field name="NAME">timeout_homekit</field>
                        <field name="DELAY">1500</field>
                        <field name="UNIT">ms</field>
                        <statement name="STATEMENT">
                          <block type="controls_if" id="yCIv$GuGwkd!:0du:M1x">
                            <value name="IF0">
                              <block type="logic_compare" id="@)qi^kcyVJJrbgj2Rw2r">
                                <field name="OP">EQ</field>
                                <value name="A">
                                  <block type="math_round" id="`YhlVvOJ]!m#]w@=zo1c">
                                    <field name="OP">ROUND</field>
                                    <value name="NUM">
                                      <shadow xmlns="http://www.w3.org/1999/xhtml" type="math_number" id="S-95rd@s(C2(Pe7asv/u">
                                        <field name="NUM">3.1</field>
                                      </shadow>
                                      <block type="on_source" id="m`MfW@l^KXO8oJ:;@8_I">
                                        <field name="ATTR">state.val</field>
                                      </block>
                                    </value>
                                  </block>
                                </value>
                                <value name="B">
                                  <block type="get_value" id="d7-}`bv5pmd%x$M#C[4A">
                                    <field name="ATTR">val</field>
                                    <field name="OID">0_userdata.0.staubsauger.varRotationSpeedVacuumBad</field>
                                  </block>
                                </value>
                              </block>
                            </value>
                            <statement name="DO0">
                              <block type="controls_if" id="gw3z%TckVQ#2E{H4YC;*">
                                <mutation elseif="3"></mutation>
                                <value name="IF0">
                                  <block type="logic_operation" id="q6ySt5t]M11DMBo=If;4">
                                    <field name="OP">AND</field>
                                    <value name="A">
                                      <block type="logic_compare" id="CLW=H=4*(nXzLIELBTUj">
                                        <field name="OP">GTE</field>
                                        <value name="A">
                                          <block type="get_value" id="@h1jV!mMy#$idk;KfJ5M">
                                            <field name="ATTR">val</field>
                                            <field name="OID">0_userdata.0.staubsauger.varRotationSpeedVacuumBad</field>
                                          </block>
                                        </value>
                                        <value name="B">
                                          <block type="math_number" id="S=/FPa^wi(Rj+t3pus@z">
                                            <field name="NUM">1</field>
                                          </block>
                                        </value>
                                      </block>
                                    </value>
                                    <value name="B">
                                      <block type="logic_compare" id="%+:p68r~%I*[3BJNcOHC">
                                        <field name="OP">LTE</field>
                                        <value name="A">
                                          <block type="get_value" id=".j*Q#S;B77_YO*2W:%Qc">
                                            <field name="ATTR">val</field>
                                            <field name="OID">0_userdata.0.staubsauger.varRotationSpeedVacuumBad</field>
                                          </block>
                                        </value>
                                        <value name="B">
                                          <block type="math_number" id="K9S7IqBWJQcIz8:{BRl,">
                                            <field name="NUM">38</field>
                                          </block>
                                        </value>
                                      </block>
                                    </value>
                                  </block>
                                </value>
                                <statement name="DO0">
                                  <block type="control" id="?vKcpLf9h2Eg$.=+BNO1">
                                    <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                    <field name="OID">mihome-vacuum.0.control.fan_power</field>
                                    <field name="WITH_DELAY">FALSE</field>
                                    <value name="VALUE">
                                      <shadow xmlns="http://www.w3.org/1999/xhtml" type="math_number" id="^uemxS.,(:*M]Iofse23">
                                        <field name="NUM">90</field>
                                      </shadow>
                                      <block type="math_number" id="C+CdsK6$.IR.x.[kUFP2">
                                        <field name="NUM">38</field>
                                      </block>
                                    </value>
                                  </block>
                                </statement>
                                <value name="IF1">
                                  <block type="logic_operation" id="7gi=*3*Qxi+97,sQNgBQ">
                                    <field name="OP">AND</field>
                                    <value name="A">
                                      <block type="logic_compare" id="Ycb]Dv%EtP_rs/Lj`Y-6">
                                        <field name="OP">GTE</field>
                                        <value name="A">
                                          <block type="get_value" id="5!)3gn`F0Fm,b*(;Tj|D">
                                            <field name="ATTR">val</field>
                                            <field name="OID">0_userdata.0.staubsauger.varRotationSpeedVacuumBad</field>
                                          </block>
                                        </value>
                                        <value name="B">
                                          <block type="math_number" id="A_UQ){285K_MULqN5!~J">
                                            <field name="NUM">39</field>
                                          </block>
                                        </value>
                                      </block>
                                    </value>
                                    <value name="B">
                                      <block type="logic_compare" id="GTp(|zeht=E9?.GV8#pp">
                                        <field name="OP">LTE</field>
                                        <value name="A">
                                          <block type="get_value" id="z2@iE^@Yw2:EgqW]LM(r">
                                            <field name="ATTR">val</field>
                                            <field name="OID">0_userdata.0.staubsauger.varRotationSpeedVacuumBad</field>
                                          </block>
                                        </value>
                                        <value name="B">
                                          <block type="math_number" id=":O{h,o?e:vV=cjrL#Lgl">
                                            <field name="NUM">60</field>
                                          </block>
                                        </value>
                                      </block>
                                    </value>
                                  </block>
                                </value>
                                <statement name="DO1">
                                  <block type="control" id="S:kM2|G;Qad2VRIDy2Gk">
                                    <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                    <field name="OID">mihome-vacuum.0.control.fan_power</field>
                                    <field name="WITH_DELAY">FALSE</field>
                                    <value name="VALUE">
                                      <shadow xmlns="http://www.w3.org/1999/xhtml" type="math_number" id="^uemxS.,(:*M]Iofse23">
                                        <field name="NUM">90</field>
                                      </shadow>
                                      <block type="math_number" id="KZG{Bv/0Kit5/P*5Nj[#">
                                        <field name="NUM">60</field>
                                      </block>
                                    </value>
                                  </block>
                                </statement>
                                <value name="IF2">
                                  <block type="logic_operation" id="sH{Y`VBlo(?Yj}0v*-Sa">
                                    <field name="OP">AND</field>
                                    <value name="A">
                                      <block type="logic_compare" id="I{)`7R570_%XdSIVZN]8">
                                        <field name="OP">GTE</field>
                                        <value name="A">
                                          <block type="get_value" id="!x[Y5(Hg;M1eb)FbrO+I">
                                            <field name="ATTR">val</field>
                                            <field name="OID">0_userdata.0.staubsauger.varRotationSpeedVacuumBad</field>
                                          </block>
                                        </value>
                                        <value name="B">
                                          <block type="math_number" id="Y$*3Z*dPd(FI8;yDUjoi">
                                            <field name="NUM">61</field>
                                          </block>
                                        </value>
                                      </block>
                                    </value>
                                    <value name="B">
                                      <block type="logic_compare" id="ki=ez/738$f~gQ{8R.2i">
                                        <field name="OP">LTE</field>
                                        <value name="A">
                                          <block type="get_value" id="sa$o9f;-VLX=o*y||]y0">
                                            <field name="ATTR">val</field>
                                            <field name="OID">0_userdata.0.staubsauger.varRotationSpeedVacuumBad</field>
                                          </block>
                                        </value>
                                        <value name="B">
                                          <block type="math_number" id="nQP]t,4])*idOF_(02mH">
                                            <field name="NUM">77</field>
                                          </block>
                                        </value>
                                      </block>
                                    </value>
                                  </block>
                                </value>
                                <statement name="DO2">
                                  <block type="control" id="-$;3%b`Qy)g9M$8n`ja{">
                                    <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                    <field name="OID">mihome-vacuum.0.control.fan_power</field>
                                    <field name="WITH_DELAY">FALSE</field>
                                    <value name="VALUE">
                                      <shadow xmlns="http://www.w3.org/1999/xhtml" type="math_number" id="^uemxS.,(:*M]Iofse23">
                                        <field name="NUM">90</field>
                                      </shadow>
                                      <block type="math_number" id="[@|%:=JZYPL#{^T=TP^_">
                                        <field name="NUM">77</field>
                                      </block>
                                    </value>
                                  </block>
                                </statement>
                                <value name="IF3">
                                  <block type="logic_operation" id="WA?x:Uk}U}HsV#mVz[b;">
                                    <field name="OP">AND</field>
                                    <value name="A">
                                      <block type="logic_compare" id="JO9x3xN;0TY9J6q%nz3c">
                                        <field name="OP">GTE</field>
                                        <value name="A">
                                          <block type="get_value" id="woB3i/#h%1v(i$=uLP/0">
                                            <field name="ATTR">val</field>
                                            <field name="OID">0_userdata.0.staubsauger.varRotationSpeedVacuumBad</field>
                                          </block>
                                        </value>
                                        <value name="B">
                                          <block type="math_number" id="{Vw0]?G1KwdC2{{@Lu/6">
                                            <field name="NUM">78</field>
                                          </block>
                                        </value>
                                      </block>
                                    </value>
                                    <value name="B">
                                      <block type="logic_compare" id="/!2hf94hL_Cm$VZaT^Du">
                                        <field name="OP">LTE</field>
                                        <value name="A">
                                          <block type="get_value" id="M8+YlHCz_,]E@%3U[:T.">
                                            <field name="ATTR">val</field>
                                            <field name="OID">0_userdata.0.staubsauger.varRotationSpeedVacuumBad</field>
                                          </block>
                                        </value>
                                        <value name="B">
                                          <block type="math_number" id="EX$zTY})CM8HK0}{nHjQ">
                                            <field name="NUM">100</field>
                                          </block>
                                        </value>
                                      </block>
                                    </value>
                                  </block>
                                </value>
                                <statement name="DO3">
                                  <block type="control" id="f*Gq8!zYf5V:TXh6Sc`(">
                                    <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                    <field name="OID">mihome-vacuum.0.control.fan_power</field>
                                    <field name="WITH_DELAY">FALSE</field>
                                    <value name="VALUE">
                                      <shadow xmlns="http://www.w3.org/1999/xhtml" type="math_number" id="^uemxS.,(:*M]Iofse23">
                                        <field name="NUM">90</field>
                                      </shadow>
                                      <block type="math_number" id="W{4Y7xT!dvL+tfq;?LT5">
                                        <field name="NUM">90</field>
                                      </block>
                                    </value>
                                  </block>
                                </statement>
                                <next>
                                  <block type="timeouts_cleartimeout" id="AoOP0X^K?fGn?3ioso+/">
                                    <field name="NAME">timeout_homekit</field>
                                  </block>
                                </next>
                              </block>
                            </statement>
                          </block>
                        </statement>
                      </block>
                    </next>
                  </block>
                </statement>
              </block>
            </next>
          </block>
        </statement>
        <next>
          <block type="comment" id="N@|Kl;@%,;kfZzx$vH6u">
            <field name="COMMENT">Steuerung nicht über HomeKit</field>
            <next>
              <block type="on_ext" id="vBq,r{Qpn`TqKSX^YcDP">
                <mutation xmlns="http://www.w3.org/1999/xhtml" items="1"></mutation>
                <field name="CONDITION">ne</field>
                <field name="ACK_CONDITION"></field>
                <value name="OID0">
                  <shadow type="field_oid" id="8D0UpVvGeyA/#;o`H.xr">
                    <field name="oid">mihome-vacuum.0.control.fan_power</field>
                  </shadow>
                </value>
                <statement name="STATEMENT">
                  <block type="variables_set" id="AV6V=hP-X2W4ofe`5`Wz">
                    <field name="VAR" id="?Mztia}$iK,QEhVSirfQ">Name</field>
                    <value name="VALUE">
                      <block type="text" id="L[oK5q](UUY7j3(-C4__">
                        <field name="TEXT">Staubsauger OG Bad</field>
                      </block>
                    </value>
                    <next>
                      <block type="controls_if" id="a~DVlEt8^3ATAfF@uHcF">
                        <mutation elseif="3" else="1"></mutation>
                        <value name="IF0">
                          <block type="logic_compare" id="MQja)w95/*bC2bW!F`bp">
                            <field name="OP">EQ</field>
                            <value name="A">
                              <block type="on_source" id="DntGo_oVmodtSchERo5b">
                                <field name="ATTR">state.val</field>
                              </block>
                            </value>
                            <value name="B">
                              <block type="math_number" id="WsS.:C*A~|q/u}F3#Ana">
                                <field name="NUM">90</field>
                              </block>
                            </value>
                          </block>
                        </value>
                        <statement name="DO0">
                          <block type="update" id="osw6sXJP^8?.i~8Zl|`0">
                            <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                            <field name="OID">0_userdata.0.staubsauger.varRotationSpeedVacuumBad</field>
                            <field name="WITH_DELAY">FALSE</field>
                            <value name="VALUE">
                              <block type="math_number" id="$[Bo.D*N`-x#|{54[7JW">
                                <field name="NUM">100</field>
                              </block>
                            </value>
                          </block>
                        </statement>
                        <value name="IF1">
                          <block type="logic_compare" id=".{/.N*8;*hMP=u5kz,x)">
                            <field name="OP">EQ</field>
                            <value name="A">
                              <block type="on_source" id="fX@MaFwE:k43`9rY4O:_">
                                <field name="ATTR">state.val</field>
                              </block>
                            </value>
                            <value name="B">
                              <block type="math_number" id="9W})4#]OKM6+N6O!3W)G">
                                <field name="NUM">77</field>
                              </block>
                            </value>
                          </block>
                        </value>
                        <statement name="DO1">
                          <block type="update" id="Vv^W/0TAKwq*;}#H/jZV">
                            <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                            <field name="OID">0_userdata.0.staubsauger.varRotationSpeedVacuumBad</field>
                            <field name="WITH_DELAY">FALSE</field>
                            <value name="VALUE">
                              <block type="math_number" id="~z?%$hh[tX.HrdsU-dur">
                                <field name="NUM">77</field>
                              </block>
                            </value>
                          </block>
                        </statement>
                        <value name="IF2">
                          <block type="logic_compare" id="[CLv[M^l]z{?VW^K=VM,">
                            <field name="OP">EQ</field>
                            <value name="A">
                              <block type="on_source" id="M(g,ObNq31s2eUI[q.6Y">
                                <field name="ATTR">state.val</field>
                              </block>
                            </value>
                            <value name="B">
                              <block type="math_number" id="G9-L?f@fEJGu/m+ni*#a">
                                <field name="NUM">60</field>
                              </block>
                            </value>
                          </block>
                        </value>
                        <statement name="DO2">
                          <block type="update" id="n@+4A~1o+{iKw+!Wd%b?">
                            <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                            <field name="OID">0_userdata.0.staubsauger.varRotationSpeedVacuumBad</field>
                            <field name="WITH_DELAY">FALSE</field>
                            <value name="VALUE">
                              <block type="math_number" id="F_2g8BDg-/e%LOD|1puX">
                                <field name="NUM">60</field>
                              </block>
                            </value>
                          </block>
                        </statement>
                        <value name="IF3">
                          <block type="logic_compare" id="1=_}@9X.qKU5wamR-(}s">
                            <field name="OP">EQ</field>
                            <value name="A">
                              <block type="on_source" id="Knt}n/IS;)~fWGbNJS$,">
                                <field name="ATTR">state.val</field>
                              </block>
                            </value>
                            <value name="B">
                              <block type="math_number" id="]j4YE?/=KW)lW[q?@w);">
                                <field name="NUM">38</field>
                              </block>
                            </value>
                          </block>
                        </value>
                        <statement name="DO3">
                          <block type="update" id="K1~rjO7^g3{[==2Yd7Oq">
                            <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                            <field name="OID">0_userdata.0.staubsauger.varRotationSpeedVacuumBad</field>
                            <field name="WITH_DELAY">FALSE</field>
                            <value name="VALUE">
                              <block type="math_number" id="9QQQF~1|(3UD+?R?|Dkm">
                                <field name="NUM">38</field>
                              </block>
                            </value>
                          </block>
                        </statement>
                        <statement name="ELSE">
                          <block type="debug" id="t/#wL]_axB6@)g=~%~qb">
                            <field name="Severity">warn</field>
                            <value name="TEXT">
                              <shadow xmlns="http://www.w3.org/1999/xhtml" type="text" id="xNW1kQjq3/g;=Z4JFNf(">
                                <field name="TEXT">test</field>
                              </shadow>
                              <block type="text_join" id="hD|2=MPX+hV.xM*Jxqlp" inline="false">
                                <mutation items="7"></mutation>
                                <value name="ADD0">
                                  <block type="text" id="CIe6^zeER_EODMk`%]0a">
                                    <field name="TEXT">🧽 Rotationsgeschwindigkeit von </field>
                                  </block>
                                </value>
                                <value name="ADD1">
                                  <block type="variables_get" id="]}DlOJ{*lZ#mR4+-2$f%">
                                    <field name="VAR" id="?Mztia}$iK,QEhVSirfQ">Name</field>
                                  </block>
                                </value>
                                <value name="ADD2">
                                  <block type="text" id="|B5Au65QuNCiQVO!8[.,">
                                    <field name="TEXT"> wurde durch '</field>
                                  </block>
                                </value>
                                <value name="ADD3">
                                  <block type="on_source" id="gDoa8[0-MspY6_GJ-c;A">
                                    <field name="ATTR">state.from</field>
                                  </block>
                                </value>
                                <value name="ADD4">
                                  <block type="text" id="qg6-Do|YuelOTs_Y}vbo">
                                    <field name="TEXT">' auf '</field>
                                  </block>
                                </value>
                                <value name="ADD5">
                                  <block type="on_source" id="~%nAYEMPAK3^B/Fz^:TA">
                                    <field name="ATTR">state.val</field>
                                  </block>
                                </value>
                                <value name="ADD6">
                                  <block type="text" id="|8qX|G;UTuyR{~A(d:no">
                                    <field name="TEXT">%' geändert, dieser ist UNBEKANNT! Was tun?</field>
                                  </block>
                                </value>
                              </block>
                            </value>
                          </block>
                        </statement>
                      </block>
                    </next>
                  </block>
                </statement>
              </block>
            </next>
          </block>
        </next>
      </block>
    </next>
  </block>
</xml>