[Blockly] Schwedenofen nachlegen/einheizen

  • Beschreibung:

    • Zielsetzung:
      um das Nachlegen bzw. Einheizen des Schwedenofens nicht zu übersehen, hab ich mir ein kleines Script gebastelt, welches beim Unterschreiten der eingestellten Temperatur um den Faktor 1,035 (individuell Tages und Presence abhängig) eine Meldung via Alexa erzeugt.
    • verwendete Adapter:
      • Tado
      • Alexa
    • Objekte:
      • Tado:
        • Actual Temperature (beim Heizkörper)
        • Temperature (vorgegeben Solltemperatur im Raum)
        • Power (ist das Heizkörperthermostat im Heizbetrieb - für den Sommer wichtig ;) )
      • Alexa
        • Announcement

    Bildschirmfoto:

    Der Inhalt kann nicht angezeigt werden, da Sie keine Berechtigung haben, diesen Inhalt zu sehen.

    Publizierung:

    Blocky Export

    <block xmlns="https://developers.google.com/blockly/xml" type="on_ext" id="ZCbcB{kvcWCvJ2I0=;r1" x="-262" y="63">

    <mutation xmlns="http://www.w3.org/1999/xhtml" items="1"></mutation>

    <field name="CONDITION">lt</field>

    <field name="ACK_CONDITION"></field>

    <value name="OID0">

    <shadow type="field_oid" id=";DM0h1%G*3c59L,Vzt3~">

    <field name="oid">tado.0.122768.Rooms.2.Actual_Temperature</field>

    </shadow>

    </value>

    <statement name="STATEMENT">

    <block type="debug" id="h,n349Slr/;uPq%Cqd2i">

    <field name="Severity">warn</field>

    <value name="TEXT">

    <shadow type="text" id="@1!s_uCcqUG=p%ZGw4_W">

    <field name="TEXT">test</field>

    </shadow>

    <block type="text_join" id="uuvM`DLd[P6s!e0WtiZ!" inline="false">

    <mutation items="7"></mutation>

    <value name="ADD0">

    <block type="text" id=".Yq1V3+/5P$D?J`U~P7C">

    <field name="TEXT">Nachlegen oder einheizen. Es hat aktuell noch </field>

    </block>

    </value>

    <value name="ADD1">

    <block type="math_rndfixed" id="ciuGN?Rul0K{V,bEZRuj">

    <field name="n">1</field>

    <value name="x">

    <shadow type="math_number">

    <field name="NUM">3.1234</field>

    </shadow>

    <block type="get_value" id="A71s:S-X3w!ro+Cs$2lT">

    <field name="ATTR">val</field>

    <field name="OID">tado.0.122768.Rooms.2.Actual_Temperature</field>

    </block>

    </value>

    </block>

    </value>

    <value name="ADD2">

    <block type="text" id="8W%uUbC~gdA4XiLA+oZ(">

    <field name="TEXT"> °C weiter fallend.</field>

    </block>

    </value>

    <value name="ADD3">

    <block type="text_newline" id="@B|FY!iJXK4.FA.~Y.|s">

    <field name="Type">\n</field>

    </block>

    </value>

    <value name="ADD4">

    <block type="text" id="W6#yJt$W?#vG[w!Pj(1.">

    <field name="TEXT">Alarmschwelle ist auf </field>

    </block>

    </value>

    <value name="ADD5">

    <block type="math_rndfixed" id="zEYnFN~2}*?BA5GEmx0H">

    <field name="n">1</field>

    <value name="x">

    <shadow type="math_number" id="oD`rLe[PvKt~h[z#0*V.">

    <field name="NUM">3.1234</field>

    </shadow>

    <block type="math_arithmetic" id="OHc0-4Bj^=rIt!++gss3">

    <field name="OP">MULTIPLY</field>

    <value name="A">

    <shadow type="math_number">

    <field name="NUM">1</field>

    </shadow>

    <block type="get_value" id="vvI8e.}J@`qGg0`9jfaC">

    <field name="ATTR">val</field>

    <field name="OID">tado.0.122768.Rooms.2.setting.temperature</field>

    </block>

    </value>

    <value name="B">

    <shadow type="math_number" id="wa;H?Pll7m0Fth:LN#rt">

    <field name="NUM">1.035</field>

    </shadow>

    </value>

    </block>

    </value>

    </block>

    </value>

    <value name="ADD6">

    <block type="text" id="G}qo=sO*Tu]fjU4VQ;2_">

    <field name="TEXT">°C gesetzt.</field>

    </block>

    </value>

    </block>

    </value>

    <next>

    <block type="controls_if" id=",lghx2kuId1Vy_%b(LI$">

    <value name="IF0">

    <block type="logic_operation" id="ZNlUt*+sz/w:NM):pCof" inline="false">

    <field name="OP">AND</field>

    <value name="A">

    <block type="logic_compare" id="PtUhH}66P`v|ZL!E//[}">

    <field name="OP">LT</field>

    <value name="A">

    <block type="get_value" id="49rS:7cKf1/[opAg`%/I">

    <field name="ATTR">val</field>

    <field name="OID">tado.0.122768.Rooms.2.Actual_Temperature</field>

    </block>

    </value>

    <value name="B">

    <block type="math_rndfixed" id="67A,E!2*;d^(Er%Sug8I">

    <field name="n">1</field>

    <value name="x">

    <shadow type="math_number" id="yN/udVB#O?X6I$k1S]rE">

    <field name="NUM">3.1234</field>

    </shadow>

    <block type="math_arithmetic" id="|}Sn]kF9r^V_EOBz9P+v">

    <field name="OP">MULTIPLY</field>

    <value name="A">

    <shadow type="math_number" id="{ZBFg0j$p/BO])BR^U?.">

    <field name="NUM">1</field>

    </shadow>

    <block type="get_value" id="B%e$LJa|;P*8;wx$ceyJ">

    <field name="ATTR">val</field>

    <field name="OID">tado.0.122768.Rooms.2.setting.temperature</field>

    </block>

    </value>

    <value name="B">

    <shadow type="math_number" id="5iDHq8krNXh*`#4iFe|O">

    <field name="NUM">1.035</field>

    </shadow>

    </value>

    </block>

    </value>

    </block>

    </value>

    </block>

    </value>

    <value name="B">

    <block type="logic_operation" id="Uzv@+$Er|:a/-m}E;Ebl">

    <field name="OP">AND</field>

    <value name="A">

    <block type="logic_compare" id="{o0_-qOgU[LE__nubQ,e">

    <field name="OP">NEQ</field>

    <value name="A">

    <block type="get_value" id="D*d+v]pAref3sK1MjL?d">

    <field name="ATTR">val</field>

    <field name="OID">tado.0.122768.Rooms.2.setting.power</field>

    </block>

    </value>

    <value name="B">

    <block type="text" id="{bL?Pt6KB)c2J]U+s%(.">

    <field name="TEXT">OFF</field>

    </block>

    </value>

    </block>

    </value>

    <value name="B">

    <block type="logic_operation" id="Qwr0]K!vq{_f{vN;Px+}">

    <field name="OP">AND</field>

    <value name="A">

    <block type="time_compare_ex" id="r86s!tEt:otf=XNM/bk.">

    <mutation xmlns="http://www.w3.org/1999/xhtml" end_time="false" actual_time="true"></mutation>

    <field name="USE_ACTUAL_TIME">TRUE</field>

    <field name="OPTION">&gt;</field>

    <value name="START_TIME">

    <shadow type="text" id="B.393k4O)l4!6!CgwM03">

    <field name="TEXT">06:00</field>

    </shadow>

    </value>

    </block>

    </value>

    <value name="B">

    <block type="time_compare_ex" id="{_H#[:dH5$XNR4@S[9Vp">

    <mutation xmlns="http://www.w3.org/1999/xhtml" end_time="false" actual_time="true"></mutation>

    <field name="USE_ACTUAL_TIME">TRUE</field>

    <field name="OPTION">&lt;</field>

    <value name="START_TIME">

    <shadow type="text" id="hRt9dQJ,7sxgmqnp[hxE">

    <field name="TEXT">20:00</field>

    </shadow>

    </value>

    </block>

    </value>

    </block>

    </value>

    </block>

    </value>

    </block>

    </value>

    <statement name="DO0">

    <block type="toggle" id=")RV;D%,$h~uU;j.wkGM0" disabled="true">

    <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>

    <field name="OID">harmony.0.Harmony_Hub.Sony-Heimkino.Mute</field>

    <field name="WITH_DELAY">FALSE</field>

    <next>

    <block type="control" id="s*ONNY_QIU=p0}$;VaSA">

    <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>

    <field name="OID">alexa2.0.Echo-Devices.G091EU0805031XFU.Commands.announcement</field>

    <field name="WITH_DELAY">FALSE</field>

    <value name="VALUE">

    <block type="text_join" id="]Ob`6H{@:D(90$O3I$dI">

    <mutation items="3"></mutation>

    <value name="ADD0">

    <block type="text" id="h`d%l!e2rou!G7TLW|9A">

    <field name="TEXT">Nachlegen oder einheizen. Es hat aktuell noch </field>

    </block>

    </value>

    <value name="ADD1">

    <block type="math_rndfixed" id="tkF=Qm/@seHF)h_Yv$EO">

    <field name="n">1</field>

    <value name="x">

    <shadow type="math_number">

    <field name="NUM">3.1234</field>

    </shadow>

    <block type="get_value" id=":l|tO_C=`uU7J!b7CJN=">

    <field name="ATTR">val</field>

    <field name="OID">tado.0.122768.Rooms.2.Actual_Temperature</field>

    </block>

    </value>

    </block>

    </value>

    <value name="ADD2">

    <block type="text" id="I+e+bt5J@qTQ9w;J_=Km">

    <field name="TEXT"> °C weiter fallend.</field>

    </block>

    </value>

    </block>

    </value>

    <next>

    <block type="timeouts_wait" id="vZRxvZm?s9n(FocRYT{o" disabled="true">

    <field name="DELAY">11</field>

    <field name="UNIT">sec</field>

    <next>

    <block type="toggle" id=",tBX*%lwy:7[fh3=;1:4" disabled="true">

    <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>

    <field name="OID">harmony.0.Harmony_Hub.Sony-Heimkino.Mute</field>

    <field name="WITH_DELAY">FALSE</field>

    </block>

    </next>

    </block>

    </next>

    </block>

    </next>

    </block>

    </statement>

    </block>

    </next>

    </block>

    </statement>

    </block>

    JavaScript Export

    on({id: 'tado.0.122768.Rooms.2.Actual_Temperature', change: "lt"}, async function (obj) {
      var value = obj.state.val;
      var oldValue = obj.oldState.val;
    console.warn((['Nachlegen oder einheizen. Es hat aktuell noch ',Math.round(getState("tado.0.122768.Rooms.2.Actual_Temperature").val*10)/10,' °C weiter fallend.','\n','Alarmschwelle ist auf ',Math.round((getState("tado.0.122768.Rooms.2.setting.temperature").val * 1.035)*10)/10,'°C gesetzt.'].join('')));
      if (getState("tado.0.122768.Rooms.2.Actual_Temperature").val < Math.round((getState("tado.0.122768.Rooms.2.setting.temperature").val * 1.035)*10)/10 && getState("tado.0.122768.Rooms.2.setting.power").val != 'OFF' && compareTime('06:00', null, ">", null) && compareTime('20:00', null, "<", null)) {
    setState("alexa2.0.Echo-Devices.G091EU0805031XFU.Commands.announcement"/*announcement*/, (['Nachlegen oder einheizen. Es hat aktuell noch ',Math.round(getState("tado.0.122768.Rooms.2.Actual_Temperature").val*10)/10,' °C weiter fallend.'].join('')));
    }
    });