- Home
- Deutsch
- Skripten / Logik
- Blockly
- Alexa Text vorlesen lassen
Alexa Text vorlesen lassen
-
@mikiline
Ich bin Dir ja noch eine Antwort zu diesem Thema schuldig.Da dieses Thema zwischenzeitlich gesperrt wurde, schreibe ich Dir hier später die Antwort dazu rein. Ich muss nur noch alles raussuchen (Links und Blockly)
Ich werde dann meinen/diesen Beitrag hier nochmal editieren.So, hier nun die Beschreibung:
Das Original Blockly ist aus der Facebookgruppe von Sven Topp. Einiges dazu findest Du auch hier. Dieses Blockly mußt Du nur an Deine Geräte anpassen. Verwendet wird hierzu der Telegram Adapter und der Alexa2 Adapter 2.2.0. Das Original Blockly geht über speak im Alexa2 Adapter. Ich nutze bei mir den ssml Datenpunkt, welcher auch andere Stimmen ermöglicht.
<xml xmlns="http://www.w3.org/1999/xhtml"> <block type="comment" id="N1-:.`.Rx6,01c^BA{Za" x="-638" y="-537"> <field name="COMMENT">Aktivierung</field> <next> <block type="on_ext" id="+x1ET;G*~te*b[w%c|1-"> <mutation items="1"></mutation> <field name="CONDITION">any</field> <field name="ACK_CONDITION"></field> <value name="OID0"> <shadow type="field_oid" id=".-mhS0~e-oPSL_j@!xY1"> <field name="oid">default</field> </shadow> <block type="field_oid" id="I50XDT2tHgr2:Qo-s=R-"> <field name="oid">telegram.0.communicate.request</field> </block> </value> <statement name="STATEMENT"> <block type="comment" id="Yf.shDl6:_KAp:RpWK-z"> <field name="COMMENT">Dachboden</field> <next> <block type="controls_if" id="%4]zg%-~XN1m9zw127O6"> <value name="IF0"> <block type="logic_compare" id="iTCqB=%BW^M/__JsalOv" inline="false"> <field name="OP">EQ</field> <value name="A"> <block type="text_getSubstring" id="2`pd)luZwd_xV()*GGds" inline="false" collapsed="true"> <mutation at1="true" at2="false"></mutation> <field name="WHERE1">FROM_START</field> <field name="WHERE2">LAST</field> <value name="STRING"> <block type="get_value" id="Z4}HWzJ!iM(`{{r1x(:m"> <field name="ATTR">val</field> <field name="OID">telegram.0.communicate.request</field> </block> </value> <value name="AT1"> <block type="math_arithmetic" id="m*L|M4%de!n8`,G+je%^" inline="false"> <field name="OP">ADD</field> <value name="A"> <shadow type="math_number" id="P/g8.K|juu{_N{vI`uS;"> <field name="NUM">1</field> </shadow> <block type="text_indexOf" id="2QV`7Gx#v#tfB0k35#S;" inline="false"> <field name="END">LAST</field> <value name="VALUE"> <block type="get_value" id="!o`X96UrVZ9Q9=%;i*rV"> <field name="ATTR">val</field> <field name="OID">telegram.0.communicate.request</field> </block> </value> <value name="FIND"> <shadow type="text" id="!1E(1cV/KLJzaIL[;zjR"> <field name="TEXT">abc</field> </shadow> <block type="text" id="oOGo)]p[g}B`sg2DPpYm"> <field name="TEXT">]</field> </block> </value> </block> </value> <value name="B"> <shadow type="math_number" id="tyd[*crp@oi9dXeGjOUK"> <field name="NUM">1</field> </shadow> <block type="math_number" id="!oX9{l3yaX[;t49OD!{R"> <field name="NUM">1</field> </block> </value> </block> </value> </block> </value> <value name="B"> <block type="text" id="A|-9qIJf[|)O6Alt[fOg"> <field name="TEXT">Dachboden</field> </block> </value> </block> </value> <statement name="DO0"> <block type="timeouts_settimeout" id="[YPBHFVZ`Zj7Oq:{0EY-"> <field name="NAME">timeout</field> <field name="DELAY">1000</field> <field name="UNIT">ms</field> <statement name="STATEMENT"> <block type="variables_set" id="d260S^|#G#JTW-li6M9+"> <field name="VAR">Dachboden Ausgabe</field> <value name="VALUE"> <block type="logic_boolean" id="qF]YJ,;5_IJyMG^W|J3Q"> <field name="BOOL">TRUE</field> </block> </value> </block> </statement> </block> </statement> <next> <block type="comment" id="!qa6se.HGndhAZDIfF`j"> <field name="COMMENT">K¸che</field> <next> <block type="controls_if" id="E~6@(HI1%a%c6woZhrH4"> <value name="IF0"> <block type="logic_compare" id="Eh|oLbFzgfCmELGwBut|" inline="false"> <field name="OP">EQ</field> <value name="A"> <block type="text_getSubstring" id="5`==W)q501xfGd7gWI`5" inline="false" collapsed="true"> <mutation at1="true" at2="false"></mutation> <field name="WHERE1">FROM_START</field> <field name="WHERE2">LAST</field> <value name="STRING"> <block type="get_value" id="l@`8}Uv%qutqL2zkfkj`"> <field name="ATTR">val</field> <field name="OID">telegram.0.communicate.request</field> </block> </value> <value name="AT1"> <block type="math_arithmetic" id="Z9z49f^mTfovat,|dS}F" inline="false"> <field name="OP">ADD</field> <value name="A"> <shadow type="math_number" id="P/g8.K|juu{_N{vI`uS;"> <field name="NUM">1</field> </shadow> <block type="text_indexOf" id="ZA{]vo];xWu/+U8=G[g_" inline="false"> <field name="END">LAST</field> <value name="VALUE"> <block type="get_value" id="5k8sx_Z#Ye]|YxN_FLXN"> <field name="ATTR">val</field> <field name="OID">telegram.0.communicate.request</field> </block> </value> <value name="FIND"> <shadow type="text" id="!1E(1cV/KLJzaIL[;zjR"> <field name="TEXT">abc</field> </shadow> <block type="text" id="}=NN4z50+nZtC|a@|IEE"> <field name="TEXT">]</field> </block> </value> </block> </value> <value name="B"> <shadow type="math_number" id="tyd[*crp@oi9dXeGjOUK"> <field name="NUM">1</field> </shadow> <block type="math_number" id="!e5,5s:K[3!8y`Z.+VoJ"> <field name="NUM">1</field> </block> </value> </block> </value> </block> </value> <value name="B"> <block type="text" id="(=??Tu:B?c2ER,=Sk%Fn"> <field name="TEXT">K¸che</field> </block> </value> </block> </value> <statement name="DO0"> <block type="timeouts_settimeout" id="L:EU:+6CR_hx7]u/]({)"> <field name="NAME">timeout3</field> <field name="DELAY">1000</field> <field name="UNIT">ms</field> <statement name="STATEMENT"> <block type="variables_set" id="^6)iP?si@B|JEP^H/s9F"> <field name="VAR">K¸che Ausgabe</field> <value name="VALUE"> <block type="logic_boolean" id="]R04sL_KK@-vkchl|v!+"> <field name="BOOL">TRUE</field> </block> </value> </block> </statement> </block> </statement> <next> <block type="comment" id="n}]k?1N)9m|(^jP=9otO"> <field name="COMMENT">Bad</field> <next> <block type="controls_if" id="hI6SZNXSv}jT_XV9tddx"> <value name="IF0"> <block type="logic_compare" id="I4PAa_F7pbCO(ka/0MP}" inline="false"> <field name="OP">EQ</field> <value name="A"> <block type="text_getSubstring" id="n(!u%*S#Bo](m7iT+{Hd" inline="false" collapsed="true"> <mutation at1="true" at2="false"></mutation> <field name="WHERE1">FROM_START</field> <field name="WHERE2">LAST</field> <value name="STRING"> <block type="get_value" id="3]|@|I|*=RYcI,[pZ|ik"> <field name="ATTR">val</field> <field name="OID">telegram.0.communicate.request</field> </block> </value> <value name="AT1"> <block type="math_arithmetic" id="CHj*3B2aW0rR3a2-z-id" inline="false"> <field name="OP">ADD</field> <value name="A"> <shadow type="math_number" id="P/g8.K|juu{_N{vI`uS;"> <field name="NUM">1</field> </shadow> <block type="text_indexOf" id="t5kuywBD/i^)h3`J(uUX" inline="false"> <field name="END">LAST</field> <value name="VALUE"> <block type="get_value" id="nr.,@LGZ81sNx-vo-fkM"> <field name="ATTR">val</field> <field name="OID">telegram.0.communicate.request</field> </block> </value> <value name="FIND"> <shadow type="text" id="!1E(1cV/KLJzaIL[;zjR"> <field name="TEXT">abc</field> </shadow> <block type="text" id="X!ON[p*Ea.=+t.QxWf@n"> <field name="TEXT">]</field> </block> </value> </block> </value> <value name="B"> <shadow type="math_number" id="tyd[*crp@oi9dXeGjOUK"> <field name="NUM">1</field> </shadow> <block type="math_number" id="|h`}*]1}G%ZTOpqM6f`X"> <field name="NUM">1</field> </block> </value> </block> </value> </block> </value> <value name="B"> <block type="text" id="1Z!W_Vlw27hXFa1EJ:8t"> <field name="TEXT">Bad</field> </block> </value> </block> </value> <statement name="DO0"> <block type="timeouts_settimeout" id="sp^6b{B!u{:kiVmL%Wu9"> <field name="NAME">timeout2</field> <field name="DELAY">1000</field> <field name="UNIT">ms</field> <statement name="STATEMENT"> <block type="variables_set" id="R1RGV[m)WmTlx,|]KA_7"> <field name="VAR">Bad Ausgabe</field> <value name="VALUE"> <block type="logic_boolean" id="gS.Q{FPdi`?|.n7?8LH`"> <field name="BOOL">TRUE</field> </block> </value> </block> </statement> </block> </statement> </block> </next> </block> </next> </block> </next> </block> </next> </block> </next> </block> </statement> <next> <block type="comment" id="-L+3EEj7gf;B6e2b8rKa"> <field name="COMMENT">Ausgabe</field> <next> <block type="on_ext" id="cHn34^bpwU{WDyu`VVc]"> <mutation items="1"></mutation> <field name="CONDITION">ne</field> <field name="ACK_CONDITION"></field> <value name="OID0"> <shadow type="field_oid" id="+V;rw--7Iqc.EhK.}U*B"> <field name="oid">default</field> </shadow> <block type="field_oid" id="M*6D:WD/R/NVP/.{hV(V"> <field name="oid">telegram.0.communicate.request</field> </block> </value> <statement name="STATEMENT"> <block type="comment" id="rKBIN}o;!lMaRMT({5gL"> <field name="COMMENT">Dachboden</field> <next> <block type="controls_if" id="QyU[H]qAqCBu@^CgN%w9"> <value name="IF0"> <block type="logic_compare" id="9J7ddB7scG/)4775Ka44"> <field name="OP">EQ</field> <value name="A"> <block type="variables_get" id="Ze]jCE8z~F)ac+MlF8o7"> <field name="VAR">Dachboden Ausgabe</field> </block> </value> <value name="B"> <block type="logic_boolean" id="3Ya%e_CmwEMt]Gk/bN;W"> <field name="BOOL">TRUE</field> </block> </value> </block> </value> <statement name="DO0"> <block type="control" id="=Qv6.l?@Nj]x[:|kH_K,"> <mutation delay_input="false"></mutation> <field name="OID">alexa2.0.Echo-Devices.90F0071865310FEM.Commands.speak</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="text_getSubstring" id=":(S^z7q]T;tfTeV/}H)m" inline="false" collapsed="true"> <mutation at1="true" at2="false"></mutation> <field name="WHERE1">FROM_START</field> <field name="WHERE2">LAST</field> <value name="STRING"> <block type="get_value" id="E6gZ9pqkF?P.1lv7eY#v"> <field name="ATTR">val</field> <field name="OID">telegram.0.communicate.request</field> </block> </value> <value name="AT1"> <block type="math_arithmetic" id="^_)4jTUI+C^f+OuJru/M" inline="false"> <field name="OP">ADD</field> <value name="A"> <shadow type="math_number" id="P/g8.K|juu{_N{vI`uS;"> <field name="NUM">1</field> </shadow> <block type="text_indexOf" id=",pYg,_!X.ONCz:Qvl~3s" inline="false"> <field name="END">LAST</field> <value name="VALUE"> <block type="get_value" id="h3Q_6g6Rc5h]K1J1JAqC"> <field name="ATTR">val</field> <field name="OID">telegram.0.communicate.request</field> </block> </value> <value name="FIND"> <shadow type="text" id="!1E(1cV/KLJzaIL[;zjR"> <field name="TEXT">abc</field> </shadow> <block type="text" id="xzvw_(wSyjn2,FmGM-?D"> <field name="TEXT">]</field> </block> </value> </block> </value> <value name="B"> <shadow type="math_number" id="tyd[*crp@oi9dXeGjOUK"> <field name="NUM">1</field> </shadow> <block type="math_number" id="eXD9.aX!%r,LUleHCzHr"> <field name="NUM">1</field> </block> </value> </block> </value> </block> </value> <next> <block type="variables_set" id="9@o4oUgK3%+pzsLo`}dr"> <field name="VAR">Dachboden Ausgabe</field> <value name="VALUE"> <block type="logic_boolean" id="FU/RuyC[|Pi;KWl7DhHJ"> <field name="BOOL">FALSE</field> </block> </value> </block> </next> </block> </statement> <next> <block type="comment" id="7^1/J4@mA2~GXFhc_%;m"> <field name="COMMENT">K¸che</field> <next> <block type="controls_if" id=")B{5N|L;X=Bb.fx6beU@"> <value name="IF0"> <block type="logic_compare" id="322REO59@C@]IJ*_cb7m"> <field name="OP">EQ</field> <value name="A"> <block type="variables_get" id="fRpqYW*;7mjHE[yC5f*y"> <field name="VAR">K¸che Ausgabe</field> </block> </value> <value name="B"> <block type="logic_boolean" id="GS`wCDR@sM%1};F59X~s"> <field name="BOOL">TRUE</field> </block> </value> </block> </value> <statement name="DO0"> <block type="control" id="LA^sqog)p-ftFA3r7/},"> <mutation delay_input="false"></mutation> <field name="OID">alexa2.0.Echo-Devices.G2A0P3077374026L.Commands.speak</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="text_getSubstring" id="vopV|d)EUzZ(g6:zvrGM" inline="false" collapsed="true"> <mutation at1="true" at2="false"></mutation> <field name="WHERE1">FROM_START</field> <field name="WHERE2">LAST</field> <value name="STRING"> <block type="get_value" id="fISizW86VewAX1|o{[}o"> <field name="ATTR">val</field> <field name="OID">telegram.0.communicate.request</field> </block> </value> <value name="AT1"> <block type="math_arithmetic" id="g[GnbT+@]FKX73@%d+Lu" inline="false"> <field name="OP">ADD</field> <value name="A"> <shadow type="math_number" id="P/g8.K|juu{_N{vI`uS;"> <field name="NUM">1</field> </shadow> <block type="text_indexOf" id="xOXhHT|xtl{FVp%Jy4RM" inline="false"> <field name="END">LAST</field> <value name="VALUE"> <block type="get_value" id="MP,:Dt}ONu*js7iR8`XB"> <field name="ATTR">val</field> <field name="OID">telegram.0.communicate.request</field> </block> </value> <value name="FIND"> <shadow type="text" id="!1E(1cV/KLJzaIL[;zjR"> <field name="TEXT">abc</field> </shadow> <block type="text" id="esYw@6./[)ZTl:uOVR`A"> <field name="TEXT">]</field> </block> </value> </block> </value> <value name="B"> <shadow type="math_number" id="tyd[*crp@oi9dXeGjOUK"> <field name="NUM">1</field> </shadow> <block type="math_number" id="`dbkET;V16@79t;*YZ^X"> <field name="NUM">1</field> </block> </value> </block> </value> </block> </value> <next> <block type="variables_set" id="M!S#v=}A})vpWlHw![dE"> <field name="VAR">K¸che Ausgabe</field> <value name="VALUE"> <block type="logic_boolean" id="bVH?gJQMd/MW[vMa{Ap["> <field name="BOOL">FALSE</field> </block> </value> </block> </next> </block> </statement> <next> <block type="comment" id=":oyMaxLi3IB95Hi.{uY%"> <field name="COMMENT">Bad</field> <next> <block type="controls_if" id="jF?1r2x(0rG9)2YAKu2="> <value name="IF0"> <block type="logic_compare" id="=,lUR}|.cb4aQ3Xu*mnp"> <field name="OP">EQ</field> <value name="A"> <block type="variables_get" id=",7#H_B]J#V-0g8tuO!?6"> <field name="VAR">Bad Ausgabe</field> </block> </value> <value name="B"> <block type="logic_boolean" id="+J*vUyivN0g-FA+b*)w="> <field name="BOOL">TRUE</field> </block> </value> </block> </value> <statement name="DO0"> <block type="control" id="(HbXPS1xv}AziAVx~V/d"> <mutation delay_input="false"></mutation> <field name="OID">alexa2.0.Echo-Devices.G2A0P307737401WA.Commands.speak</field> <field name="WITH_DELAY">FALSE</field> <value name="VALUE"> <block type="text_getSubstring" id="ZKhf?f.1)+)lgbf|9s?b" inline="false" collapsed="true"> <mutation at1="true" at2="false"></mutation> <field name="WHERE1">FROM_START</field> <field name="WHERE2">LAST</field> <value name="STRING"> <block type="get_value" id="*}H4]tOaC.adyC9f/#l^"> <field name="ATTR">val</field> <field name="OID">telegram.0.communicate.request</field> </block> </value> <value name="AT1"> <block type="math_arithmetic" id="hJxoe9kHd^sP|y0Ls3q5" inline="false"> <field name="OP">ADD</field> <value name="A"> <shadow type="math_number" id="P/g8.K|juu{_N{vI`uS;"> <field name="NUM">1</field> </shadow> <block type="text_indexOf" id="GlCb1^RUrW~5t#BLHSHN" inline="false"> <field name="END">LAST</field> <value name="VALUE"> <block type="get_value" id="ffygl*MKHnjb|(o8o7nx"> <field name="ATTR">val</field> <field name="OID">telegram.0.communicate.request</field> </block> </value> <value name="FIND"> <shadow type="text" id="!1E(1cV/KLJzaIL[;zjR"> <field name="TEXT">abc</field> </shadow> <block type="text" id="h)rg|lDMv9(XQFz0EXdO"> <field name="TEXT">]</field> </block> </value> </block> </value> <value name="B"> <shadow type="math_number" id="tyd[*crp@oi9dXeGjOUK"> <field name="NUM">1</field> </shadow> <block type="math_number" id="-NTxk`K%;?Oex+,t.bU?"> <field name="NUM">1</field> </block> </value> </block> </value> </block> </value> <next> <block type="variables_set" id="mq!Dz1aBoL,l6YFJEoQr"> <field name="VAR">Bad Ausgabe</field> <value name="VALUE"> <block type="logic_boolean" id="bE}4i)`^V{x;![tjgg.I"> <field name="BOOL">FALSE</field> </block> </value> </block> </next> </block> </statement> </block> </next> </block> </next> </block> </next> </block> </next> </block> </next> </block> </statement> </block> </next> </block> </next> </block> </next> </block> </xml>
Ich habe dieses Blockly dann für mich erweitert und in ein Telegram Menü mit Auswahl verschiedener Stimmen gepackt. (diese komplette Telegram Blockly Menü ist dann sehr umfangreich, aber es läuft sehr schnell) Bei mir wird sofort wenn Jemand eine Nachricht an einen Echo schicken will bzw. quasi das Triggerwort verwendet mit einer Ansage und auch mit einer blinkenden HUE Lampe am ECHO angekündigt sowie eine Rückmeldung an den Nachrichten Versender geschickt. Ich habe dazu ein Zeitlimit von 60 Sekunden eingebaut. Wenn in diesen 60 Sekunden keine Nachricht versendet wird (weil dem Versender vielleicht was dazwischengekommen ist...) wird das blinken der HUE beendet und auch der Abbruch am Echo angesagt sowie dem Versender darüber ein Telegram gesendet. Über das Telegram Menü geht die Antwort immer an der der versenden wollte. Sobald die Nachricht rechtzeitig innerhalb dieser 60 Sekunden gesendet wird, wird Sie vorgelesen und danach das blinken der HUE beendet sowie eine Nachricht an den Versender geschickt, das die Nachricht rechtzeitig versendet und vorgelesen wurde.
Die Sprachausgabe kommt natürlich über den ECHO der angewählt wurde und nicht am Handy. (in dem anderem Beitrag wurde von dem App Ersteller geschrieben das die am Handy vorgelesen wird...?)Einen Link mit Video und Download zur Erstellung eines Telegram Menüs findest Du im ersten Beitrag an dieser Stelle.
Aber wie gesagt, das sind quasi nur die "Grundfunktionen" der Blocklys. Den Rest und vieles andere mehr habe ich in meinem kompletten Menü verändert und angepasst. In dem hier angehängtem Blockly ist kein Menü oder Ankündigungen, HUE blinken usw. drinn, das habe ich für mich so angepasst. In dem Blockly von oben geht es noch "manuell", mit Eingabe des Triggerwortes (was bei mir das Menü selbst macht)
Wenn Du noch Fragen dazu hast, dann frag einfach. -
das wäre super, Danke Dir!