@fastfoot
der Erste Teil mit dem Schalten des Shellys läuft schon mal super! Oder fast
Ich hab einen "Fehler" den ich nicht nachvollziehen kann:
oder
<xml xmlns="http://www.w3.org/1999/xhtml">
<variables>
<variable type="" id="smfipXSz7c$2VGi]fdHq">user</variable>
</variables>
<block type="on_ext" id="`r[e|Zre^i1M[,4#LQb8" x="13" y="12">
<mutation items="1"></mutation>
<field name="CONDITION">ne</field>
<field name="ACK_CONDITION"></field>
<value name="OID0">
<shadow type="field_oid" id="p{9:o5Vc#A]O|ijP.6kH">
<field name="oid">mqtt.0.rfid.leser.send</field>
</shadow>
</value>
<statement name="STATEMENT">
<block type="variables_set" id="9zW]qjf1.oJ:*r(`Snhp">
<field name="VAR" id="smfipXSz7c$2VGi]fdHq" variabletype="">user</field>
<value name="VALUE">
<block type="get_attr" id="#OJnwsvskALVr7ICmA7E">
<value name="PATH">
<shadow type="text" id="?D?b78:-+x}`/|k;DtM;">
<field name="TEXT">username</field>
</shadow>
</value>
<value name="OBJECT">
<block type="on_source" id="]:H5pqerc{6Gyrkz1+P:">
<field name="ATTR">state.val</field>
</block>
</value>
</block>
</value>
<next>
<block type="controls_if" id="5Z}lU*NMnk]zNAgzO*W7">
<value name="IF0">
<block type="logic_compare" id="CgTx-f8!A72aCn4qgw!4">
<field name="OP">EQ</field>
<value name="A">
<block type="variables_get" id="82(vIy)iBDo#^9g7zX`h">
<field name="VAR" id="smfipXSz7c$2VGi]fdHq" variabletype="">user</field>
</block>
</value>
<value name="B">
<block type="text" id="+4Hvp,mBGMnKJVnTj_DY">
<field name="TEXT">Felix_Merk</field>
</block>
</value>
</block>
</value>
<statement name="DO0">
<block type="controls_if" id="5atN0y`}7v.,-CWFc{7+">
<mutation else="1"></mutation>
<value name="IF0">
<block type="logic_compare" id="t}Prj}J%L_3NhJWc3RFc">
<field name="OP">EQ</field>
<value name="A">
<block type="get_value" id="|2.+HO)ztM2;q[q!I.H6">
<field name="ATTR">val</field>
<field name="OID">shelly.0.SHSW-1#F4282B#2.Relay0.Switch</field>
</block>
</value>
<value name="B">
<block type="logic_boolean" id="x-jP*Fd?NV+Sp|hhl_1N">
<field name="BOOL">TRUE</field>
</block>
</value>
</block>
</value>
<statement name="DO0">
<block type="control" id="[0Pd9wpD:kB|qifUBtvQ">
<mutation delay_input="false"></mutation>
<field name="OID">shelly.0.SHSW-1#F4282B#2.Relay0.Switch</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE">
<block type="logic_boolean" id="VR-P7mpXpzO{e0)})fm)">
<field name="BOOL">FALSE</field>
</block>
</value>
</block>
</statement>
<statement name="ELSE">
<block type="control" id="i9zorrxcYyWgt:Owx]S/">
<mutation delay_input="false"></mutation>
<field name="OID">shelly.0.SHSW-1#F4282B#2.Relay0.Switch</field>
<field name="WITH_DELAY">FALSE</field>
<value name="VALUE">
<block type="logic_boolean" id="}]GVlr$BK-~JwT1~|tv0">
<field name="BOOL">TRUE</field>
</block>
</value>
</block>
</statement>
</block>
</statement>
</block>
</next>
</block>
</statement>
</block>
</xml>
BlocklyJavascriptTypeScript
Protokoll
Ausgewählte Blöcke exportieren
<xml xmlns="http://www.w3.org/1999/xhtml">
<variables>
<variable type="" id="smfipXSz7c$2VGi]fdHq">user</variable>
</variables>
<block type="on_ext" id="`r[e|Zre^i1M[,4#LQb8" x="13" y="12">
<mutation items="1"></mutation>
<field name="CONDITION">ne</field>
<field name="ACK_CONDITION"></field>
<value name="OID0">
<shadow type="field_oid" id="p{9:o5Vc#A]O|ijP.6kH">
<field name="oid">mqtt.0.rfid.leser.send</field>
</shadow>
</value>
<statement name="STATEMENT">
<block type="variables_set" id="9zW]qjf1.oJ:*r(`Snhp">
<field name="VAR" id="smfipXSz7c$2VGi]fdHq" variabletype="">user</field>
<value name="VALUE">
<block type="get_attr" id="#OJnwsvskALVr7ICmA7E">
<value name="PATH">
<shadow type="text" id="?D?b78:-+x}`/|k;DtM;">
<field name="TEXT">username</field>
</shadow>
</value>
<value name="OBJECT">
<block type="on_source" id="]:H5pqerc{6Gyrkz1+P:">
<field name="ATTR">state.val</field>
</block>
</value>
</block>
</value>
<next>
<block type="controls_if" id="5Z}lU*NMnk]zNAgzO*W7">
<value name="IF0">
<block type="logic_compare" id="CgTx-f8!A72aCn4qgw!4">
<field name="OP">EQ</field>
<value name="A">
<block type="variables_get" id="82(vIy)iBDo#^9g7zX`h">
<field name="VAR" id="smfipXSz7c$2VGi]fdHq" variabletype="">user</field>
</block>
</value>
<value name="B">
<block type="text" id="+4Hvp,mBGMnKJVnTj_DY">
<field name="TEXT">Felix_Merk</field>
</block>
</value>
</block>
</value>
<statement name="DO0">
<block type="toggle" id="O^Dz6KQS3aV=x*=SUJHd">
<mutation delay_input="false"></mutation>
<field name="OID">shelly.0.SHSW-1#F4282B#2.Relay0.Switch</field>
<field name="WITH_DELAY">FALSE</field>
</block>
</statement>
</block>
</next>
</block>
</statement>
</block>
</xml>
<xml xmlns="http://www.w3.org/1999/xhtml">
<variables>
<variable type="" id="smfipXSz7c$2VGi]fdHq">user</variable>
</variables>
<block type="on_ext" id="`r[e|Zre^i1M[,4#LQb8" x="13" y="12">
<mutation items="1"></mutation>
<field name="CONDITION">ne</field>
<field name="ACK_CONDITION"></field>
<value name="OID0">
<shadow type="field_oid" id="p{9:o5Vc#A]O|ijP.6kH">
<field name="oid">mqtt.0.rfid.leser.send</field>
</shadow>
</value>
<statement name="STATEMENT">
<block type="variables_set" id="9zW]qjf1.oJ:*r(`Snhp">
<field name="VAR" id="smfipXSz7c$2VGi]fdHq" variabletype="">user</field>
<value name="VALUE">
<block type="get_attr" id="#OJnwsvskALVr7ICmA7E">
<value name="PATH">
<shadow type="text" id="?D?b78:-+x}`/|k;DtM;">
<field name="TEXT">username</field>
</shadow>
</value>
<value name="OBJECT">
<block type="on_source" id="]:H5pqerc{6Gyrkz1+P:">
<field name="ATTR">state.val</field>
</block>
</value>
</block>
</value>
<next>
<block type="controls_if" id="5Z}lU*NMnk]zNAgzO*W7">
<value name="IF0">
<block type="logic_compare" id="CgTx-f8!A72aCn4qgw!4">
<field name="OP">EQ</field>
<value name="A">
<block type="variables_get" id="82(vIy)iBDo#^9g7zX`h">
<field name="VAR" id="smfipXSz7c$2VGi]fdHq" variabletype="">user</field>
</block>
</value>
<value name="B">
<block type="text" id="+4Hvp,mBGMnKJVnTj_DY">
<field name="TEXT">Felix_Merk</field>
</block>
</value>
</block>
</value>
<statement name="DO0">
<block type="toggle" id="O^Dz6KQS3aV=x*=SUJHd">
<mutation delay_input="false"></mutation>
<field name="OID">shelly.0.SHSW-1#F4282B#2.Relay0.Switch</field>
<field name="WITH_DELAY">FALSE</field>
</block>
</statement>
</block>
</next>
</block>
</statement>
</block>
</xml>
Wenn der shelly aus ist (false) und ich hebe den RFID tag ran, geht das Licht an, wie es soll. Wenn ich ich den Tag aber nochmal hinhalte passiert nichts. Erst beim zweiten mal hinhalten (Zeit spielt keine Rolle) geht das Licht wieder aus.
Lässt sich beliebig oft wiederholen.... beim ausschalten muss ich immer zweimal hinhalten.
An was liegt das?
Liebe Grüße