NEWS
UNSOLVED Blockly Telegram Menü
-
@david-g okay das hat nicht ganz Funktioniert !
-
Hab grad am Smartphone ein wenig probiert.
Schaue nachher mal, ob ich es am Rechner ans laufen bekomme.Viel fehlt nicht. Dann klappt Multiuser.
-
Habe es schonmal geschafft, dass es egal ist wer schreibt.
So können deine Freundin und du das Menü nutzen.Scheitere noch daran, dass das Menü nur dort ankommt wo es hin soll.
Hier schonmal die Version, wo beide schreiben können:
<xml xmlns="https://developers.google.com/blockly/xml"> <variables> <variable id="eU+!Rg)DfHx1yE3@-1L$">benutzer</variable> <variable id="VgV^^$s(/@_k5HsTg(_,">nachricht</variable> </variables> <block type="on" id=".lU6UC-eqV;9u$UZt22b" x="-187" y="-62"> <field name="OID">telegram.0.communicate.request</field> <field name="CONDITION">any</field> <field name="ACK_CONDITION"></field> <statement name="STATEMENT"> <block type="variables_set" id="]}:K`!ut;=$ttPk7Eh`j"> <field name="VAR" id="eU+!Rg)DfHx1yE3@-1L$">benutzer</field> <value name="VALUE"> <block type="text_getSubstring" id="s;c|1D#$DGc:n%9++|A{"> <mutation at1="true" at2="true"></mutation> <field name="WHERE1">FROM_START</field> <field name="WHERE2">FROM_START</field> <value name="STRING"> <block type="on_source" id="ms8~h~%:^`m.J%XU%Pp="> <field name="ATTR">state.val</field> </block> </value> <value name="AT1"> <block type="math_number" id="5?QQruI.g2Kd~d[`WLHr"> <field name="NUM">2</field> </block> </value> <value name="AT2"> <block type="text_indexOf" id="qf#s-Tde~Y-8RniAtsS5"> <field name="END">FIRST</field> <value name="VALUE"> <block type="on_source" id="GOe$NJHA0uLPa=@^uT%Q"> <field name="ATTR">state.val</field> </block> </value> <value name="FIND"> <shadow type="text" id="1dEcB:;/bw7[`1IM.{3;"> <field name="TEXT">]</field> </shadow> </value> </block> </value> </block> </value> <next> <block type="variables_set" id="5XV/_V3~d=5HIGBCDqx3"> <field name="VAR" id="eU+!Rg)DfHx1yE3@-1L$">benutzer</field> <value name="VALUE"> <block type="text_getSubstring" id="IL^wvf^GliIj$sGGMUfX"> <mutation at1="false" at2="true"></mutation> <field name="WHERE1">FIRST</field> <field name="WHERE2">FROM_START</field> <value name="STRING"> <block type="variables_get" id="y[gyJhemOyS]%/|X6c{!"> <field name="VAR" id="eU+!Rg)DfHx1yE3@-1L$">benutzer</field> </block> </value> <value name="AT2"> <block type="math_number" id="[jd,28:uVe[ij[kbD%Ls"> <field name="NUM">-1</field> </block> </value> </block> </value> <next> <block type="variables_set" id="Kz:0GuyCROyMu3kIsXxq"> <field name="VAR" id="VgV^^$s(/@_k5HsTg(_,">nachricht</field> <value name="VALUE"> <block type="text_getSubstring" id="D+OMNu(5^{2Mv1H4,;wM"> <mutation at1="true" at2="true"></mutation> <field name="WHERE1">FROM_START</field> <field name="WHERE2">FROM_START</field> <value name="STRING"> <block type="on_source" id="r`JQa/t*S1!=6A(7h5a8"> <field name="ATTR">state.val</field> </block> </value> <value name="AT1"> <block type="text_indexOf" id=".LjISqpQ7lRT](JKyTDm"> <field name="END">FIRST</field> <value name="VALUE"> <block type="on_source" id="1:i7_,k^20;DqOwZUobp"> <field name="ATTR">state.val</field> </block> </value> <value name="FIND"> <shadow type="text" id="F3ztr8,]U8-j+dis#/Mi"> <field name="TEXT">]</field> </shadow> <block type="text" id="ml8Vw)#8o=cn-;j5F=;y"> <field name="TEXT">]</field> </block> </value> </block> </value> <value name="AT2"> <block type="math_number" id="#Flj-rk;[^%[poxa=E9Z"> <field name="NUM">99</field> </block> </value> </block> </value> <next> <block type="variables_set" id=".8%^8!OWU=fhv.Dp}lx8"> <field name="VAR" id="VgV^^$s(/@_k5HsTg(_,">nachricht</field> <value name="VALUE"> <block type="text_getSubstring" id="D]{Nt#0==?Be!gM8g0a!"> <mutation at1="true" at2="true"></mutation> <field name="WHERE1">FROM_START</field> <field name="WHERE2">FROM_START</field> <value name="STRING"> <block type="variables_get" id="0B:,aZqyV(2^CmB(fV.2"> <field name="VAR" id="VgV^^$s(/@_k5HsTg(_,">nachricht</field> </block> </value> <value name="AT1"> <block type="math_number" id="mhW:[z:Sk}_SK@lU!E+7"> <field name="NUM">2</field> </block> </value> <value name="AT2"> <block type="math_number" id="Vp8~yzscuwGJy,zkinqi"> <field name="NUM">99</field> </block> </value> </block> </value> <next> <block type="controls_if" id="WcWO4:ftW,M9)GZSg!}Y"> <mutation elseif="2" else="1"></mutation> <value name="IF0"> <block type="logic_compare" id="k8,3$N7H9YZRZS^[F_W`"> <field name="OP">EQ</field> <value name="A"> <block type="variables_get" id="}#v$9rMf:T8RcE5jorcY"> <field name="VAR" id="VgV^^$s(/@_k5HsTg(_,">nachricht</field> </block> </value> <value name="B"> <block type="text" id="ed.{_wS[!SYv8?:en+s#"> <field name="TEXT">Menü</field> </block> </value> </block> </value> <statement name="DO0"> <block type="procedures_callcustomnoreturn" id="_Q/e+6r,Yi4BfU2kT;E)"> <mutation name="Menü"></mutation> </block> </statement> <value name="IF1"> <block type="logic_compare" id="v=N-bl4|gdY0y!txRg!l"> <field name="OP">EQ</field> <value name="A"> <block type="variables_get" id="^HICIJ@#q(L;t0sa_rIb"> <field name="VAR" id="VgV^^$s(/@_k5HsTg(_,">nachricht</field> </block> </value> <value name="B"> <block type="text" id="So`k._`2yRU+U;a)%yOe"> <field name="TEXT">1</field> </block> </value> </block> </value> <statement name="DO1"> <block type="procedures_callnoreturn" id="u?wLgraUjQPnTPp6?bp5"> <mutation name="1"></mutation> </block> </statement> <value name="IF2"> <block type="logic_compare" id="zK86wl8v;xQaUaXj/84z"> <field name="OP">EQ</field> <value name="A"> <block type="variables_get" id="@FLbW6F#WoFq8q2tVao_"> <field name="VAR" id="VgV^^$s(/@_k5HsTg(_,">nachricht</field> </block> </value> <value name="B"> <block type="text" id="a]Z79`R%ouC9jNJG^Smc"> <field name="TEXT">2</field> </block> </value> </block> </value> <statement name="DO2"> <block type="procedures_callnoreturn" id="/sbj)4$_)N6Xfn,%X?Q/"> <mutation name="2"></mutation> </block> </statement> <statement name="ELSE"> <block type="procedures_callnoreturn" id="0c[Tgj_~,/8p!c-emJ-%"> <mutation name="3"></mutation> </block> </statement> </block> </next> </block> </next> </block> </next> </block> </next> </block> </statement> </block> <block type="procedures_defcustomnoreturn" id="6)V^on?Mmzn;Vk$-p(cG" x="563" y="212"> <mutation statements="false"></mutation> <field name="NAME">Menü</field> <field name="SCRIPT">dmFyIGJlbnV0emVyOw0KDQoNCnNlbmRUbygndGVsZWdyYW0uMCcsIHsNCiAgICB0ZXh0OiAgICdUZXN0JywNCiAgICByZXBseV9tYXJrdXA6IHsNCiAgICAgICAga2V5Ym9hcmQ6IFsNCiAgICAgICAgICAgIFsnMSddLA0KICAgICAgICAgICAgWycyJ10NCiAgICAgICAgXSwNCiAgICAgICAgcmVzaXplX2tleWJvYXJkOiAgIHRydWUsDQogICAgICAgIG9uZV90aW1lX2tleWJvYXJkOiBmYWxzZQ0KICAgIH0NCn0pOw==</field> <comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment> </block> <block type="procedures_defnoreturn" id="?mP4f`gbrR:#*%9!;vZm" x="538" y="262"> <field name="NAME">1</field> <comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment> <statement name="STACK"> <block type="telegram" id="B;_huHKoP)W*7MP~(%ET"> <field name="INSTANCE">.0</field> <field name="LOG"></field> <field name="SILENT">FALSE</field> <field name="PARSEMODE">MarkdownV2</field> <field name="DISABLE_WEB_PAGE_PREVIEW">FALSE</field> <value name="MESSAGE"> <shadow type="text" id="ne`#7Z@[59(AjAjF+3`e"> <field name="TEXT">text</field> </shadow> <block type="text" id="T/jsFe_jE/XXX[*K/Jy3"> <field name="TEXT">Hast 1 gesendet</field> </block> </value> <value name="USERNAME"> <block type="variables_get" id="XY!_/uKUIEj~d2@}Ns5F"> <field name="VAR" id="eU+!Rg)DfHx1yE3@-1L$">benutzer</field> </block> </value> </block> </statement> </block> <block type="procedures_defnoreturn" id="BqXp!xJbe*_8caRCGeJH" x="538" y="513"> <field name="NAME">2</field> <comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment> <statement name="STACK"> <block type="telegram" id="W{0/qi0`q0mK}7m3bYaF"> <field name="INSTANCE">.0</field> <field name="LOG"></field> <field name="SILENT">FALSE</field> <field name="PARSEMODE">MarkdownV2</field> <field name="DISABLE_WEB_PAGE_PREVIEW">FALSE</field> <value name="MESSAGE"> <shadow type="text" id="e8JbH#eqN3JOhPOoSy:f"> <field name="TEXT">Hast 2 gesendet</field> </shadow> </value> <value name="USERNAME"> <block type="variables_get" id="zV?6qb*_W_;XvvpuDgnJ"> <field name="VAR" id="eU+!Rg)DfHx1yE3@-1L$">benutzer</field> </block> </value> </block> </statement> </block> <block type="procedures_defnoreturn" id="@Ga):~=2AG~j_]e+T:,P" x="537" y="763"> <field name="NAME">3</field> <comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment> <statement name="STACK"> <block type="telegram" id="sG(SUA:x,YZTFP=@VQLW"> <field name="INSTANCE">.0</field> <field name="LOG"></field> <field name="SILENT">FALSE</field> <field name="PARSEMODE">MarkdownV2</field> <field name="DISABLE_WEB_PAGE_PREVIEW">FALSE</field> <value name="MESSAGE"> <shadow type="text" id="a_Jo1kBOSnOxylHJgX9?"> <field name="TEXT">Fehler</field> </shadow> </value> <value name="USERNAME"> <block type="variables_get" id="H/[uuFk9QhMSy{|Xy)(9"> <field name="VAR" id="eU+!Rg)DfHx1yE3@-1L$">benutzer</field> </block> </value> </block> </statement> </block> </xml>
Behandel das Problem hier weiter:
https://forum.iobroker.net/topic/53945/telegram-empf%C3%A4nger-%C3%BCber-variable-in-js-funktion-festlegen
Wenn das Problem gelöst ist, melde ich mich hier. -
Glaube jetzt klappt alles.
Kannst du es mal mit deiner Freundin testen?Meine Frau hat eine eigene Telegraminstanz, kann es daher nicht wirklich ausprobieren.
Kannst ja einfach ein neues Skript anlegen und alles so importieren.
Ist nur ein Minimenü zum testen:<xml xmlns="https://developers.google.com/blockly/xml"> <variables> <variable id="eU+!Rg)DfHx1yE3@-1L$">benutzer</variable> <variable id="VgV^^$s(/@_k5HsTg(_,">nachricht</variable> </variables> <block type="on" id=".lU6UC-eqV;9u$UZt22b" x="-187" y="-62"> <field name="OID">telegram.0.communicate.request</field> <field name="CONDITION">any</field> <field name="ACK_CONDITION"></field> <statement name="STATEMENT"> <block type="variables_set" id="]}:K`!ut;=$ttPk7Eh`j"> <field name="VAR" id="eU+!Rg)DfHx1yE3@-1L$">benutzer</field> <value name="VALUE"> <block type="text_getSubstring" id="s;c|1D#$DGc:n%9++|A{"> <mutation at1="true" at2="true"></mutation> <field name="WHERE1">FROM_START</field> <field name="WHERE2">FROM_START</field> <value name="STRING"> <block type="on_source" id="ms8~h~%:^`m.J%XU%Pp="> <field name="ATTR">state.val</field> </block> </value> <value name="AT1"> <block type="math_number" id="5?QQruI.g2Kd~d[`WLHr"> <field name="NUM">2</field> </block> </value> <value name="AT2"> <block type="text_indexOf" id="qf#s-Tde~Y-8RniAtsS5"> <field name="END">FIRST</field> <value name="VALUE"> <block type="on_source" id="GOe$NJHA0uLPa=@^uT%Q"> <field name="ATTR">state.val</field> </block> </value> <value name="FIND"> <shadow type="text" id="1dEcB:;/bw7[`1IM.{3;"> <field name="TEXT">]</field> </shadow> </value> </block> </value> </block> </value> <next> <block type="variables_set" id="5XV/_V3~d=5HIGBCDqx3"> <field name="VAR" id="eU+!Rg)DfHx1yE3@-1L$">benutzer</field> <value name="VALUE"> <block type="text_getSubstring" id="IL^wvf^GliIj$sGGMUfX"> <mutation at1="false" at2="true"></mutation> <field name="WHERE1">FIRST</field> <field name="WHERE2">FROM_START</field> <value name="STRING"> <block type="variables_get" id="y[gyJhemOyS]%/|X6c{!"> <field name="VAR" id="eU+!Rg)DfHx1yE3@-1L$">benutzer</field> </block> </value> <value name="AT2"> <block type="math_number" id="[jd,28:uVe[ij[kbD%Ls"> <field name="NUM">-1</field> </block> </value> </block> </value> <next> <block type="variables_set" id="Kz:0GuyCROyMu3kIsXxq"> <field name="VAR" id="VgV^^$s(/@_k5HsTg(_,">nachricht</field> <value name="VALUE"> <block type="text_getSubstring" id="D+OMNu(5^{2Mv1H4,;wM"> <mutation at1="true" at2="true"></mutation> <field name="WHERE1">FROM_START</field> <field name="WHERE2">FROM_START</field> <value name="STRING"> <block type="on_source" id="r`JQa/t*S1!=6A(7h5a8"> <field name="ATTR">state.val</field> </block> </value> <value name="AT1"> <block type="text_indexOf" id=".LjISqpQ7lRT](JKyTDm"> <field name="END">FIRST</field> <value name="VALUE"> <block type="on_source" id="1:i7_,k^20;DqOwZUobp"> <field name="ATTR">state.val</field> </block> </value> <value name="FIND"> <shadow type="text" id="F3ztr8,]U8-j+dis#/Mi"> <field name="TEXT">]</field> </shadow> <block type="text" id="ml8Vw)#8o=cn-;j5F=;y"> <field name="TEXT">]</field> </block> </value> </block> </value> <value name="AT2"> <block type="math_number" id="#Flj-rk;[^%[poxa=E9Z"> <field name="NUM">99</field> </block> </value> </block> </value> <next> <block type="variables_set" id=".8%^8!OWU=fhv.Dp}lx8"> <field name="VAR" id="VgV^^$s(/@_k5HsTg(_,">nachricht</field> <value name="VALUE"> <block type="text_getSubstring" id="D]{Nt#0==?Be!gM8g0a!"> <mutation at1="true" at2="true"></mutation> <field name="WHERE1">FROM_START</field> <field name="WHERE2">FROM_START</field> <value name="STRING"> <block type="variables_get" id="0B:,aZqyV(2^CmB(fV.2"> <field name="VAR" id="VgV^^$s(/@_k5HsTg(_,">nachricht</field> </block> </value> <value name="AT1"> <block type="math_number" id="mhW:[z:Sk}_SK@lU!E+7"> <field name="NUM">2</field> </block> </value> <value name="AT2"> <block type="math_number" id="Vp8~yzscuwGJy,zkinqi"> <field name="NUM">99</field> </block> </value> </block> </value> <next> <block type="controls_if" id="WcWO4:ftW,M9)GZSg!}Y"> <mutation elseif="2" else="1"></mutation> <value name="IF0"> <block type="logic_compare" id="k8,3$N7H9YZRZS^[F_W`"> <field name="OP">EQ</field> <value name="A"> <block type="variables_get" id="}#v$9rMf:T8RcE5jorcY"> <field name="VAR" id="VgV^^$s(/@_k5HsTg(_,">nachricht</field> </block> </value> <value name="B"> <block type="text" id="ed.{_wS[!SYv8?:en+s#"> <field name="TEXT">Menü</field> </block> </value> </block> </value> <statement name="DO0"> <block type="procedures_callcustomnoreturn" id="_Q/e+6r,Yi4BfU2kT;E)"> <mutation name="Menü"></mutation> </block> </statement> <value name="IF1"> <block type="logic_compare" id="v=N-bl4|gdY0y!txRg!l"> <field name="OP">EQ</field> <value name="A"> <block type="variables_get" id="^HICIJ@#q(L;t0sa_rIb"> <field name="VAR" id="VgV^^$s(/@_k5HsTg(_,">nachricht</field> </block> </value> <value name="B"> <block type="text" id="So`k._`2yRU+U;a)%yOe"> <field name="TEXT">1</field> </block> </value> </block> </value> <statement name="DO1"> <block type="procedures_callnoreturn" id="u?wLgraUjQPnTPp6?bp5"> <mutation name="1"></mutation> </block> </statement> <value name="IF2"> <block type="logic_compare" id="zK86wl8v;xQaUaXj/84z"> <field name="OP">EQ</field> <value name="A"> <block type="variables_get" id="@FLbW6F#WoFq8q2tVao_"> <field name="VAR" id="VgV^^$s(/@_k5HsTg(_,">nachricht</field> </block> </value> <value name="B"> <block type="text" id="a]Z79`R%ouC9jNJG^Smc"> <field name="TEXT">2</field> </block> </value> </block> </value> <statement name="DO2"> <block type="procedures_callnoreturn" id="/sbj)4$_)N6Xfn,%X?Q/"> <mutation name="2"></mutation> </block> </statement> <statement name="ELSE"> <block type="procedures_callnoreturn" id="0c[Tgj_~,/8p!c-emJ-%"> <mutation name="3"></mutation> </block> </statement> </block> </next> </block> </next> </block> </next> </block> </next> </block> </statement> </block> <block type="procedures_defcustomnoreturn" id="6)V^on?Mmzn;Vk$-p(cG" x="563" y="212"> <mutation statements="false"></mutation> <field name="NAME">Menü</field> <field name="SCRIPT">c2VuZFRvKCd0ZWxlZ3JhbS4wJywgew0KICAgIHVzZXI6IGJlbnV0emVyLA0KICAgIHRleHQ6ICAgJ1Rlc3QnLA0KICAgIHJlcGx5X21hcmt1cDogew0KICAgICAgICBrZXlib2FyZDogWw0KICAgICAgICAgICAgWycxJ10sDQogICAgICAgICAgICBbJzInXQ0KICAgICAgICBdLA0KICAgICAgICByZXNpemVfa2V5Ym9hcmQ6ICAgdHJ1ZSwNCiAgICAgICAgb25lX3RpbWVfa2V5Ym9hcmQ6IGZhbHNlDQogICAgfQ0KfSk7</field> <comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment> </block> <block type="procedures_defnoreturn" id="?mP4f`gbrR:#*%9!;vZm" x="212" y="238"> <field name="NAME">1</field> <comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment> <statement name="STACK"> <block type="telegram" id="B;_huHKoP)W*7MP~(%ET"> <field name="INSTANCE">.0</field> <field name="LOG"></field> <field name="SILENT">FALSE</field> <field name="PARSEMODE">MarkdownV2</field> <field name="DISABLE_WEB_PAGE_PREVIEW">FALSE</field> <value name="MESSAGE"> <shadow type="text" id="ne`#7Z@[59(AjAjF+3`e"> <field name="TEXT">text</field> </shadow> <block type="text" id="T/jsFe_jE/XXX[*K/Jy3"> <field name="TEXT">Hast 1 gesendet</field> </block> </value> <value name="USERNAME"> <block type="variables_get" id="XY!_/uKUIEj~d2@}Ns5F"> <field name="VAR" id="eU+!Rg)DfHx1yE3@-1L$">benutzer</field> </block> </value> </block> </statement> </block> <block type="procedures_defnoreturn" id="BqXp!xJbe*_8caRCGeJH" x="687" y="263"> <field name="NAME">2</field> <comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment> <statement name="STACK"> <block type="telegram" id="W{0/qi0`q0mK}7m3bYaF"> <field name="INSTANCE">.0</field> <field name="LOG"></field> <field name="SILENT">FALSE</field> <field name="PARSEMODE">MarkdownV2</field> <field name="DISABLE_WEB_PAGE_PREVIEW">FALSE</field> <value name="MESSAGE"> <shadow type="text" id="e8JbH#eqN3JOhPOoSy:f"> <field name="TEXT">Hast 2 gesendet</field> </shadow> </value> <value name="USERNAME"> <block type="variables_get" id="zV?6qb*_W_;XvvpuDgnJ"> <field name="VAR" id="eU+!Rg)DfHx1yE3@-1L$">benutzer</field> </block> </value> </block> </statement> </block> <block type="procedures_defnoreturn" id="@Ga):~=2AG~j_]e+T:,P" x="212" y="512"> <field name="NAME">3</field> <comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment> <statement name="STACK"> <block type="telegram" id="sG(SUA:x,YZTFP=@VQLW"> <field name="INSTANCE">.0</field> <field name="LOG"></field> <field name="SILENT">FALSE</field> <field name="PARSEMODE">MarkdownV2</field> <field name="DISABLE_WEB_PAGE_PREVIEW">FALSE</field> <value name="MESSAGE"> <shadow type="text" id="a_Jo1kBOSnOxylHJgX9?"> <field name="TEXT">Fehler</field> </shadow> </value> <value name="USERNAME"> <block type="variables_get" id="H/[uuFk9QhMSy{|Xy)(9"> <field name="VAR" id="eU+!Rg)DfHx1yE3@-1L$">benutzer</field> </block> </value> </block> </statement> </block> </xml>
-
@david-g okay das funktioniert, wie kann ich es jetzt bei mir anpassen ?
-
Würde in deinem Skript alle Variablen anlegen die es bei mir gibt.
Dann den Text aus meinem js Baustein in deinem einfügen, im oberen Teil gibt es eine Änderung (ggf bei mehreren falls du mehrere hast) .In deinem wenn Bedingungen die Variable "text" durch meine Variable "nachricht" tauschen. Oder anders rum. Bei mir das Nachricht in Text abändern.
-
@david-g könntest du mir da kurz helfen ?
ich schick es dir über mail.
bin da noch nicht so fit drin -
-
@david-g okay Danke
-
Hab das Skript noch was überarbeitet.
Anbei die aktuelle Multiuser-Version.