NEWS
Blockly zum Ändern der Positionsangaben Rollo
-
Ich möchte die Positionsangabe der Rollos, welche der Shelly 2.5 ausgibt, nach meinen Wünschen anpassen. So soll z.B. die Positionsangabe des Shelly mit 15 % offen (entspricht einem geschlossenen Rollo, bei dem die Lamellenschlitze noch offen sind, der Rollo jedoch schon unten ansteht) geändert werden auf 5 %.
Dazu habe ich mir ein Blockly-Script geschrieben, das aber nicht funktioniert. Den neuen Datenpunkt (Shelly-Wert-neu) habe ich angelegt.
Wo ist denn mein Denkfehler?
<xml xmlns="https://developers.google.com/blockly/xml"> <variables> <variable id="C($g)F)mIe0cUak4m7zM">Shelly-Wert-neu</variable> </variables> <block type="on_ext" id="|{gw`ZoJ#V}kw4dBMwk]" x="263" y="63"> <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="S]dcw+X(5_IlE9}oi$@|"> <field name="oid">shelly.0.SHSW-25#5DB000#1.Shutter.Position</field> </shadow> </value> <statement name="STATEMENT"> <block type="controls_if" id="{r8}GZQ.[1pQq2zM$chY"> <value name="IF0"> <block type="logic_compare" id=",[{bq(%o{Dh1l)h|=hq?"> <field name="OP">EQ</field> <value name="A"> <block type="get_value" id="prjKy*Vi:DEHo:(;js+@"> <field name="ATTR">val</field> <field name="OID">shelly.0.SHSW-25#5DB000#1.Shutter.Position</field> </block> </value> <value name="B"> <block type="math_number" id="Lx+6%c6:#ks^,@4G2gEY"> <field name="NUM">15</field> </block> </value> </block> </value> <statement name="DO0"> <block type="variables_set" id="j.j^qMO4d{hjsx?.SBa}"> <field name="VAR" id="C($g)F)mIe0cUak4m7zM">Shelly-Wert-neu</field> <value name="VALUE"> <block type="math_number" id="dNsO-)+otIn,2:m~fzs$"> <field name="NUM">5</field> </block> </value> </block> </statement> <next> <block type="controls_if" id="a_)|3?w3^=ii5L.a02]6"> <value name="IF0"> <block type="logic_compare" id="5x~:@IR@O2+M{R(:Euwn"> <field name="OP">EQ</field> <value name="A"> <block type="get_value" id="PnXq|*5#qxGZuSHV9g3T"> <field name="ATTR">val</field> <field name="OID">shelly.0.SHSW-25#5DB000#1.Shutter.Position</field> </block> </value> <value name="B"> <block type="math_number" id="*iEf,D9d^O2jpG|2UOjV"> <field name="NUM">100</field> </block> </value> </block> </value> <statement name="DO0"> <block type="variables_set" id="7nm1E6=#:8J{.ah=(swb"> <field name="VAR" id="C($g)F)mIe0cUak4m7zM">Shelly-Wert-neu</field> <value name="VALUE"> <block type="math_number" id="*ut|/0O27@Iad2aM3%:4"> <field name="NUM">99</field> </block> </value> </block> </statement> </block> </next> </block> </statement> </block> </xml>
-
@erich-1
du setzt eine Variable " Shelly-wert-neu" kein Datenpunkt. Daten Punkt wird damit gesetzt, kommt aus SystemAlternative
-
@tt-tom Hab jetzt mal geändert, aber der Datenpunkt wird immer noch nicht gesetzt. Irgend etwa übersehe ich noch.
<xml xmlns="https://developers.google.com/blockly/xml"> <block type="on_ext" id="|{gw`ZoJ#V}kw4dBMwk]" x="263" y="63"> <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="S]dcw+X(5_IlE9}oi$@|"> <field name="oid">shelly.0.SHSW-25#5DB000#1.Shutter.Position</field> </shadow> </value> <statement name="STATEMENT"> <block type="logic_switch_case" id="J5+Sw5u*H)@h2.OdkXqe"> <value name="CONDITION"> <block type="on_source" id="DhVtogbeFLWeKZvrI0V?"> <field name="ATTR">state.val</field> </block> </value> <value name="CASECONDITION0"> <block type="math_number" id="Lx+6%c6:#ks^,@4G2gEY"> <field name="NUM">15</field> </block> </value> <statement name="CASE0"> <block type="control" id="z*vtpN69cJ^v]2shH]+."> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">0_userdata.0.Datenpunkte.Rollopositionen.Shelly-Wert-neu</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="math_number" id=")Lj`UaVz~ef+Gv~`Cq$x"> <field name="NUM">5</field> </block> </value> </block> </statement> <next> <block type="logic_switch_case" id="Yp.+iRAuArFlNdF;v^=Z"> <value name="CONDITION"> <block type="on_source" id="x(_nh!8S,x=QX+u+9uz]"> <field name="ATTR">state.val</field> </block> </value> <value name="CASECONDITION0"> <block type="math_number" id="rE|PmuFIj|K-jDe~^9}D"> <field name="NUM">25</field> </block> </value> <statement name="CASE0"> <block type="control" id=";y[pl=s~Aq):M!DE5H$H"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">0_userdata.0.Datenpunkte.Rollopositionen.Shelly-Wert-neu</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="math_number" id="c=~NkSa0!iGAu{K8Wmzo"> <field name="NUM">20</field> </block> </value> </block> </statement> <next> <block type="logic_switch_case" id="d*-`d%cC[[G0eU/8mB),"> <value name="CONDITION"> <block type="on_source" id="z~kt)9TexJXh7V+:Ll6Q"> <field name="ATTR">state.val</field> </block> </value> <value name="CASECONDITION0"> <block type="math_number" id="ie_J],Q2%*UsGQ]u[NoT"> <field name="NUM">100</field> </block> </value> <statement name="CASE0"> <block type="control" id="2nago5cu_F.Jw[dh^jAS"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">0_userdata.0.Datenpunkte.Rollopositionen.Shelly-Wert-neu</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="math_number" id=".g!dbOPspHNX@I9Rrj`!"> <field name="NUM">99</field> </block> </value> </block> </statement> </block> </next> </block> </next> </block> </statement> </block> </xml>
-
probiere bitte mal das und poste auch mal das log dazu
<block xmlns="https://developers.google.com/blockly/xml" type="on_ext" id="|{gw`ZoJ#V}kw4dBMwk]" x="213" y="138"> <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="S]dcw+X(5_IlE9}oi$@|"> <field name="oid">shelly.0.SHSW-25#5DB000#1.Shutter.Position</field> </shadow> </value> <statement name="STATEMENT"> <block type="debug" id="T]vSi46~nx1?1GM*WE8k"> <field name="Severity">log</field> <value name="TEXT"> <shadow type="text" id="7|(d?!4e*fg(C.?H*Ww^"> <field name="TEXT">test</field> </shadow> <block type="text_join" id="9Tuz@`bD_Fy%y(Ju#gUd"> <mutation items="2"></mutation> <value name="ADD0"> <block type="text" id="f6^Gzr}j0AQn!~mK|BA3"> <field name="TEXT">Shelly Position: </field> </block> </value> <value name="ADD1"> <block type="on_source" id="W;/({#JS(E!Y5Wz_XlTj"> <field name="ATTR">state.val</field> </block> </value> </block> </value> <next> <block type="logic_switch_case" id="Yp.+iRAuArFlNdF;v^=Z"> <mutation xmlns="http://www.w3.org/1999/xhtml" case="2"></mutation> <value name="CONDITION"> <block type="on_source" id="x(_nh!8S,x=QX+u+9uz]"> <field name="ATTR">state.val</field> </block> </value> <value name="CASECONDITION0"> <block type="math_number" id="Lx+6%c6:#ks^,@4G2gEY"> <field name="NUM">15</field> </block> </value> <statement name="CASE0"> <block type="control" id="z*vtpN69cJ^v]2shH]+."> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">0_userdata.0.Datenpunkte.Rollopositionen.Shelly-Wert-neu</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="math_number" id=")Lj`UaVz~ef+Gv~`Cq$x"> <field name="NUM">5</field> </block> </value> </block> </statement> <value name="CASECONDITION1"> <block type="math_number" id="rE|PmuFIj|K-jDe~^9}D"> <field name="NUM">25</field> </block> </value> <statement name="CASE1"> <block type="control" id=";y[pl=s~Aq):M!DE5H$H"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">0_userdata.0.Datenpunkte.Rollopositionen.Shelly-Wert-neu</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="math_number" id="c=~NkSa0!iGAu{K8Wmzo"> <field name="NUM">20</field> </block> </value> </block> </statement> <value name="CASECONDITION2"> <block type="math_number" id="ie_J],Q2%*UsGQ]u[NoT"> <field name="NUM">100</field> </block> </value> <statement name="CASE2"> <block type="control" id="2nago5cu_F.Jw[dh^jAS"> <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation> <field name="OID">0_userdata.0.Datenpunkte.Rollopositionen.Shelly-Wert-neu</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="math_number" id=".g!dbOPspHNX@I9Rrj`!"> <field name="NUM">99</field> </block> </value> </block> </statement> </block> </next> </block> </statement> </block>
-
hab am Handy mal gebastelt
ohne Gewähr
-
@tt-tom Brauche ich wohl nicht mehr probieren, es klappt auch mit der vorherigen Änderung. Ich hatte vermutlich übersehen, dass der Wert ja erst noch geändert werden muss.
Rollo zu 100 % geöffnet, die VIS zeigt mir jetzt 99 % an.
Rollo auf 25 % Öffnung gefahren, die VIS zeigt mir jetzt 20 % anAlso alles so, wie ich es mir vorgestellt habe. Hat geklappt aufgrund deines Vorschlags. Vielen Dank dafür.
Jetzt kann ich das mal so durchtesten und möglicherweise noch eine Formel kreieren ...
-
@homoran sorry, was vergessen