Hallo,
ich denke es kann interessant sein, wie man über eine Cloud-Instanz mehre IFTTT anfragen zu bearbeiten. Der Hintergrund der Geschichte ist der, dass meine Freundin und ich immer mal wieder vergessen, dass wir gut angekommen sind oder gerade von Das Haus verlassen haben. Ich mache mir nach 2 Stunden mal sorgen. Bei ihr ist es nach 20 Min Abweichung schon so. Der Andre Punkt ist der, das ich gerne alles ausgeschalten werden soll, wenn es so weit ist. Da ich in einer WG wohne und die andren jetzt auch begeistert sind von SmartHome sollte ich das auch für die einrichten. Also brauchte ich Instanzen über Instanzen um das hinzubekommen. Also habe ich mir was überlegt, nämlich das jeder eine Nummer ist und jeder Ort eine Nummer hat.
Persion | Nummer / User-ID |
PlayDiver (Ich) | 00 |
Meine Freundin | 01 |
Mitbewohner 1 | 02 |
Mitbewohner 2 | 03 |
Bei den Orden genau so.
Nun hat man ja eine Cloud-Instanz am Laufen. Der hat eine Rest API die über den Link https://iobroker.net/ifttt/deineToken angesprochen werden kann.
Die an die REST-API übermittelte Inflationen sehen gefolgt aus:
[User-ID]_[ord-id]_[Status]
Der Skript sieht dann so aus:
schimmer-media.de/index.php?attachment/3932/
<xml xmlns="http://www.w3.org/1999/xhtml">
<block type="on" id="v{h9=synf/AA-5uemb?a" x="113" y="87">
<field name="OID">cloud.0.services.ifttt</field>
<field name="CONDITION">ne</field>
<field name="ACK_CONDITION"></field>
<statement name="STATEMENT">
<block type="comment" id="wJ)~|l@MJwZ%to);,/vy">
<field name="COMMENT">Meine Auswertung</field>
<next>
<block type="controls_if" id="ax{P83(x5W-IaS+o/7pt">
<value name="IF0">
<block type="logic_compare" id="mNg0JWVMOyy-EPxxZ7b/">
<field name="OP">EQ</field>
<value name="A">
<block type="text_getSubstring" id="SvvY6hT8nQsVeR^qKb9/">
<mutation at1="false" at2="true"></mutation>
<field name="WHERE1">FIRST</field>
<field name="WHERE2">FROM_START</field>
<value name="STRING">
<block type="get_value" id=";MEd0WW/=5Y(VZ0qw5X.">
<field name="ATTR">val</field>
<field name="OID">cloud.0.services.ifttt</field>
</block>
</value>
<value name="AT2">
<block type="math_number" id="s?[f+sZxEBpxn;z4!C.o">
<field name="NUM">2</field>
</block>
</value>
</block>
</value>
<value name="B">
<block type="text" id="Eg9-R{j,IV~f*lJgkzE:">
<field name="TEXT">00</field>
</block>
</value>
</block>
</value>
<statement name="DO0">
<block type="comment" id="q=(|`(9xS8JgaZE^fh)0">
<field name="COMMENT">WG</field>
<next>
<block type="controls_if" id="M,q4i|VcHgP9:ua[MC;b">
<value name="IF0">
<block type="logic_compare" id="Namx~SWb-I,2H+.1lK+g">
<field name="OP">EQ</field>
<value name="A">
<block type="text_getSubstring" id="C,3i(jtePbPCH)xW,g[*">
<mutation at1="true" at2="false"></mutation>
<field name="WHERE1">FROM_START</field>
<field name="WHERE2">LAST</field>
<value name="STRING">
<block type="get_value" id="6ym7;|?Eh1p5Rs9:i_/F">
<field name="ATTR">val</field>
<field name="OID">cloud.0.services.ifttt</field>
</block>
</value>
<value name="AT1">
<block type="math_number" id="mlZh?N1JGpQOl*e~2^8i">
<field name="NUM">4</field>
</block>
</value>
</block>
</value>
<value name="B">
<block type="text" id="z!uS)a53;*kUNzrIhrIO">
<field name="TEXT">00_entered</field>
</block>
</value>
</block>
</value>
<statement name="DO0">
<block type="update" id="Mjk|L?^+NsNQyr%B2d%}">
<mutation delay_input="false"></mutation>
<field name="OID">MyVariable.0.GPS.Sebastian.wg_zimmer</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE">
<block type="logic_boolean" id="^dGtYRB/?N?%dW9g~2t*">
<field name="BOOL">TRUE</field>
</block>
</value>
<next>
<block type="update" id="uy#k]I,SE^XAM%0E/ou|">
<mutation delay_input="false"></mutation>
<field name="OID">MyVariable.0.GPS.Sebastian.auf_arbeit</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE">
<block type="logic_boolean" id="GpY_3^5J=U#uI+N{Z`V4">
<field name="BOOL">FALSE</field>
</block>
</value>
<next>
<block type="update" id="t]Dl2fHh)sZupR/14mVh">
<mutation delay_input="false"></mutation>
<field name="OID">MyVariable.0.GPS.Sebastian.bei_noemi_zuhause</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE">
<block type="logic_boolean" id="4+nu{^Cgj]A@e+^nE64;">
<field name="BOOL">FALSE</field>
</block>
</value>
</block>
</next>
</block>
</next>
</block>
</statement>
<next>
<block type="controls_if" id="Bx~}9-`;9Do%%96)bV||">
<value name="IF0">
<block type="logic_compare" id="%!2y2xW?gL5_7y++YifX">
<field name="OP">EQ</field>
<value name="A">
<block type="text_getSubstring" id="Q*?o:xkji3=g)4?WPBHQ">
<mutation at1="true" at2="false"></mutation>
<field name="WHERE1">FROM_START</field>
<field name="WHERE2">LAST</field>
<value name="STRING">
<block type="get_value" id="U~gaF0o1@ox[H|qcJxO@">
<field name="ATTR">val</field>
<field name="OID">cloud.0.services.ifttt</field>
</block>
</value>
<value name="AT1">
<block type="math_number" id="~1M}y.^Y%1mzuh09|rbB">
<field name="NUM">4</field>
</block>
</value>
</block>
</value>
<value name="B">
<block type="text" id="9wgOhlOQ3Ey8I5l?hL!r">
<field name="TEXT">00_exited</field>
</block>
</value>
</block>
</value>
<statement name="DO0">
<block type="update" id="l97xTIQ=i6WEMKHlrjC`">
<mutation delay_input="false"></mutation>
<field name="OID">MyVariable.0.GPS.Sebastian.wg_zimmer</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE">
<block type="logic_boolean" id="6HZb~)=(vAyUCY#XJ@Bf">
<field name="BOOL">FALSE</field>
</block>
</value>
</block>
</statement>
<next>
<block type="comment" id="K[6Hchpvp%xuA];?SJGb">
<field name="COMMENT">Arbeit</field>
<next>
<block type="controls_if" id="tKXsb?9,iUV#ZWgr^mNK">
<value name="IF0">
<block type="logic_compare" id="*tLj{(Th6cf|l`([Yo,v">
<field name="OP">EQ</field>
<value name="A">
<block type="text_getSubstring" id="}EUf4%{IP@jes8zR3EMD">
<mutation at1="true" at2="false"></mutation>
<field name="WHERE1">FROM_START</field>
<field name="WHERE2">LAST</field>
<value name="STRING">
<block type="get_value" id="liOj@i~p!O]6XI8WPv-k">
<field name="ATTR">val</field>
<field name="OID">cloud.0.services.ifttt</field>
</block>
</value>
<value name="AT1">
<block type="math_number" id="jEu|j)woT)d.{EPG]`%N">
<field name="NUM">4</field>
</block>
</value>
</block>
</value>
<value name="B">
<block type="text" id="TEL/0uNPnF:vt?P:-G,p">
<field name="TEXT">01_entered</field>
</block>
</value>
</block>
</value>
<statement name="DO0">
<block type="update" id="?NS?3Y2%i`_v4/btUBg;">
<mutation delay_input="false"></mutation>
<field name="OID">MyVariable.0.GPS.Sebastian.auf_arbeit</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE">
<block type="logic_boolean" id="sY=ypX5noRi5c%8YG},9">
<field name="BOOL">TRUE</field>
</block>
</value>
<next>
<block type="update" id="]:9GCCS_S`D0K3C9g@?%">
<mutation delay_input="false"></mutation>
<field name="OID">MyVariable.0.GPS.Sebastian.wg_zimmer</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE">
<block type="logic_boolean" id="N)gKB67T|Mr|vW{th1x?">
<field name="BOOL">FALSE</field>
</block>
</value>
<next>
<block type="update" id="U4az-:XHJ%dDA=tBTeF(">
<mutation delay_input="false"></mutation>
<field name="OID">MyVariable.0.GPS.Sebastian.bei_noemi_zuhause</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE">
<block type="logic_boolean" id="B3{h#!e^bP@I}XC`O=y0">
<field name="BOOL">FALSE</field>
</block>
</value>
</block>
</next>
</block>
</next>
</block>
</statement>
<next>
<block type="controls_if" id="cOx*.9Dxl@p7*d8iUZ(Q">
<value name="IF0">
<block type="logic_compare" id="E5.uRme)_TPonqR;(P(|">
<field name="OP">EQ</field>
<value name="A">
<block type="text_getSubstring" id="(3iw,Sl0^S,KpKRdgsi!">
<mutation at1="true" at2="false"></mutation>
<field name="WHERE1">FROM_START</field>
<field name="WHERE2">LAST</field>
<value name="STRING">
<block type="get_value" id="oY@%n14Ob:`St49`J0;3">
<field name="ATTR">val</field>
<field name="OID">cloud.0.services.ifttt</field>
</block>
</value>
<value name="AT1">
<block type="math_number" id=")[s:Ut4izra^zj,94m)N">
<field name="NUM">4</field>
</block>
</value>
</block>
</value>
<value name="B">
<block type="text" id="s^^_Y7UKY9qW_P(#O-{G">
<field name="TEXT">01_exited</field>
</block>
</value>
</block>
</value>
<statement name="DO0">
<block type="update" id="zVUvdLvA%6sOV2B:0?B~">
<mutation delay_input="false"></mutation>
<field name="OID">MyVariable.0.GPS.Sebastian.auf_arbeit</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE">
<block type="logic_boolean" id="[Dd6vcFXnfxP[#kRA@d/">
<field name="BOOL">FALSE</field>
</block>
</value>
</block>
</statement>
<next>
<block type="comment" id="m:Smr%S.J|?d]E)`o[mB">
<field name="COMMENT">Bei der Freundin</field>
<next>
<block type="controls_if" id="*P@2}K3[e7yq9xSqwxzW">
<value name="IF0">
<block type="logic_compare" id="f0Ry]~]W.b]cILL2tl5A">
<field name="OP">EQ</field>
<value name="A">
<block type="text_getSubstring" id="|O=0:Z*!v9OUyIhkoLV%">
<mutation at1="true" at2="false"></mutation>
<field name="WHERE1">FROM_START</field>
<field name="WHERE2">LAST</field>
<value name="STRING">
<block type="get_value" id="HO2zjh_ajJ#d8a_BL?l3">
<field name="ATTR">val</field>
<field name="OID">cloud.0.services.ifttt</field>
</block>
</value>
<value name="AT1">
<block type="math_number" id="6Ovh*_k]a7Fn6?`9_!|]">
<field name="NUM">4</field>
</block>
</value>
</block>
</value>
<value name="B">
<block type="text" id="4rbuIurN?yQmjVoMkfoj">
<field name="TEXT">02_exited</field>
</block>
</value>
</block>
</value>
<statement name="DO0">
<block type="update" id="7R~Ox49v0CBz}J%?K[Jq">
<mutation delay_input="false"></mutation>
<field name="OID">MyVariable.0.GPS.Sebastian.bei_noemi_zuhause</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE">
<block type="logic_boolean" id="EDW+Mgv(,m2qyKJ1CZ(;">
<field name="BOOL">TRUE</field>
</block>
</value>
<next>
<block type="update" id="BzozI!)MFXXe0FbQEHsq">
<mutation delay_input="false"></mutation>
<field name="OID">MyVariable.0.GPS.Sebastian.wg_zimmer</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE">
<block type="logic_boolean" id="AGb.|KNs{`1]eRBm-0Om">
<field name="BOOL">FALSE</field>
</block>
</value>
<next>
<block type="update" id="R,s4fZgbH;zPC@8:q`H1">
<mutation delay_input="false"></mutation>
<field name="OID">MyVariable.0.GPS.Sebastian.auf_arbeit</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE">
<block type="logic_boolean" id="%6)vb?xC:GYBK+nMOl;B">
<field name="BOOL">FALSE</field>
</block>
</value>
</block>
</next>
</block>
</next>
</block>
</statement>
<next>
<block type="controls_if" id="j[0N-,s=FK!fYP+vWekA">
<value name="IF0">
<block type="logic_compare" id="95p~|DhAGDp-=i3k~qBu">
<field name="OP">EQ</field>
<value name="A">
<block type="text_getSubstring" id="IHolv%n(t=h8uVpWfyWG">
<mutation at1="true" at2="false"></mutation>
<field name="WHERE1">FROM_START</field>
<field name="WHERE2">LAST</field>
<value name="STRING">
<block type="get_value" id="3eUY%2(s/%fQJbo91`|Q">
<field name="ATTR">val</field>
<field name="OID">cloud.0.services.ifttt</field>
</block>
</value>
<value name="AT1">
<block type="math_number" id="0ZiP=p1AGw|ZIJ}QJzwc">
<field name="NUM">4</field>
</block>
</value>
</block>
</value>
<value name="B">
<block type="text" id="LrsQR,cBON{zo+(^,UrN">
<field name="TEXT">02_entered</field>
</block>
</value>
</block>
</value>
<statement name="DO0">
<block type="update" id="_O444PFtu]MyPM4{45Rf">
<mutation delay_input="false"></mutation>
<field name="OID">MyVariable.0.GPS.Sebastian.bei_noemi_zuhause</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE">
<block type="logic_boolean" id="A}wkJ_];#j6X0,mz_w:f">
<field name="BOOL">TRUE</field>
</block>
</value>
</block>
</statement>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</statement>
<next>
<block type="comment" id="F=ceoD;jZ+TQ~O34BSrU">
<field name="COMMENT">Auswertung_für_meine_Freundin</field>
<next>
<block type="controls_if" id="FppZO`?!]`4Rne0-JHUN">
<value name="IF0">
<block type="logic_compare" id="*5;dIS74E0-m_HX{2dd|">
<field name="OP">EQ</field>
<value name="A">
<block type="text_getSubstring" id="9KkXtMI;pyYz..a0o5Y)">
<mutation at1="false" at2="true"></mutation>
<field name="WHERE1">FIRST</field>
<field name="WHERE2">FROM_START</field>
<value name="STRING">
<block type="get_value" id="u6b!b1Rs:er#1m~KLO#p">
<field name="ATTR">val</field>
<field name="OID">cloud.0.services.ifttt</field>
</block>
</value>
<value name="AT2">
<block type="math_number" id=".%tgVA*=BbeAkpCX]7wp">
<field name="NUM">2</field>
</block>
</value>
</block>
</value>
<value name="B">
<block type="text" id="r|+~tAEA08rXpL6}~#*s">
<field name="TEXT">01</field>
</block>
</value>
</block>
</value>
<statement name="DO0">
<block type="comment" id="i1Nr%]pTmw*C)?xzS`T)">
<field name="COMMENT">Bei PlayDiver daheim</field>
<next>
<block type="controls_if" id=".qWD`u6k^lD%8FYec)xc">
<value name="IF0">
<block type="logic_compare" id="CvIJ~?Dz]^#)fS#JWx4i">
<field name="OP">EQ</field>
<value name="A">
<block type="text_getSubstring" id="=]7PY)9_v%b?~fGd@;Zo">
<mutation at1="true" at2="false"></mutation>
<field name="WHERE1">FROM_START</field>
<field name="WHERE2">LAST</field>
<value name="STRING">
<block type="get_value" id="r37nUmkX|;sLA6@S92W)">
<field name="ATTR">val</field>
<field name="OID">cloud.0.services.ifttt</field>
</block>
</value>
<value name="AT1">
<block type="math_number" id="a,A-H[l/Jo^i@J[HmpL:">
<field name="NUM">4</field>
</block>
</value>
</block>
</value>
<value name="B">
<block type="text" id="-4Ks{Hl3gm|FQA|Z;,`u">
<field name="TEXT">00_entered</field>
</block>
</value>
</block>
</value>
<statement name="DO0">
<block type="update" id="O*4iYD|Q+!Ob+8T`ppN6">
<mutation delay_input="false"></mutation>
<field name="OID">MyVariable.0.GPS.Noemi.wg_sebastian</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE">
<block type="logic_boolean" id="Q#AEkH=eiwWj|WkjJ9~a">
<field name="BOOL">TRUE</field>
</block>
</value>
<next>
<block type="update" id="pqGq+EoUJEgE@B5gC}R1">
<mutation delay_input="false"></mutation>
<field name="OID">MyVariable.0.GPS.Noemi.zuhause</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE">
<block type="logic_boolean" id="SEN@8XMke.`QLKb.~bQ;">
<field name="BOOL">FALSE</field>
</block>
</value>
</block>
</next>
</block>
</statement>
<next>
<block type="controls_if" id="Rpk7qjtd*-Xk{wJdPP+_">
<value name="IF0">
<block type="logic_compare" id=")qzAugF,IsBI3kc8vvxy">
<field name="OP">EQ</field>
<value name="A">
<block type="text_getSubstring" id="~IA_E:oc@^J#.;VsAnHB">
<mutation at1="true" at2="false"></mutation>
<field name="WHERE1">FROM_START</field>
<field name="WHERE2">LAST</field>
<value name="STRING">
<block type="get_value" id="Wk}IYwd]T3Kgyn}lFzRP">
<field name="ATTR">val</field>
<field name="OID">cloud.0.services.ifttt</field>
</block>
</value>
<value name="AT1">
<block type="math_number" id="3jL^wVgZwJY6{8v~{bu%">
<field name="NUM">4</field>
</block>
</value>
</block>
</value>
<value name="B">
<block type="text" id="}ii!zc])Em(f5b!Xgj-t">
<field name="TEXT">00_exited</field>
</block>
</value>
</block>
</value>
<statement name="DO0">
<block type="update" id="qeZaWxL:h[GXX[DBJmey">
<mutation delay_input="false"></mutation>
<field name="OID">MyVariable.0.GPS.Noemi.wg_sebastian</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE">
<block type="logic_boolean" id="mh#8Vg_8.-.8dpdl2|l}">
<field name="BOOL">FALSE</field>
</block>
</value>
</block>
</statement>
<next>
<block type="comment" id="@k?upX2n7(C15N~R;dC%">
<field name="COMMENT">Zuhause </field>
<next>
<block type="controls_if" id=";{.Ep/l?anpo`i=Nb1[y">
<value name="IF0">
<block type="logic_compare" id="{:ReETE}4;n~p6Aq3XQ;">
<field name="OP">EQ</field>
<value name="A">
<block type="text_getSubstring" id="3[qSH;SJFgK2d|W=@3fg">
<mutation at1="true" at2="false"></mutation>
<field name="WHERE1">FROM_START</field>
<field name="WHERE2">LAST</field>
<value name="STRING">
<block type="get_value" id="p(.J]{Zt(VK+vJ{%*FP+">
<field name="ATTR">val</field>
<field name="OID">cloud.0.services.ifttt</field>
</block>
</value>
<value name="AT1">
<block type="math_number" id=".0x/M7?a5qsqT~wnVmRw">
<field name="NUM">4</field>
</block>
</value>
</block>
</value>
<value name="B">
<block type="text" id="/03F0H#Cqs9aBWeeL[ky">
<field name="TEXT">01_entered</field>
</block>
</value>
</block>
</value>
<statement name="DO0">
<block type="update" id="b/H9~Ts,jDo79MtoNV7_">
<mutation delay_input="false"></mutation>
<field name="OID">MyVariable.0.GPS.Noemi.zuhause</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE">
<block type="logic_boolean" id="Y81Wt;v*{(J~+3[xIMx/">
<field name="BOOL">TRUE</field>
</block>
</value>
<next>
<block type="update" id="W:-6K3{d=0HOFk5hln{:">
<mutation delay_input="false"></mutation>
<field name="OID">MyVariable.0.GPS.Noemi.wg_sebastian</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE">
<block type="logic_boolean" id="#0QdMZTt@q#}(PB%S^;t">
<field name="BOOL">FALSE</field>
</block>
</value>
</block>
</next>
</block>
</statement>
<next>
<block type="controls_if" id="vSK/{9KtHs-Znfg0ZWlb">
<value name="IF0">
<block type="logic_compare" id="v.FN^[Zrx4GqfbsdE(eD">
<field name="OP">EQ</field>
<value name="A">
<block type="text_getSubstring" id="An-8)^ZDwKfj.#H?(H}2">
<mutation at1="true" at2="false"></mutation>
<field name="WHERE1">FROM_START</field>
<field name="WHERE2">LAST</field>
<value name="STRING">
<block type="get_value" id="91QB2VIuIM]dtB7%^#sy">
<field name="ATTR">val</field>
<field name="OID">cloud.0.services.ifttt</field>
</block>
</value>
<value name="AT1">
<block type="math_number" id="NO0*7)bSBKJ[B[60648[">
<field name="NUM">4</field>
</block>
</value>
</block>
</value>
<value name="B">
<block type="text" id="Pf37?[iD{1r46GLba[1K">
<field name="TEXT">01_exited</field>
</block>
</value>
</block>
</value>
<statement name="DO0">
<block type="update" id="7a@NA{9|Y~qElTN#%(Uc">
<mutation delay_input="false"></mutation>
<field name="OID">MyVariable.0.GPS.Noemi.zuhause</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE">
<block type="logic_boolean" id="1{.d%*v@LO--)/j{xiJ+">
<field name="BOOL">FALSE</field>
</block>
</value>
</block>
</statement>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</statement>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</statement>
</block>
</xml>
Alles anzeigen
Der Wert wird dann in zwei teilen gebrochen:
00_01_entered
Sagt an wer es ist.
Sagt an um welchen Ort es geht und ob man kommt oder geht.
Somit kann man mit einen Cloud-Apdatper mehre Fusionen ausführen.
Man muss nur mehre IFTTT Anwendungen die alle auf den gleichen Cloud-Apdatper geht.