Hallo, ich habe heute ein bisschen gegoogelt und bin darauf gestoßen das man einen normalen Wechselschalter Smart machen kann und verschiedene Geräte ([definition='25','0']Sonoff[/definition], Steckdosen etc.) Smart schalten kann.
Da ich keinen Taster zur Hand hatte bin ich auf den Kugelschreiber Trick gestoßen
Da ich aber im Blockly schreiben noch ziemlich am Anfang stehe benötige ich folgende Hilfe. Wie kann ich erreichen das der Taster nach langer Betätigung den Dual [definition='25','0']Sonoff[/definition] und die [definition='60','0']Osram[/definition] Steckdose auf off schaltet. Es müssten also bei langer Betätigung die Lampen abgefragt werden und die wo an sind dann abzuschalten.
Code
<xml xmlns="http://www.w3.org/1999/xhtml">
<block type="on_ext" id="V7P|6xmV3G,ni~jHG]*O" x="-1937" y="-1212">
<mutation items="4"></mutation>
<field name="CONDITION">ne</field>
<field name="ACK_CONDITION"></field>
<value name="OID0">
<shadow type="field_oid" id="N1pdo/5H[:5PyNXhgvK2">
<field name="oid">zigbee.0.00158d0002091521.click</field>
</shadow>
</value>
<value name="OID1">
<shadow type="field_oid" id="=aPr0x52!*^bg1LcR/Gs">
<field name="oid">zigbee.0.00158d0002091521.double_click</field>
</shadow>
</value>
<value name="OID2">
<shadow type="field_oid" id="uL!6a4IqJ,hZZH*6V9tm">
<field name="oid">zigbee.0.00158d0002091521.triple_click</field>
</shadow>
</value>
<value name="OID3">
<shadow type="field_oid" id="U6JlQv+IrjpM::trG1J`">
<field name="oid">zigbee.0.00158d0001e75a97.long_click</field>
</shadow>
</value>
<statement name="STATEMENT">
<block type="controls_if" id=")~WmF+*DFn%BCQa9X~KA">
<value name="IF0">
<block type="get_value" id="6I@s%F_L|1k_]oDV!M61">
<field name="ATTR">val</field>
<field name="OID">zigbee.0.00158d0002091521.click</field>
</block>
</value>
<statement name="DO0">
<block type="toggle" id="%J0=y^cW{lQnh)zLY^y[">
<mutation delay_input="false"></mutation>
<field name="OID">[definition='84','0']sonoff[/definition].0.Bad Licht.POWER2</field>
<field name="WITH_DELAY">FALSE</field>
</block>
</statement>
<next>
<block type="controls_if" id="HO9xo:.UJg~3)9Hj2[^v">
<value name="IF0">
<block type="get_value" id="k0IhjX9DPOjs=FJ{E,Zz">
<field name="ATTR">val</field>
<field name="OID">zigbee.0.00158d0002091521.double_click</field>
</block>
</value>
<statement name="DO0">
<block type="toggle" id="tBc15)SeXqbMQ%]scNme">
<mutation delay_input="false"></mutation>
<field name="OID">[definition='84','0']sonoff[/definition].0.Bad Licht.POWER1</field>
<field name="WITH_DELAY">FALSE</field>
</block>
</statement>
<next>
<block type="controls_if" id="!M.!Vdo?3L;=H*dl-mTP">
<value name="IF0">
<block type="get_value" id="wj}DI*gbg}5[Dl77?(oA">
<field name="ATTR">val</field>
<field name="OID">zigbee.0.00158d0002091521.triple_click</field>
</block>
</value>
<statement name="DO0">
<block type="toggle" id="h[aP^qwmVhO?Yoqn)XVu">
<mutation delay_input="false"></mutation>
<field name="OID">alexa2.0.Smart-Home-Devices.3c4c0cc4-29c5-465e-b723-2fcf9e7ca284.powerState</field>
<field name="WITH_DELAY">FALSE</field>
</block>
</statement>
<next>
<block type="controls_if" id="USrEY0[R-hNSXkkPE@M|">
<value name="IF0">
<block type="get_value" id="8]bQ:;9jVpzsl9.3XEIe">
<field name="ATTR">val</field>
<field name="OID">zigbee.0.00158d0002091521.long_click</field>
</block>
</value>
<statement name="DO0">
<block type="controls_if" id="w?/T#fvouE*K3}o)8-Zh">
<value name="IF0">
<block type="logic_compare" id="Iog^#_K}Jz00P4=iRuh}">
<field name="OP">EQ</field>
<value name="A">
<block type="get_value" id="N9yf?o/jF8alS{sYd)_g">
<field name="ATTR">val</field>
<field name="OID">[definition='84','0']sonoff[/definition].0.Bad Licht.POWER2</field>
</block>
</value>
<value name="B">
<block type="logic_boolean" id="0Zd[8u0#q=6pdqPW,G0Z">
<field name="BOOL">TRUE</field>
</block>
</value>
</block>
</value>
<statement name="DO0">
<block type="toggle" id="b#6:@@paM+972|C(Q{xd">
<mutation delay_input="false"></mutation>
<field name="OID">[definition='84','0']sonoff[/definition].0.Bad Licht.POWER2</field>
<field name="WITH_DELAY">FALSE</field>
</block>
</statement>
<next>
<block type="controls_if" id="|(CS}WyEx7zZ1L00N{Na">
<value name="IF0">
<block type="logic_compare" id="VEcU**d_yL{T,pg|Ct5[">
<field name="OP">EQ</field>
<value name="A">
<block type="get_value" id="UbHOv0a~^LK^#|l}-Y^Z">
<field name="ATTR">val</field>
<field name="OID">[definition='84','0']sonoff[/definition].0.Bad Licht.POWER1</field>
</block>
</value>
<value name="B">
<block type="logic_boolean" id="3GBEG78GlMDNgf*j[W3)">
<field name="BOOL">TRUE</field>
</block>
</value>
</block>
</value>
<statement name="DO0">
<block type="toggle" id="@^JbkA@j`5,PjJu?~1*h">
<mutation delay_input="false"></mutation>
<field name="OID">[definition='84','0']sonoff[/definition].0.Bad Licht.POWER1</field>
<field name="WITH_DELAY">FALSE</field>
</block>
</statement>
<next>
<block type="controls_if" id="x[|{Q#WpHObYIac2t0bu">
<value name="IF0">
<block type="logic_compare" id="ru|?6^kN@4=R;86:`t+R">
<field name="OP">EQ</field>
<value name="A">
<block type="get_value" id="1adYmdO_5JiGT1U_DxX4">
<field name="ATTR">val</field>
<field name="OID">alexa2.0.Smart-Home-Devices.3c4c0cc4-29c5-465e-b723-2fcf9e7ca284.powerState</field>
</block>
</value>
<value name="B">
<block type="logic_boolean" id="B@V]5oEYM3ile0UOI|aj">
<field name="BOOL">TRUE</field>
</block>
</value>
</block>
</value>
<statement name="DO0">
<block type="toggle" id="O0v^C,mV!r4Nnz-x_h8k">
<mutation delay_input="false"></mutation>
<field name="OID">alexa2.0.Smart-Home-Devices.3c4c0cc4-29c5-465e-b723-2fcf9e7ca284.powerState</field>
<field name="WITH_DELAY">FALSE</field>
</block>
</statement>
</block>
</next>
</block>
</next>
</block>
</statement>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</statement>
</block>
</xml>
Alles anzeigen