Hallo Allerseits,
ich habe 2 Alexa2 Instanzen und möchte, dass die Produkte aus alexa2.1.Lists.SHOPPING_LIST in alexa2.0.Lists.SHOPPING_LIST rein wandern. Aslo soll jedes Mal, wenn ein Produkt in Instanz 1 angelegt wird, dieser dort gelöscht und in Instanz 0 auftaucht. Wie würdet ihr sowas machen?
Hallo Allerseits,
ich habe 2 Alexa2 Instanzen und möchte, dass die Produkte aus alexa2.1.Lists.SHOPPING_LIST in alexa2.0.Lists.SHOPPING_LIST rein wandern. Aslo soll jedes Mal, wenn ein Produkt in Instanz 1 angelegt wird, dieser dort gelöscht und in Instanz 0 auftaucht. Wie würdet ihr sowas machen?
@ldittmar so müsste das passen ;)
noch als Code zum Importieren:
Spoiler
<xml xmlns="https://developers.google.com/blockly/xml">
<variables>
<variable id="$6{0dkeegN$(`C%3[7w}">Artikel</variable>
<variable id="$NEf?~zxZXR+=5K%uG#m">ID</variable>
<variable type="timeout" id="timeout">timeout</variable>
</variables>
<block type="on_ext" id="-`)S1Y}6hojWFl5k9STZ" x="-512" y="-9">
<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="^D!R4-um-pIP]JVvk7Ss">
<field name="oid">alexa2.0.Lists.SHOPPING_LIST.json</field>
</shadow>
</value>
<statement name="STATEMENT">
<block type="controls_if" id="o${pzU;%Nb}oI8m@MEc?">
<value name="IF0">
<block type="logic_compare" id="is30ZraWqH5?@ilZgOD#">
<field name="OP">NEQ</field>
<value name="A">
<block type="on_source" id="1$:C;ecn7ozv0brnfxGG">
<field name="ATTR">state.val</field>
</block>
</value>
<value name="B">
<block type="text" id="ZZ,[V;PNKu^jzH}GT2Z=">
<field name="TEXT">[]</field>
</block>
</value>
</block>
</value>
<statement name="DO0">
<block type="variables_set" id="uU052n.PygsZ@xutlL)T">
<field name="VAR" id="$6{0dkeegN$(`C%3[7w}">Artikel</field>
<value name="VALUE">
<block type="get_attr" id="@{;$|H|Gq@fQ9bC}Bcwe">
<value name="PATH">
<shadow type="text" id="%0;K+9aeOlT.`rdF(E55">
<field name="TEXT">0.value</field>
</shadow>
</value>
<value name="OBJECT">
<block type="on_source" id="vGFJOh.^.Z{k`Eb.5?T5">
<field name="ATTR">state.val</field>
</block>
</value>
</block>
</value>
<next>
<block type="variables_set" id="*7S,)0aj`1aJ1;DkSO5|">
<field name="VAR" id="$NEf?~zxZXR+=5K%uG#m">ID</field>
<value name="VALUE">
<block type="get_attr" id="4Pg:J8unuVO^8Xfw!ka.">
<value name="PATH">
<shadow type="text" id="hxYG`Pgc[|hE?@_JwqZ(">
<field name="TEXT">0.id</field>
</shadow>
</value>
<value name="OBJECT">
<block type="on_source" id="?7b#Gl)kkW05}{t]5)_o">
<field name="ATTR">state.val</field>
</block>
</value>
</block>
</value>
<next>
<block type="timeouts_settimeout" id="N;g6i}]2.qI5Afp{Bo(:">
<field name="NAME">timeout</field>
<field name="DELAY">2000</field>
<field name="UNIT">ms</field>
<statement name="STATEMENT">
<block type="control_ex" id="ibZR8FI-v9sq@B6T7my[">
<field name="TYPE">false</field>
<field name="CLEAR_RUNNING">FALSE</field>
<value name="OID">
<shadow type="field_oid" id="mf9t{RbdXnUpzA[T:_|s">
<field name="oid">Object ID</field>
</shadow>
<block type="text_join" id="`6~8a%uQF{-LlO7+Irv4">
<mutation items="3"></mutation>
<value name="ADD0">
<block type="text" id="_OKM)[h#6)=c65syMsv*">
<field name="TEXT">alexa2.1.Lists.SHOPPING_LIST.items.</field>
</block>
</value>
<value name="ADD1">
<block type="variables_get" id="e?7RDsFvNJqes*_[SXJw">
<field name="VAR" id="$NEf?~zxZXR+=5K%uG#m">ID</field>
</block>
</value>
<value name="ADD2">
<block type="text" id=".CF~`zVQPFeK^e11Bqwu">
<field name="TEXT">.#delete</field>
</block>
</value>
</block>
</value>
<value name="VALUE">
<shadow type="logic_boolean" id="0;ET=ls2fkBJ_NAi_BLN">
<field name="BOOL">TRUE</field>
</shadow>
</value>
<value name="DELAY_MS">
<shadow type="math_number" id="`aseKQ85-fHTg_^ey:+|">
<field name="NUM">0</field>
</shadow>
</value>
<next>
<block type="control_ex" id="ORxE`G5iz9@m=0+9-Yk2">
<field name="TYPE">false</field>
<field name="CLEAR_RUNNING">FALSE</field>
<value name="OID">
<shadow type="field_oid" id="mf9t{RbdXnUpzA[T:_|s">
<field name="oid">Object ID</field>
</shadow>
<block type="text" id="FVk!3v`P(%EC$d4BzCSd">
<field name="TEXT">alexa2.0.Lists.SHOPPING_LIST.#New</field>
</block>
</value>
<value name="VALUE">
<shadow type="logic_boolean" id="4F3$DPD94Hy!Dds]^ah(">
<field name="BOOL">TRUE</field>
</shadow>
<block type="variables_get" id="]^jXAk5q%Zl6Q[]ksAuE">
<field name="VAR" id="$6{0dkeegN$(`C%3[7w}">Artikel</field>
</block>
</value>
<value name="DELAY_MS">
<shadow type="math_number" id="g/mS}7(5RrKg!:9NY;=#">
<field name="NUM">0</field>
</shadow>
</value>
</block>
</next>
</block>
</statement>
</block>
</next>
</block>
</next>
</block>
</statement>
</block>
</statement>
</block>
</xml>
Der Trigger oben muss halt angepasst werden auf die JSON der zweiten Instanz ;)
@ldittmar so müsste das passen ;)
noch als Code zum Importieren:
Spoiler
<xml xmlns="https://developers.google.com/blockly/xml">
<variables>
<variable id="$6{0dkeegN$(`C%3[7w}">Artikel</variable>
<variable id="$NEf?~zxZXR+=5K%uG#m">ID</variable>
<variable type="timeout" id="timeout">timeout</variable>
</variables>
<block type="on_ext" id="-`)S1Y}6hojWFl5k9STZ" x="-512" y="-9">
<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="^D!R4-um-pIP]JVvk7Ss">
<field name="oid">alexa2.0.Lists.SHOPPING_LIST.json</field>
</shadow>
</value>
<statement name="STATEMENT">
<block type="controls_if" id="o${pzU;%Nb}oI8m@MEc?">
<value name="IF0">
<block type="logic_compare" id="is30ZraWqH5?@ilZgOD#">
<field name="OP">NEQ</field>
<value name="A">
<block type="on_source" id="1$:C;ecn7ozv0brnfxGG">
<field name="ATTR">state.val</field>
</block>
</value>
<value name="B">
<block type="text" id="ZZ,[V;PNKu^jzH}GT2Z=">
<field name="TEXT">[]</field>
</block>
</value>
</block>
</value>
<statement name="DO0">
<block type="variables_set" id="uU052n.PygsZ@xutlL)T">
<field name="VAR" id="$6{0dkeegN$(`C%3[7w}">Artikel</field>
<value name="VALUE">
<block type="get_attr" id="@{;$|H|Gq@fQ9bC}Bcwe">
<value name="PATH">
<shadow type="text" id="%0;K+9aeOlT.`rdF(E55">
<field name="TEXT">0.value</field>
</shadow>
</value>
<value name="OBJECT">
<block type="on_source" id="vGFJOh.^.Z{k`Eb.5?T5">
<field name="ATTR">state.val</field>
</block>
</value>
</block>
</value>
<next>
<block type="variables_set" id="*7S,)0aj`1aJ1;DkSO5|">
<field name="VAR" id="$NEf?~zxZXR+=5K%uG#m">ID</field>
<value name="VALUE">
<block type="get_attr" id="4Pg:J8unuVO^8Xfw!ka.">
<value name="PATH">
<shadow type="text" id="hxYG`Pgc[|hE?@_JwqZ(">
<field name="TEXT">0.id</field>
</shadow>
</value>
<value name="OBJECT">
<block type="on_source" id="?7b#Gl)kkW05}{t]5)_o">
<field name="ATTR">state.val</field>
</block>
</value>
</block>
</value>
<next>
<block type="timeouts_settimeout" id="N;g6i}]2.qI5Afp{Bo(:">
<field name="NAME">timeout</field>
<field name="DELAY">2000</field>
<field name="UNIT">ms</field>
<statement name="STATEMENT">
<block type="control_ex" id="ibZR8FI-v9sq@B6T7my[">
<field name="TYPE">false</field>
<field name="CLEAR_RUNNING">FALSE</field>
<value name="OID">
<shadow type="field_oid" id="mf9t{RbdXnUpzA[T:_|s">
<field name="oid">Object ID</field>
</shadow>
<block type="text_join" id="`6~8a%uQF{-LlO7+Irv4">
<mutation items="3"></mutation>
<value name="ADD0">
<block type="text" id="_OKM)[h#6)=c65syMsv*">
<field name="TEXT">alexa2.1.Lists.SHOPPING_LIST.items.</field>
</block>
</value>
<value name="ADD1">
<block type="variables_get" id="e?7RDsFvNJqes*_[SXJw">
<field name="VAR" id="$NEf?~zxZXR+=5K%uG#m">ID</field>
</block>
</value>
<value name="ADD2">
<block type="text" id=".CF~`zVQPFeK^e11Bqwu">
<field name="TEXT">.#delete</field>
</block>
</value>
</block>
</value>
<value name="VALUE">
<shadow type="logic_boolean" id="0;ET=ls2fkBJ_NAi_BLN">
<field name="BOOL">TRUE</field>
</shadow>
</value>
<value name="DELAY_MS">
<shadow type="math_number" id="`aseKQ85-fHTg_^ey:+|">
<field name="NUM">0</field>
</shadow>
</value>
<next>
<block type="control_ex" id="ORxE`G5iz9@m=0+9-Yk2">
<field name="TYPE">false</field>
<field name="CLEAR_RUNNING">FALSE</field>
<value name="OID">
<shadow type="field_oid" id="mf9t{RbdXnUpzA[T:_|s">
<field name="oid">Object ID</field>
</shadow>
<block type="text" id="FVk!3v`P(%EC$d4BzCSd">
<field name="TEXT">alexa2.0.Lists.SHOPPING_LIST.#New</field>
</block>
</value>
<value name="VALUE">
<shadow type="logic_boolean" id="4F3$DPD94Hy!Dds]^ah(">
<field name="BOOL">TRUE</field>
</shadow>
<block type="variables_get" id="]^jXAk5q%Zl6Q[]ksAuE">
<field name="VAR" id="$6{0dkeegN$(`C%3[7w}">Artikel</field>
</block>
</value>
<value name="DELAY_MS">
<shadow type="math_number" id="g/mS}7(5RrKg!:9NY;=#">
<field name="NUM">0</field>
</shadow>
</value>
</block>
</next>
</block>
</statement>
</block>
</next>
</block>
</next>
</block>
</statement>
</block>
</statement>
</block>
</xml>
Der Trigger oben muss halt angepasst werden auf die JSON der zweiten Instanz ;)
@djmarc75 Echt Hammer! Es funktioniert super :-) Danke!!
Hey! Du scheinst an dieser Unterhaltung interessiert zu sein, hast aber noch kein Konto.
Hast du es satt, bei jedem Besuch durch die gleichen Beiträge zu scrollen? Wenn du dich für ein Konto anmeldest, kommst du immer genau dorthin zurück, wo du zuvor warst, und kannst dich über neue Antworten benachrichtigen lassen (entweder per E-Mail oder Push-Benachrichtigung). Du kannst auch Lesezeichen speichern und Beiträge positiv bewerten, um anderen Community-Mitgliedern deine Wertschätzung zu zeigen.
Mit deinem Input könnte dieser Beitrag noch besser werden 💗
Registrieren
Anmelden