Hi,
da ich schon die ganze Zeit mal Echos in anderen Räumen per Sprache etwas sagen lassen wollte, hab' ich mal versucht mir ein Blockly zu basteln.
Also, hier mein Ansatz, vielleicht ist er ja noch jemandem nützlich.
Achja, beim Aufruf gehe ich von folgendem aus:
Wakeword, xxx Echoname sprich mir nach Wunschtext
"xxx" kann dabei ein(!) beliebiges Wort sein, wie z.B. "auf", "im", "in"...
"Echoname" müsst Ihr Euch ausdenken und dann entsprechd im Blockly mit der richtigen Seriennummer verknüpfen. (nicht mehr nötig ab Version 1.5 - benötigt JavaScript Adapter 4.1.13 oder höher)
Aktuelle Version: V2.2 (vom 11.03.2021)
Ürsprünglicher Blockly Code (veraltet!) ist im "Spoiler".
Viel Spaß damit,
padrino
<xml xmlns="http://www.w3.org/1999/xhtml">
<variables>
<variable type="" id="xci3X!4nlXF:sZ?64H_G">Echo_Name</variable>
<variable type="" id="u+Fa?OFVu31w|2/cTtG*">Echo_Seriennummer</variable>
</variables>
<block type="on" id="fhfKzXrq)P[aOmo9~(rW" x="-1937" y="-512">
<field name="OID">alexa2.0.History.summary</field>
<field name="CONDITION">ne</field>
<field name="ACK_CONDITION"></field>
<statement name="STATEMENT">
<block type="controls_if" id="OElmPyfLv#/1YKRV;(yB">
<value name="IF0">
<block type="logic_compare" id="7|bX(FK%8-kvxd;yxQbo">
<field name="OP">GT</field>
<value name="A">
<block type="text_indexOf" id="Iu^2N42]m*BM7c;Q2K-m">
<field name="END">FIRST</field>
<value name="VALUE">
<block type="get_value" id="(l7jpF^32#IjwHF;zonD">
<field name="ATTR">val</field>
<field name="OID">alexa2.0.History.summary</field>
</block>
</value>
<value name="FIND">
<shadow type="text" id="1GVke=Zw#PVlU,W6aLH/">
<field name="TEXT">bis</field>
</shadow>
<block type="text" id="(~gUYI,1p[/KsA?AEFaA">
<field name="TEXT">sprich mir nach</field>
</block>
</value>
</block>
</value>
<value name="B">
<block type="math_number" id="qoffb!hgM^%hj6qW|}p;">
<field name="NUM">1</field>
</block>
</value>
</block>
</value>
<statement name="DO0">
<block type="control_ex" id="sez5|xCaiobR.:f_@XNN">
<field name="TYPE">false</field>
<field name="CLEAR_RUNNING">FALSE</field>
<value name="OID">
<shadow type="field_oid" id="fwZLrtqkG5Ro2sbRcbdL">
<field name="oid">Object ID</field>
</shadow>
<block type="text_join" id="Uc(C1*DhkN=(Ej:3;/_{">
<mutation items="3"></mutation>
<value name="ADD0">
<block type="text" id="3N=uEC@l*)_nr#{g4uNp">
<field name="TEXT">alexa2.0.Echo-Devices.</field>
</block>
</value>
<value name="ADD1">
<block type="get_value" id="mTQ}3#/=?3VG-*}4O,m-">
<field name="ATTR">val</field>
<field name="OID">alexa2.0.History.serialNumber</field>
</block>
</value>
<value name="ADD2">
<block type="text" id="E|q29/u43a=DeTghbcsC">
<field name="TEXT">.Commands.speak</field>
</block>
</value>
</block>
</value>
<value name="VALUE">
<shadow type="logic_boolean" id="4Q-~O)0Tq3Bl0SL#OKOU">
<field name="BOOL">TRUE</field>
</shadow>
<block type="text" id="qRG2]*J2z/#-u~eydoca">
<field name="TEXT">Ok.</field>
</block>
</value>
<value name="DELAY_MS">
<shadow type="math_number" id="E6wr0Gr)4kRK?U+WJxmQ">
<field name="NUM">0</field>
</shadow>
</value>
<next>
<block type="variables_set" id="#(KOcl2PK``7{9,ihtgn">
<field name="VAR" id="xci3X!4nlXF:sZ?64H_G" variabletype="">Echo_Name</field>
<value name="VALUE">
<block type="text_getSubstring" id="Zf;s@pJw,rWD||Jvmnbk" inline="false">
<mutation at1="true" at2="true"></mutation>
<field name="WHERE1">FROM_START</field>
<field name="WHERE2">FROM_START</field>
<value name="STRING">
<block type="get_value" id="uxX_JKmQ2Ut%tn[X+go3">
<field name="ATTR">val</field>
<field name="OID">alexa2.0.History.summary</field>
</block>
</value>
<value name="AT1">
<block type="math_arithmetic" id="OYk4;y5{czDP`m+gzp#x">
<field name="OP">ADD</field>
<value name="A">
<shadow type="math_number" id=":Pt%sy);(Elj}B;/,1ix">
<field name="NUM">1</field>
</shadow>
<block type="text_indexOf" id="8iVOD?ge5zEWtZNYR)Xa">
<field name="END">FIRST</field>
<value name="VALUE">
<block type="get_value" id="z`*qzQ5VD}D4x2aBmgBa">
<field name="ATTR">val</field>
<field name="OID">alexa2.0.History.summary</field>
</block>
</value>
<value name="FIND">
<shadow type="text" id="=SDY/u1Y#~]_%{#8u2q?">
<field name="TEXT"> </field>
</shadow>
</value>
</block>
</value>
<value name="B">
<shadow type="math_number" id="}zdvVy2;C-Jy`,}Gyhxv">
<field name="NUM">1</field>
</shadow>
</value>
</block>
</value>
<value name="AT2">
<block type="math_arithmetic" id="SH2qw5Y([Kz61GRYELOb">
<field name="OP">MINUS</field>
<value name="A">
<shadow type="math_number" id=":Pt%sy);(Elj}B;/,1ix">
<field name="NUM">1</field>
</shadow>
<block type="text_indexOf" id="?4FxA-!N!j0aWW@J,Wve">
<field name="END">FIRST</field>
<value name="VALUE">
<block type="get_value" id="5t07C-miTCblEb7(~GlL">
<field name="ATTR">val</field>
<field name="OID">alexa2.0.History.summary</field>
</block>
</value>
<value name="FIND">
<shadow type="text" id="frF5wE;Uu[cV+_/+]y;/">
<field name="TEXT">sprich mir nach</field>
</shadow>
</value>
</block>
</value>
<value name="B">
<shadow type="math_number" id="46zj.O5@$,TNr[sKB%Wy">
<field name="NUM">2</field>
</shadow>
</value>
</block>
</value>
</block>
</value>
<next>
<block type="controls_if" id="geG}]-ufGPzpP@6^=bVw">
<mutation elseif="3"></mutation>
<value name="IF0">
<block type="logic_compare" id="fW4caV)A!+`dLiFg~bfn">
<field name="OP">EQ</field>
<value name="A">
<block type="variables_get" id="Ql[tJ[bZ?CLh`KHb,)kB">
<field name="VAR" id="xci3X!4nlXF:sZ?64H_G" variabletype="">Echo_Name</field>
</block>
</value>
<value name="B">
<block type="text" id="0/Agn1a7].a,Rhx)nIY?">
<field name="TEXT">wohnzimmer</field>
</block>
</value>
</block>
</value>
<statement name="DO0">
<block type="variables_set" id="P!g)(]st+nmv0UZfs28R">
<field name="VAR" id="u+Fa?OFVu31w|2/cTtG*" variabletype="">Echo_Seriennummer</field>
<value name="VALUE">
<block type="text" id="xg)l8Pm#XHH+6!6,MG!a">
<field name="TEXT">G090XXXXXXXXXXXX</field>
</block>
</value>
</block>
</statement>
<value name="IF1">
<block type="logic_compare" id="!!cFu9dOX/=yhEPQ^w^=">
<field name="OP">EQ</field>
<value name="A">
<block type="variables_get" id="!n?[_;P:i)35RG;!UIe#">
<field name="VAR" id="xci3X!4nlXF:sZ?64H_G" variabletype="">Echo_Name</field>
</block>
</value>
<value name="B">
<block type="text" id="nU:0EYv*Q4_0H@sMZF|F">
<field name="TEXT">küche</field>
</block>
</value>
</block>
</value>
<statement name="DO1">
<block type="variables_set" id="#e_TZiz/Rx8(Ar).2L9,">
<field name="VAR" id="u+Fa?OFVu31w|2/cTtG*" variabletype="">Echo_Seriennummer</field>
<value name="VALUE">
<block type="text" id="Zf;Wfq|xp*n%z*36XHz`">
<field name="TEXT">G090XXXXXXXXXXXX</field>
</block>
</value>
</block>
</statement>
<value name="IF2">
<block type="logic_compare" id=",pLk;xxU3Z3Hclu^dZh`">
<field name="OP">EQ</field>
<value name="A">
<block type="variables_get" id="N)4zi}0hVrOQ.r96$yW=">
<field name="VAR" id="xci3X!4nlXF:sZ?64H_G" variabletype="">Echo_Name</field>
</block>
</value>
<value name="B">
<block type="text" id="}QhS3;B+Qql+-pN38TgG">
<field name="TEXT">schlafzimmer</field>
</block>
</value>
</block>
</value>
<statement name="DO2">
<block type="variables_set" id="OJg0I9t!rg;1C1*/P{1u">
<field name="VAR" id="u+Fa?OFVu31w|2/cTtG*" variabletype="">Echo_Seriennummer</field>
<value name="VALUE">
<block type="text" id="l=6U^^/CKJcP6RsH;{V+">
<field name="TEXT">G090XXXXXXXXXXXX</field>
</block>
</value>
</block>
</statement>
<value name="IF3">
<block type="logic_compare" id="QxAwY#pUT#I!]7ATNXBW">
<field name="OP">EQ</field>
<value name="A">
<block type="variables_get" id="w^V1P07t|9gb*GUt|8$-">
<field name="VAR" id="xci3X!4nlXF:sZ?64H_G" variabletype="">Echo_Name</field>
</block>
</value>
<value name="B">
<block type="text" id="Wcv?-G=`b^t==g9N#M.{">
<field name="TEXT">italien</field>
</block>
</value>
</block>
</value>
<statement name="DO3">
<block type="variables_set" id=".N/Z4]uMF%m$s}wn4rJD">
<field name="VAR" id="u+Fa?OFVu31w|2/cTtG*" variabletype="">Echo_Seriennummer</field>
<value name="VALUE">
<block type="text" id="efTH4pq)+D!D*Vdam{Qc">
<field name="TEXT">G090XXXXXXXXXXXX</field>
</block>
</value>
</block>
</statement>
<next>
<block type="control_ex" id="X~Tiu+]Y5hd4Sc;n(jCD">
<field name="TYPE">false</field>
<field name="CLEAR_RUNNING">FALSE</field>
<value name="OID">
<shadow type="field_oid" id="t*5aSjuTu%);@{ti5y;O">
<field name="oid">Object ID</field>
</shadow>
<block type="text_join" id="(mf@@!nx}pJB._9;:sQ4">
<mutation items="3"></mutation>
<value name="ADD0">
<block type="text" id="]]bUZ,MQP=#JQ?3k-:P6">
<field name="TEXT">alexa2.0.Echo-Devices.</field>
</block>
</value>
<value name="ADD1">
<block type="variables_get" id="}kMB/?r2/Bq(SGl|Z~LH">
<field name="VAR" id="u+Fa?OFVu31w|2/cTtG*" variabletype="">Echo_Seriennummer</field>
</block>
</value>
<value name="ADD2">
<block type="text" id="H60usv-3xC(wpzMX*z:*">
<field name="TEXT">.Commands.speak</field>
</block>
</value>
</block>
</value>
<value name="VALUE">
<shadow type="logic_boolean" id="4Q-~O)0Tq3Bl0SL#OKOU">
<field name="BOOL">TRUE</field>
</shadow>
<block type="text_getSubstring" id="%B5?NrR/^@Yo,^V+%OhP" inline="false">
<mutation at1="true" at2="true"></mutation>
<field name="WHERE1">FROM_START</field>
<field name="WHERE2">FROM_START</field>
<value name="STRING">
<block type="get_value" id="(uO~YUVkgC6)YZfZ(O}6">
<field name="ATTR">val</field>
<field name="OID">alexa2.0.History.summary</field>
</block>
</value>
<value name="AT1">
<block type="math_arithmetic" id=")%)x6|Y|YNte:#s,[#k6">
<field name="OP">ADD</field>
<value name="A">
<shadow type="math_number" id=":Pt%sy);(Elj}B;/,1ix">
<field name="NUM">1</field>
</shadow>
<block type="text_indexOf" id=",|z]4aSUy?sDT,c1AvJL">
<field name="END">FIRST</field>
<value name="VALUE">
<block type="get_value" id="*c~4e(URYo9ak,}l2poM">
<field name="ATTR">val</field>
<field name="OID">alexa2.0.History.summary</field>
</block>
</value>
<value name="FIND">
<shadow type="text" id="gG59_T:atKMo)MfX?b8R">
<field name="TEXT">sprich mir nach</field>
</shadow>
</value>
</block>
</value>
<value name="B">
<shadow type="math_number" id="~hv6Rq;ZlwM/_wQTUG?3">
<field name="NUM">16</field>
</shadow>
</value>
</block>
</value>
<value name="AT2">
<block type="text_length" id="j,aA?;CGsN39IC+!p{+c">
<value name="VALUE">
<shadow type="text" id="j)^dV@z~!#TrZgQK7!.1">
<field name="TEXT">abc</field>
</shadow>
<block type="get_value" id="4@M4|ZN/?CKJVQ?r{njM">
<field name="ATTR">val</field>
<field name="OID">alexa2.0.History.summary</field>
</block>
</value>
</block>
</value>
</block>
</value>
<value name="DELAY_MS">
<shadow type="math_number" id="%fu?CI_z.69W0V8wXiBl">
<field name="NUM">0</field>
</shadow>
</value>
</block>
</next>
</block>
</next>
</block>
</next>
</block>
</statement>
</block>
</statement>
</block>
</xml>