NEWS
Blockly / Sayit Ansage mit Namen
-
Hallo
im Rahmen vieler Spielereien mit Blockly bezüglich dem Thread http://forum.iobroker.net/viewtopic.php?f=21&t=4994
habe ich einige Scripte umgebaut und möchte nun nach Hause kommende Personen begrüßen.
Leider stehe ich minimal auf dem Schlauch.
! <xml 1999/xmlns="<URL url=" http:/www.w3.org/xhtml"="">http://www.w3.org/1999/xhtml">
! <block type="comment" id="]3P/6nt+cLbIKR046%Q" x="-487" y="-362"><field name="COMMENT">Schaltet die Beleuchtung wenn jamand nach Hause kommt.</field> ! <next><block type="on" id=".QtIB19Gc98n5pk0m%,|"><field name="OID">geofency.0.atHomeCount</field> ! <field name="CONDITION">gt</field> ! <statement name="STATEMENT"><block type="comment" id="/SpKVm:
x.L!ZJB]2o*"><field name="COMMENT">Wenn die Anwesenheit 1 Person, dann schalte die Kugel an</field> ! <next><block type="controls_if" id="N2Tgk%jrV?J/UgCv1b
X"><value name="IF0"><block type="logic_compare" id="?6.#EBEPwPSw-
oymv"><field name="OP">EQ</field>
! <value name="A"><block type="get_value" id="4M/g#5M[Qa[WfT6y#U~6"><field name="ATTR">val</field>
! <field name="OID">geofency.0.atHomeCount</field></block></value>
! <value name="B"><block type="math_number" id="S%}Ww.j959@0s:wu=t|2"><field name="NUM">1</field></block></value></block></value>
! <statement name="DO0"><block type="controls_if" id="s2~p@vJam;dUByAP4[~"><value name="IF0"><block type="time_compare_ex" id="071-hCnml[nd(+iyCK?@"><mutation end_time="true" actual_time="true"></mutation> ! <field name="USE_ACTUAL_TIME">TRUE</field> ! <field name="OPTION">between</field> ! <value name="START_TIME"><shadow type="text" id="1h+om^tlrCvl#oLkX(bB"><field name="TEXT">12:00</field></shadow> ! <block type="time_astro" id="lsoTklnnaVIF8t,;r|%a"><field name="TYPE">sunsetStart</field> ! <field name="OFFSET">0</field></block></value> ! <value name="END_TIME"><shadow type="text" id="c#KVmHij0ji]w)%;]/YA"><field name="TEXT">18:00</field></shadow> ! <block type="time_astro" id="CN:u:g9bzj,[KwB(xD92"><field name="TYPE">sunriseEnd</field> ! <field name="OFFSET">0</field></block></value></block></value> ! <statement name="DO0"><block type="debug" id="QFwD?x]@IRF[UT_IIO!j"><field name="Severity">log</field> ! <value name="TEXT"><shadow type="text" id="hE@{srGz1[X[lCM5Uwn^"><field name="TEXT">Nun wird Licht eingeschaltet!</field></shadow></value> ! <next><block type="controls_if" id="lI9%2sHDaDWqo#}NR3g8"><value name="IF0"><block type="logic_compare" id="]c+OX]%U3LdwPwLs3e~P"><field name="OP">EQ</field> ! <value name="A"><block type="get_value" id="5n5o7rD7CJ4-k,ZI+G,H"><field name="ATTR">val</field> ! <field name="OID">hue.0.Philips_hue.Kugel.on</field></block></value> ! <value name="B"><block type="logic_boolean" id="rdmcG,HQf~!@MQs.L*~m"><field name="BOOL">FALSE</field></block></value></block></value> ! <statement name="DO0"><block type="text_append" id="J?C[5QJ)7{BX*_-~mz~e"><field name="VAR">Text</field> ! <value name="TEXT"><shadow type="text" id="/FWic@EA]:pq^dhz1=s%"><field name="TEXT">im Flur,</field></shadow></value></block></statement> ! <next><block type="control" id="?Ep6k)Zw,3IoI|rSGW{n"><mutation delay_input="false"></mutation> ! <field name="OID">hue.0.Philips_hue.Kugel.on</field> ! <field name="WITH_DELAY">FALSE</field> ! <value name="VALUE"><block type="logic_boolean" id="fV,#X
Q:u1NCS^_dZHo["><field name="BOOL">TRUE</field></block></value>
! <next><block type="comment" id="gRg(Ax^,e+P67Pd|^U|f"><field name="COMMENT">Setze den Status auf 50% Helligkeit</field>
! <next><block type="control" id="4z9BES1qPy?.{F6e)CL"><mutation delay_input="false"></mutation> ! <field name="OID">hue.0.Philips_hue.Kugel.level</field> ! <field name="WITH_DELAY">FALSE</field> ! <value name="VALUE"><block type="math_number" id="78[mG|x3Ni5bQC7x6N*n"><field name="NUM">50</field></block></value> ! <next><block type="comment" id="sg7b0|dIY!LDV|dC279^"><field name="COMMENT">Schalte die große Stehlampe im Wohnzimmer an</field> ! <next><block type="controls_if" id="!WCruC8oCgA+_mvd[C9a"><value name="IF0"><block type="logic_compare" id="(w8k3@bE
dA?%gaU@^y6"><field name="OP">EQ</field>
! <value name="A"><block type="get_value" id="~oqqJdkc)74FNp1@MVNB"><field name="ATTR">val</field>
! <field name="OID">hm-rpc.0.LEQ0744868.1.STATE</field></block></value>
! <value name="B"><block type="logic_boolean" id="9Quk;u(e95|WjEbpc+)^"><field name="BOOL">FALSE</field></block></value></block></value>
! <statement name="DO0"><block type="text_append" id="z0gYIRy9EKx3ZN4h}]Y["><field name="VAR">Text</field>
! <value name="TEXT"><shadow type="text" id="pEL=LL/C@49%5KlvCI"><field name="TEXT">im Wohnzimmer</field></shadow></value></block></statement> ! <next><block type="control" id="qdUX9U@OGi)SXdcG1H1N"><mutation delay_input="true"></mutation> ! <field name="OID">hm-rpc.0.LEQ0744868.1.STATE</field> ! <field name="WITH_DELAY">TRUE</field> ! <field name="DELAY_MS">100</field> ! <field name="CLEAR_RUNNING">FALSE</field> ! <value name="VALUE"><block type="logic_boolean" id="!o5BpH7*BvYlvM11@:el"><field name="BOOL">TRUE</field></block></value> ! <next><block type="controls_if" id="SfFd5|!60-XBe%lovB@G"><value name="IF0"><block type="logic_compare" id="hSR3aag_.d0D8.
TNLE"><field name="OP">EQ</field>
! <value name="A"><block type="get_value" id="?JpPl(+{)QOR@[#s.]29"><field name="ATTR">val</field>
! <field name="OID">javascript.0.Ansagen_ein_oder_ausschalten.Jemand_kommt_nach_Hause</field></block></value>
! <value name="B"><block type="logic_boolean" id=";%-}30,:=q64M(9_s#G"><field name="BOOL">TRUE</field></block></value></block></value>
! <statement name="DO0"><block type="procedures_callnoreturn" id="!BGJKWG76m,UM=1nKG=c"><mutation name="Handymeldung"><arg name="Licht"></arg></mutation>
! <value name="ARG0"><block type="text_join" id="/{hcZ:tP6!.w@PvVQ{Fn"><mutation items="3"></mutation>
! <value name="ADD0"><block type="text" id="~srV@+2EHo^7sliD?2qT"><field name="TEXT">Hallo zu Hause dein Licht</field></block></value>
! <value name="ADD1"><block type="variables_get" id="ze#X}tuQfR)Bk8,#g_0-"><field name="VAR">Text</field></block></value>
! <value name="ADD2"><block type="text" id="V2|Gdi]?KbJF4B0_t_"><field name="TEXT">ist nun für dich eingeschaltet</field></block></value></block></value>
! <next><block type="procedures_callnoreturn" id="hj0FStybpVmk@:Mh7Cer"><mutation name="Ansage"><arg name="wer kommt nach Hause"></arg></mutation>
! <value name="ARG0"><block type="text_join" id=")2S8S]xAT+]KRF.J/PQ"><mutation items="2"></mutation>
! <value name="ADD1"><block type="text" id="cFO6wNIb.mW+A.skdF"><field name="TEXT">kommt grde nach Hause</field></block></value></block></value></block></next></block></statement></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></statement></block></statement></block></next></block></statement></block></next></block> ! <block type="procedures_defnoreturn" id="H[ZO2CtX
#nEUI7Qx(?L" x="662" y="-63"><mutation><arg name="Licht"></arg></mutation>
! <field name="NAME">Handymeldung</field>
! <comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment>
! <statement name="STACK"><block type="pushover" id="NlamwSsS}uVM-,Yd}]UC"><field name="PRIORITY">0</field>
! <value name="MESSAGE"><shadow type="text" id="jANWNBc=fM,r^M4?.hs/"><field name="TEXT">text</field></shadow>
! <block type="variables_get" id="tYN+(FR569_^DUoqGulQ"><field name="VAR">Licht</field></block></value></block></statement></block>
! <block type="procedures_defnoreturn" id="l/!@}~]//OrneQSUicv-" x="663" y="262"><mutation><arg name="wer kommt nach Hause"></arg></mutation>
! <field name="NAME">Ansage</field>
! <comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment>
! <statement name="STACK"><block type="sayit" id="|JTa|Rs(*F|l-97JqTt"><field name="INSTANCE">.0</field> ! <field name="LANGUAGE">de</field> ! <value name="MESSAGE"><shadow type="text" id="L3ir@*F{wteEr#U*^T~Q"><field name="TEXT">text</field></shadow> ! <block type="variables_get" id="|O}jMioZ@G,|
h}x6LSA"><field name="VAR">wer kommt nach Hause</field></block></value></block></statement></block></xml>Mit dem Blockly habe ich alles dafür vorbereitet, das nun die Ansage der Person ausgegeben werden kann. Leider bekomme ich die nötige Variabe nicht eingebaut.
Hier ein Foto von der Variablen:
Wie kann ich diese Variable in meinen Blockly einbauen?
Gruß Sven
-
Hallo Sven2013
Einfach von System Baustein "Wert von Objekt Id" an den Text-Baustein einhängen.
Grüße
-
Ok Danke das funktioniert.
Leider steht in dem Feld ["Nadine"] dadurch liest Sayit das nicht korrekt vor sondern mit Sonderzeichen usw.
Kann man das auf Buchstaben filtern?
Gruß Sven
Gesendet von iPhone mit Tapatalk
-
Leider steht in dem Feld ["Nadine"] dadurch liest Sayit das nicht korrekt vor sondern mit Sonderzeichen usw.
Kann man das auf Buchstaben filtern? `
In Blockly gibt es (noch) nicht viele String (Zeichenkette) Funktionen.
Aber einiges kann man schon basteln.
So müsste es funktionieren.
Grüße
-
Hey der Tip ist nun probiert, führt aber leider nicht dazu das der name genannt wird.
Hier nochmal das geänderte Blockly
! <xml 1999/xmlns="<URL url=" http:/www.w3.org/xhtml"="">http://www.w3.org/1999/xhtml">
! <block type="comment" id="]3P/6nt+cLbIKR046%Q" x="-472" y="-325"><field name="COMMENT">Schaltet die Beleuchtung wenn jamand nach Hause kommt.</field> ! <next><block type="on" id=".QtIB19Gc98n5pk0m%,|"><field name="OID">geofency.0.atHomeCount</field> ! <field name="CONDITION">gt</field> ! <statement name="STATEMENT"><block type="comment" id="/SpKVm:
x.L!ZJB]2o*"><field name="COMMENT">Wenn die Anwesenheit 1 Person, dann schalte die Kugel an</field> ! <next><block type="controls_if" id="N2Tgk%jrV?J/UgCv1b
X"><value name="IF0"><block type="logic_compare" id="?6.#EBEPwPSw-
oymv"><field name="OP">EQ</field>
! <value name="A"><block type="get_value" id="4M/g#5M[Qa[WfT6y#U~6"><field name="ATTR">val</field>
! <field name="OID">geofency.0.atHomeCount</field></block></value>
! <value name="B"><block type="math_number" id="S%}Ww.j959@0s:wu=t|2"><field name="NUM">1</field></block></value></block></value>
! <statement name="DO0"><block type="controls_if" id="s2~p@vJam;dUByAP4[~"><value name="IF0"><block type="time_compare_ex" id="071-hCnml[nd(+iyCK?@"><mutation end_time="true" actual_time="true"></mutation> ! <field name="USE_ACTUAL_TIME">TRUE</field> ! <field name="OPTION">between</field> ! <value name="START_TIME"><shadow type="text" id="1h+om^tlrCvl#oLkX(bB"><field name="TEXT">12:00</field></shadow> ! <block type="time_astro" id="lsoTklnnaVIF8t,;r|%a"><field name="TYPE">sunsetStart</field> ! <field name="OFFSET">0</field></block></value> ! <value name="END_TIME"><shadow type="text" id="F75vtgP-h.kLalvZ5cB#"><field name="TEXT">18:00</field></shadow> ! <block type="time_astro" id="CN:u:g9bzj,[KwB(xD92"><field name="TYPE">sunriseEnd</field> ! <field name="OFFSET">0</field></block></value></block></value> ! <statement name="DO0"><block type="debug" id="QFwD?x]@IRF[UT_IIO!j"><field name="Severity">log</field> ! <value name="TEXT"><shadow type="text" id="hE@{srGz1[X[lCM5Uwn^"><field name="TEXT">Nun wird Licht eingeschaltet!</field></shadow></value> ! <next><block type="comment" id="Q}vi6#;D*Yy}vqo5g1d+"><field name="COMMENT">fülle Text mit Nichts</field> ! <next><block type="variables_set" id="oKC.vb@,[4b2AAuji-XA"><field name="VAR">Lampe</field> ! <value name="VALUE"></value> ! <next><block type="controls_if" id="lI9%2sHDaDWqo#}NR3g8"><value name="IF0"><block type="logic_compare" id="]c+OX]%U3LdwPwLs3e~P"><field name="OP">EQ</field> ! <value name="A"><block type="get_value" id="5n5o7rD7CJ4-k,ZI+G,H"><field name="ATTR">val</field> ! <field name="OID">hue.0.Philips_hue.Kugel.on</field></block></value> ! <value name="B"><block type="logic_boolean" id="rdmcG,HQf~!@MQs.L*~m"><field name="BOOL">FALSE</field></block></value></block></value> ! <statement name="DO0"><block type="text_append" id="J?C[5QJ)7{BX*_-~mz~e"><field name="VAR">Lampe</field> ! <value name="TEXT"><shadow type="text" id="/FWic@EA]:pq^dhz1=s%"><field name="TEXT">im Flur,</field></shadow></value></block></statement> ! <next><block type="control" id="?Ep6k)Zw,3IoI|rSGW{n"><mutation delay_input="false"></mutation> ! <field name="OID">hue.0.Philips_hue.Kugel.on</field> ! <field name="WITH_DELAY">FALSE</field> ! <value name="VALUE"><block type="logic_boolean" id="fV,#X
Q:u1NCS^_dZHo["><field name="BOOL">TRUE</field></block></value>
! <next><block type="comment" id="gRg(Ax^,e+P67Pd|^U|f"><field name="COMMENT">Setze den Status auf 50% Helligkeit</field>
! <next><block type="control" id="4z9BES1qPy?.{F6e)CL"><mutation delay_input="false"></mutation> ! <field name="OID">hue.0.Philips_hue.Kugel.level</field> ! <field name="WITH_DELAY">FALSE</field> ! <value name="VALUE"><block type="math_number" id="78[mG|x3Ni5bQC7x6N*n"><field name="NUM">50</field></block></value> ! <next><block type="comment" id="sg7b0|dIY!LDV|dC279^"><field name="COMMENT">Schalte die große Stehlampe im Wohnzimmer an</field> ! <next><block type="controls_if" id="!WCruC8oCgA+_mvd[C9a"><value name="IF0"><block type="logic_compare" id="(w8k3@bE
dA?%gaU@^y6"><field name="OP">EQ</field>
! <value name="A"><block type="get_value" id="~oqqJdkc)74FNp1@MVNB"><field name="ATTR">val</field>
! <field name="OID">hm-rpc.0.LEQ0744868.1.STATE</field></block></value>
! <value name="B"><block type="logic_boolean" id="9Quk;u(e95|WjEbpc+)^"><field name="BOOL">FALSE</field></block></value></block></value>
! <statement name="DO0"><block type="text_append" id="z0gYIRy9EKx3ZN4h}]Y["><field name="VAR">Lampe</field>
! <value name="TEXT"><shadow type="text" id="pEL=LL/C@49%5KlvCI"><field name="TEXT">im Wohnzimmer</field></shadow></value></block></statement> ! <next><block type="control" id="qdUX9U@OGi)SXdcG1H1N"><mutation delay_input="true"></mutation> ! <field name="OID">hm-rpc.0.LEQ0744868.1.STATE</field> ! <field name="WITH_DELAY">TRUE</field> ! <field name="DELAY_MS">100</field> ! <field name="CLEAR_RUNNING">FALSE</field> ! <value name="VALUE"><block type="logic_boolean" id="!o5BpH7*BvYlvM11@:el"><field name="BOOL">TRUE</field></block></value> ! <next><block type="controls_if" id="SfFd5|!60-XBe%lovB@G"><value name="IF0"><block type="logic_compare" id="hSR3aag_.d0D8.
TNLE"><field name="OP">EQ</field>
! <value name="A"><block type="get_value" id="?JpPl(+{)QOR@[#s.]29"><field name="ATTR">val</field>
! <field name="OID">javascript.0.Ansagen_ein_oder_ausschalten.Jemand_kommt_nach_Hause</field></block></value>
! <value name="B"><block type="logic_boolean" id=";%-}30,:=q64M(9_s#G"><field name="BOOL">TRUE</field></block></value></block></value>
! <statement name="DO0"><block type="procedures_callnoreturn" id="!BGJKWG76m,UM=1nKG=c"><mutation name="Handymeldung"><arg name="Licht"></arg></mutation>
! <value name="ARG0"><block type="text_join" id="/{hcZ:tP6!.w@PvVQ{Fn"><mutation items="3"></mutation>
! <value name="ADD0"><block type="text" id="~srV@+2EHo^7sliD?2qT"><field name="TEXT">Hallo zu Hause dein Licht</field></block></value>
! <value name="ADD1"><block type="variables_get" id="ze#X}tuQfR)Bk8,#g_0-"><field name="VAR">Lampe</field></block></value>
! <value name="ADD2"><block type="text" id="V2|Gdi]?KbJF4B0_t_"><field name="TEXT">ist nun für dich eingeschaltet</field></block></value></block></value></block></statement></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></next></block></statement></block></statement>
! <next><block type="comment" id="5Yf.HQ]yhXY:~9I]+/,"><field name="COMMENT">fülle Text mit Nichts</field> ! <next><block type="variables_set" id="OlSf!LMG}|;I~Y+av)/E"><field name="VAR">Person</field> ! <value name="VALUE"></value> ! <next><block type="timeouts_settimeout" id="_*c=IjJFS8Dsk}m1RD1#"><field name="NAME">timeout</field> ! <field name="DELAY">10000</field> ! <statement name="STATEMENT"><block type="controls_if" id="%rGFEjkUW0j=_d6d-Fb,"><mutation elseif="1"></mutation> ! <value name="IF0"><block type="logic_compare" id="u,g[ef[.Dd}MJK=}|-*L"><field name="OP">GT</field> ! <value name="A"><block type="text_indexOf" id="KKJ!@O]N|Z?;F:1uFN}J"><field name="END">FIRST</field> ! <value name="VALUE"><block type="get_value" id="C/y=-|F4YN*hm1WWX
3P"><field name="ATTR">val</field>
! <field name="OID">geofency.0.atHome</field></block></value>
! <value name="FIND"><shadow type="text" id="Z}}.rZDUhQi/]Bxw4uA)"><field name="TEXT">Nadine</field></shadow></value></block></value>
! <value name="B"><block type="math_number" id="Yt5haGq,Q)c9q0C3^BqL"><field name="NUM">0</field></block></value></block></value>
! <statement name="DO0"><block type="text_append" id="D)p{8iILZM5,+kqHvWN"><field name="VAR">Person</field> ! <value name="TEXT"><shadow type="text" id="51_VzYfiR#6|0jZRXhKj"><field name="TEXT">Nadine</field></shadow></value></block></statement> ! <value name="IF1"><block type="logic_compare" id="/(@D)4RI0PNk*pBv]ZL2"><field name="OP">GT</field> ! <value name="A"><block type="text_indexOf" id="LswV13r8pGx{gmLUn}6,"><field name="END">FIRST</field> ! <value name="VALUE"><block type="get_value" id="4b/a+AJ}^JjnY2HTo!PX"><field name="ATTR">val</field> ! <field name="OID">geofency.0.atHome</field></block></value> ! <value name="FIND"><shadow type="text" id="C=*1oNj%!1S__HX*b)l;"><field name="TEXT">Sven</field></shadow></value></block></value> ! <value name="B"><block type="math_number" id="l*^eUGAu|9@NFdoTVJ]L"><field name="NUM">0</field></block></value></block></value> ! <statement name="DO1"><block type="text_append" id="aiU=RG|%rQGakk%B(CIV"><field name="VAR">Person</field> ! <value name="TEXT"><shadow type="text" id="tT=I|II_;ft[;{5:{/V-"><field name="TEXT">Sven</field></shadow></value></block></statement> ! <next><block type="procedures_callnoreturn" id="hj0FStybpVmk@:Mh7Cer"><mutation name="Ansage"><arg name="wer kommt nach Hause"></arg></mutation> ! <value name="ARG0"><block type="text_join" id=";gjv+{L[.Q|_1ZXHSh0m"><mutation items="2"></mutation> ! <value name="ADD0"><block type="variables_get" id="*gfv;Z6{qHlakjZHp9qx"><field name="VAR">Person</field></block></value> ! <value name="ADD1"><block type="text" id="c*FO6wNIb.m
W+A.skdF"><field name="TEXT">kommt grade nach Hause</field></block></value></block></value></block></next></block></statement></block></next></block></next></block></next></block></next></block></statement></block></next></block>
! <block type="procedures_defnoreturn" id="H[ZO2CtX#nEUI7Qx(?L" x="662" y="-63"><mutation><arg name="Licht"></arg></mutation> ! <field name="NAME">Handymeldung</field> ! <comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment> ! <statement name="STACK"><block type="pushover" id="NlamwSsS}uVM-,Yd}]UC"><field name="PRIORITY">0</field> ! <value name="MESSAGE"><shadow type="text" id="jANWNBc=fM,r^M4?.hs/"><field name="TEXT">text</field></shadow> ! <block type="variables_get" id="tYN+(FR569_^DUoqGulQ"><field name="VAR">Licht</field></block></value></block></statement></block> ! <block type="procedures_defnoreturn" id="l/!@}~]//OrneQSUicv-" x="663" y="262"><mutation><arg name="wer kommt nach Hause"></arg></mutation> ! <field name="NAME">Ansage</field> ! <comment pinned="false" h="80" w="160">Beschreibe diese Funktion …</comment> ! <statement name="STACK"><block type="sayit" id="|JTa|Rs(
*F|l-97JqTt"><field name="INSTANCE">.0</field>
! <field name="LANGUAGE">de</field>
! <value name="MESSAGE"><shadow type="text" id="L3ir@_F{wteEr#U_^T~Q"><field name="TEXT">text</field></shadow>
! <block type="variables_get" id="|O}jMioZ@G,|`h}x6LSA"><field name="VAR">wer kommt nach Hause</field></block></value></block></statement></block></xml>Ist der Teil unter mache… falsch um einen Text zu füllen?
Auf jeden Fall schonmal 1000 Dank für deine Hilfe, nun bin ich fast am Ziel.
Gruß Sven
-
ACHTUNG das Ziel ist erreicht….
ich hatte nur einen Fehler gemacht und habe die Namen nicht klein geschrieben, deshalb funktionierte es nicht.
Nun geht es zu 100 %
TOP vielen Dank an euch und besonderen Dank @ rantanplan
Ich lasse den Fred noch ein wenig auf, fall ich noch weitere fehler bei den Bloklys habe und Hilfe benötige.
Gruß Sven