- Home
- Deutsch
- Skripten / Logik
- Blockly
- Fürs Protokoll - Alexa schreibt mir was in Log. ;)
Fürs Protokoll - Alexa schreibt mir was in Log. ;)
-
Da ich öfter mal etwas schnell festhalten möchte, habe ich mir das kleine Skript überlegt.
Ich sag "Alexa, nur fürs Protokoll Wunschtext" und "Wunschtext" landet im logfile.
Keine Hexenkunst, aber ich finde es ganz witzig/nützlich.
(hab' mich übrigens für "nur fürs Protokoll" entschieden, da Alexa das besser zu verstehen scheint als nur "fürs Protokoll".
<xml xmlns="http://www.w3.org/1999/xhtml"> <variables> <variable type="" id="Cjv)tj:73yCeIt5POcx4">summay</variable> </variables> <block type="on" id="_je=5|)n*F$FcIa:{HwV" x="-713" y="112"> <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=")D)j~;if+uuvL1D$WYf7"> <value name="IF0"> <block type="logic_compare" id="KO[C`jW^H.r|rrXyH$6W"> <field name="OP">NEQ</field> <value name="A"> <block type="text_indexOf" id="J|CEG]2$${9k|VaIO8HP"> <field name="END">FIRST</field> <value name="VALUE"> <block type="on_source" id="3JGZpfn51HM]m0Ke]f=q"> <field name="ATTR">state.val</field> </block> </value> <value name="FIND"> <shadow type="text" id="6wwiU21HlqX/Tx)v4z[?"> <field name="TEXT">nur fürs protokoll</field> </shadow> </value> </block> </value> <value name="B"> <block type="math_number" id=",scg|}YSuO6qp2L1Qqe_"> <field name="NUM">0</field> </block> </value> </block> </value> <statement name="DO0"> <block type="variables_set" id="cf2)r+Q$!||*z+~FE1=D"> <field name="VAR" id="Cjv)tj:73yCeIt5POcx4" variabletype="">summay</field> <value name="VALUE"> <block type="on_source" id="sE6QsO97MScy315M[Q`V"> <field name="ATTR">state.val</field> </block> </value> <next> <block type="debug" id="}F#t^}_YjQ.~,B?+G,qu"> <field name="Severity">error</field> <value name="TEXT"> <shadow type="text" id="=X0~zEwWdivEdV)S5=t{"> <field name="TEXT">test</field> </shadow> <block type="text_join" id="dKja3j2z94:[2Q]M|-4Z"> <mutation items="3"></mutation> <value name="ADD0"> <block type="text" id="Zy`va@-Q5bL%3HC6r6@x"> <field name="TEXT">*** </field> </block> </value> <value name="ADD1"> <block type="text_getSubstring" id="4fU`mlJteHVrN]wjVzpk" inline="false"> <mutation at1="true" at2="false"></mutation> <field name="WHERE1">FROM_START</field> <field name="WHERE2">LAST</field> <value name="STRING"> <block type="variables_get" id="JekeRvEtU=|R/9X2R~}K"> <field name="VAR" id="Cjv)tj:73yCeIt5POcx4" variabletype="">summay</field> </block> </value> <value name="AT1"> <block type="math_arithmetic" id="g/X~qy^YUPI0b}D%{;(l" inline="false"> <field name="OP">ADD</field> <value name="A"> <shadow type="math_number" id="c-Sy-.KEualVf74_T%BK"> <field name="NUM">1</field> </shadow> <block type="text_indexOf" id="9@eW~x{z^,gc(:/D+c~("> <field name="END">FIRST</field> <value name="VALUE"> <block type="variables_get" id="ID!6ufanWCvOA$NT0?F1"> <field name="VAR" id="Cjv)tj:73yCeIt5POcx4" variabletype="">summay</field> </block> </value> <value name="FIND"> <shadow type="text" id="/_KbGi^fk6,/V[e?C5k*"> <field name="TEXT">fürs protokoll</field> </shadow> </value> </block> </value> <value name="B"> <shadow type="math_number" id="!JWqQ/x}H_/6Zk2iIc{)"> <field name="NUM">14</field> </shadow> </value> </block> </value> </block> </value> <value name="ADD2"> <block type="text" id="Q?aWvrG`LByNO*4Gzf4T"> <field name="TEXT"> ***</field> </block> </value> </block> </value> </block> </next> </block> </statement> </block> </statement> </block> </xml>
-
Nachtrag:
Mal noch schnell den "Kommaumwandler" aus meinem "Sprich mir nach auf Echo XY"-Skript eingepflegt.
<xml xmlns="http://www.w3.org/1999/xhtml"> <variables> <variable type="" id="b7aB$`+O!Gi*`TEysg7u">Text</variable> <variable type="undefined" id="Intervall">Intervall</variable> </variables> <block type="on" id="_je=5|)n*F$FcIa:{HwV" x="-713" y="112"> <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=")D)j~;if+uuvL1D$WYf7"> <value name="IF0"> <block type="logic_compare" id="KO[C`jW^H.r|rrXyH$6W"> <field name="OP">NEQ</field> <value name="A"> <block type="text_indexOf" id="J|CEG]2$${9k|VaIO8HP"> <field name="END">FIRST</field> <value name="VALUE"> <block type="on_source" id="3JGZpfn51HM]m0Ke]f=q"> <field name="ATTR">state.val</field> </block> </value> <value name="FIND"> <shadow type="text" id="6wwiU21HlqX/Tx)v4z[?"> <field name="TEXT">nur fürs protokoll</field> </shadow> </value> </block> </value> <value name="B"> <block type="math_number" id=",scg|}YSuO6qp2L1Qqe_"> <field name="NUM">0</field> </block> </value> </block> </value> <statement name="DO0"> <block type="variables_set" id="cf2)r+Q$!||*z+~FE1=D"> <field name="VAR" id="b7aB$`+O!Gi*`TEysg7u" variabletype="">Text</field> <value name="VALUE"> <block type="on_source" id="sE6QsO97MScy315M[Q`V"> <field name="ATTR">state.val</field> </block> </value> <next> <block type="timeouts_setinterval" id="UVjycmWflXVV2SbE)]+F"> <field name="NAME">Intervall</field> <field name="INTERVAL">100</field> <field name="UNIT">ms</field> <statement name="STATEMENT"> <block type="controls_if" id="R]nTftgI2vgH5N7]1tD$"> <mutation else="1"></mutation> <value name="IF0"> <block type="logic_compare" id="b|75y5AaTpgaA?]tgUd("> <field name="OP">NEQ</field> <value name="A"> <block type="text_indexOf" id="%|zOc7^!9v/4?civaO+8"> <field name="END">FIRST</field> <value name="VALUE"> <block type="variables_get" id="qW{xV%t.r:BjNy{(8^3x"> <field name="VAR" id="b7aB$`+O!Gi*`TEysg7u" variabletype="">Text</field> </block> </value> <value name="FIND"> <shadow type="text" id="83(;x8@{EcY@f{9H`L:$"> <field name="TEXT">komma</field> </shadow> </value> </block> </value> <value name="B"> <block type="math_number" id="mprJgFC+XDv]L}7PK@{i"> <field name="NUM">0</field> </block> </value> </block> </value> <statement name="DO0"> <block type="variables_set" id="nRzEv^#=bbpP@Ba4VkB3"> <field name="VAR" id="b7aB$`+O!Gi*`TEysg7u" variabletype="">Text</field> <value name="VALUE"> <block type="text_join" id="2}c372+7mpm@|G9K/.ZI"> <mutation items="4"></mutation> <value name="ADD0"> <block type="text_getSubstring" id="*G[V.I6c-2D1JK,Yd)W_"> <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="5Jvoy/)Lr(xU*Lb:wSpW"> <field name="VAR" id="b7aB$`+O!Gi*`TEysg7u" variabletype="">Text</field> </block> </value> <value name="AT2"> <block type="math_arithmetic" id="I/[^L.#$@b3d7HZqi.!1"> <field name="OP">MINUS</field> <value name="A"> <shadow type="math_number" id="Pbqc_BagmV4#c4CTH)x{"> <field name="NUM">1</field> </shadow> <block type="text_indexOf" id="Bt/L^%Zf)h$^._V6FW~="> <field name="END">FIRST</field> <value name="VALUE"> <block type="variables_get" id="nR?Ww:=hfe%UM4LGs@Sw"> <field name="VAR" id="b7aB$`+O!Gi*`TEysg7u" variabletype="">Text</field> </block> </value> <value name="FIND"> <shadow type="text" id="[}Etl~[m(`Z8Fw;D=U|M"> <field name="TEXT">komma</field> </shadow> </value> </block> </value> <value name="B"> <shadow type="math_number" id="vNS9.%L2T(bmg(1t2kf2"> <field name="NUM">2</field> </shadow> </value> </block> </value> </block> </value> <value name="ADD1"> <block type="text" id="0unT1,(-Deus|`2u%Z4)"> <field name="TEXT">,</field> </block> </value> <value name="ADD2"> <block type="text_getSubstring" id="^]^Mv)!:lf,IePsS[$m%"> <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="Lo%gytSqyxHWFR;IrpEq"> <field name="VAR" id="b7aB$`+O!Gi*`TEysg7u" variabletype="">Text</field> </block> </value> <value name="AT1"> <block type="math_arithmetic" id="aG_mg$^3^1rs+NZ4+|_e"> <field name="OP">ADD</field> <value name="A"> <shadow type="math_number" id="JwLmL+K/3(|#Dz*K/60O"> <field name="NUM">1</field> </shadow> <block type="text_indexOf" id="75Od)hwDjU/9nBwU=@Zt"> <field name="END">FIRST</field> <value name="VALUE"> <block type="variables_get" id="Z^gf}^E!%:mx,HG%bYXo"> <field name="VAR" id="b7aB$`+O!Gi*`TEysg7u" variabletype="">Text</field> </block> </value> <value name="FIND"> <shadow type="text" id="9[9?Blq]AZ9kGIhRfg!!"> <field name="TEXT">komma</field> </shadow> </value> </block> </value> <value name="B"> <shadow type="math_number" id="Jl9s[^T-9mXsr/sAgxwm"> <field name="NUM">5</field> </shadow> </value> </block> </value> <value name="AT2"> <block type="text_length" id="NgJpBmxaA~I$E-BZx,o^"> <value name="VALUE"> <shadow type="text" id="%]AH^~B]}M_Lv8o[(HJ@"> <field name="TEXT">abc</field> </shadow> <block type="variables_get" id="TS,[DHjNa7l9^=obpQmL"> <field name="VAR" id="b7aB$`+O!Gi*`TEysg7u" variabletype="">Text</field> </block> </value> </block> </value> </block> </value> </block> </value> </block> </statement> <statement name="ELSE"> <block type="timeouts_clearinterval" id="Ll0t;eP]hIMJkmItiN8j"> <field name="NAME">Intervall</field> <next> <block type="debug" id="}F#t^}_YjQ.~,B?+G,qu"> <field name="Severity">error</field> <value name="TEXT"> <shadow type="text" id="=X0~zEwWdivEdV)S5=t{"> <field name="TEXT">test</field> </shadow> <block type="text_join" id="dKja3j2z94:[2Q]M|-4Z"> <mutation items="3"></mutation> <value name="ADD0"> <block type="text" id="Zy`va@-Q5bL%3HC6r6@x"> <field name="TEXT">*** </field> </block> </value> <value name="ADD1"> <block type="text_getSubstring" id="4fU`mlJteHVrN]wjVzpk" inline="false"> <mutation at1="true" at2="false"></mutation> <field name="WHERE1">FROM_START</field> <field name="WHERE2">LAST</field> <value name="STRING"> <block type="variables_get" id="JekeRvEtU=|R/9X2R~}K"> <field name="VAR" id="b7aB$`+O!Gi*`TEysg7u" variabletype="">Text</field> </block> </value> <value name="AT1"> <block type="math_arithmetic" id="g/X~qy^YUPI0b}D%{;(l" inline="false"> <field name="OP">ADD</field> <value name="A"> <shadow type="math_number" id="c-Sy-.KEualVf74_T%BK"> <field name="NUM">1</field> </shadow> <block type="text_indexOf" id="9@eW~x{z^,gc(:/D+c~("> <field name="END">FIRST</field> <value name="VALUE"> <block type="variables_get" id="ID!6ufanWCvOA$NT0?F1"> <field name="VAR" id="b7aB$`+O!Gi*`TEysg7u" variabletype="">Text</field> </block> </value> <value name="FIND"> <shadow type="text" id="/_KbGi^fk6,/V[e?C5k*"> <field name="TEXT">fürs protokoll</field> </shadow> </value> </block> </value> <value name="B"> <shadow type="math_number" id="!JWqQ/x}H_/6Zk2iIc{)"> <field name="NUM">14</field> </shadow> </value> </block> </value> </block> </value> <value name="ADD2"> <block type="text" id="Q?aWvrG`LByNO*4Gzf4T"> <field name="TEXT"> ***</field> </block> </value> </block> </value> </block> </next> </block> </statement> </block> </statement> </block> </next> </block> </statement> </block> </statement> </block> </xml>
-
hatte zu deinem script noch eine idee - es gibt doch das script, welches das log für die vis aufbereitet - https://forum.iobroker.net/topic/13971/vorlage-js-log-datei-aufbereiten-für-vis?page=1 - darin könnte man speziell nach deinen eingaben filtern und diese in der vis anzeigen - man hätte dann ein eigenes "fenster (widget) " für die einträge - ein fenster mit diesen notizen
in vis: