Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. Blockly
    5. "im Text suche...."

    NEWS

    • Wir empfehlen: Node.js 22.x

    • Neuer Blog: Fotos und Eindrücke aus Solingen

    • ioBroker goes Matter ... Matter Adapter in Stable

    "im Text suche...."

    This topic has been deleted. Only users with topic management privileges can see it.
    • J
      jwerlsdf last edited by

      Hallo,
      ich möchte gerne folgendes Json auslesen:

      {"input": "stelle mir einen wecker für Montag auf 6 uhr 10", 
      "intent": {
         		"intentName": "SetAlarm", 
         		"confidenceScore": 1.0}, 
         		"siteId": "Wohnzimmer", 
         		"id": "f19", 
         		"slots": 
         				[
         				{
         				"entity": "rhasspy/days", 
         				"value": {"kind": "Unknown", "value": "Montag"}, 
         				"slotName": "Tag", 
         				"rawValue": "Montag", 
         				"confidence": 1.0, 
         				"range": {"start": 28, "end": 34, "rawStart": 28, "rawEnd": 34}
         				}, 
         				{
         				"entity": "rhasspy/number", 
         				"value": {"kind": "Number", "value": 6}, 
         				"slotName": "stunde", 
         				"rawValue": "sechs", 
         				"confidence": 1.0, 
         				"range": {"start": 39, "end": 40, "rawStart": 39, "rawEnd": 44}
         				}, 
         				{
         				"entity": "rhasspy/number", 
         				"value": {"kind": "Number", "value": 10}, 
         				"slotName": "minute", 
         				"rawValue": "zehn", 
         				"confidence": 1.0, 
         				"range": {"start": 45, "end": 47, "rawStart": 49, "rawEnd": 53}
         				}
         				], 
         		"sessionId": "f194af5b-c162-4643-92e8-7a746c95c676", 
         		"customData": null, 
         		"asrTokens": [
         				[
         				{
         				"value": "stelle", 
         				"confidence": 1.0, 
         				"rangeStart": 0, 
         				"rangeEnd": 6, 
         				"time": null
         				}, 
         				{
         				"value": "mir", 
         				"confidence": 1.0, 
         				"rangeStart": 7, 
         				"rangeEnd": 10, 
         				"time": null
         				}, 
         				{
         				"value": "einen", 
         				"confidence": 1.0, 
         				"rangeStart": 11, 
         				"rangeEnd": 16,
         				"time": null
         				}, 
         				{
         				"value": "wecker", 
         				"confidence": 1.0, 
         				"rangeStart": 17, 
         				"rangeEnd": 23, 
         				"time": null
         				}, 
         				{
         				"value": "für", 
         				"confidence": 1.0, 
         				"rangeStart": 24, 
         				"rangeEnd": 27, 
         				"time": null
         				}, 
         				{
         				"value": "Montag", 
         				"confidence": 1.0, 
         				"rangeStart": 28, 
         				"rangeEnd": 34, 
         				"time": null
         				}, 
         				{
         				"value": "auf", 
         				"confidence": 1.0, 
         				"rangeStart": 35, 
         				"rangeEnd": 38, 
         				"time": null
         				}, 
         				{
         				"value": "6", 
         				"confidence": 1.0, 
         				"rangeStart": 39, 
         				"rangeEnd": 40, 
         				"time": null
         				}, 
         				{
         				"value": "uhr", 
         				"confidence": 1.0, 
         				"rangeStart": 41, 
         				"rangeEnd": 44, 
         				"time": null
         				}, 
         				{
         				"value": "10", 
         				"confidence": 1.0, 
         				"rangeStart": 45, 
         				"rangeEnd": 47, 
         				"time": null
         				}
         				]
         			], 
         		"asrConfidence": null, 
         		"rawInput": "stelle mir einen Wecker für Montag auf 6 Uhr 10", 
         		"wakewordId": null, 
         		"lang": null
         	}
      

      Jetzt habe ich es schon mal so weit hinbekommen, dass ich die Stunde im Datenpunkt angezeigt bekomme.

      <xml xmlns="https://developers.google.com/blockly/xml">
       <variables>
         <variable id="|A(#s1Q|dT6w7z+zQyHz">value</variable>
         <variable id="OP[n8/:%8L#3S*:zFXMV">Tag</variable>
         <variable id="T!V%u*?{Lo@u?5]B+)H$">Zahl</variable>
       </variables>
       <block type="variables_set" id="e{I*$T]o}hp8Q8}L+#{f" x="213" y="113">
         <field name="VAR" id="|A(#s1Q|dT6w7z+zQyHz">value</field>
         <value name="VALUE">
           <block type="math_number" id="DL+[[L|{=(4u](q7eF.o">
             <field name="NUM">0</field>
           </block>
         </value>
         <next>
           <block type="on" id="iLJj3nj3c/!TmdW8Yh$f">
             <field name="OID">mqtt.0.hermes.intent.SetAlarm</field>
             <field name="CONDITION">ne</field>
             <field name="ACK_CONDITION"></field>
             <statement name="STATEMENT">
               <block type="variables_set" id="2Pk.06df8uC29xlRePa*">
                 <field name="VAR" id="OP[n8/:%8L#3S*:zFXMV">Tag</field>
                 <value name="VALUE">
                   <block type="text_indexOf" id="8+qMs?x;=:Fpi;q~+VMa">
                     <field name="END">FIRST</field>
                     <value name="VALUE">
                       <block type="get_value" id="dc!siC#~|0eWHgt4QXqr">
                         <field name="ATTR">val</field>
                         <field name="OID">mqtt.0.hermes.intent.SetAlarm</field>
                       </block>
                     </value>
                     <value name="FIND">
                       <shadow type="text" id="TlK#%NYO+FjqZlfL:HJx">
                         <field name="TEXT">Tag</field>
                       </shadow>
                     </value>
                   </block>
                 </value>
                 <next>
                   <block type="variables_set" id="pGY[b~[G:)cfBCrc91=U">
                     <field name="VAR" id="|A(#s1Q|dT6w7z+zQyHz">value</field>
                     <value name="VALUE">
                       <block type="text_indexOf" id="q9ki9#CsxV/{_4TMZasW">
                         <field name="END">FIRST</field>
                         <value name="VALUE">
                           <block type="get_value" id="$~2Y|lp;Z;[ECrGJC%@-">
                             <field name="ATTR">val</field>
                             <field name="OID">mqtt.0.hermes.intent.SetAlarm</field>
                           </block>
                         </value>
                         <value name="FIND">
                           <shadow type="text" id=":yfmC+l}Y[Z4v+$t_wOc">
                             <field name="TEXT">"Number", "value": </field>
                           </shadow>
                         </value>
                       </block>
                     </value>
                     <next>
                       <block type="variables_set" id="Q.|`xbPB9Kc/4)3tii:,">
                         <field name="VAR" id="T!V%u*?{Lo@u?5]B+)H$">Zahl</field>
                         <value name="VALUE">
                           <block type="text_getSubstring" id="goWC9Y]:eah~9zv(DW/t">
                             <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="vAmx4X^mtrf|=x8N4N*k">
                                 <field name="ATTR">val</field>
                                 <field name="OID">mqtt.0.hermes.intent.SetAlarm</field>
                               </block>
                             </value>
                             <value name="AT1">
                               <block type="math_arithmetic" id="8SkLCGA1aZ:WeznQlVfR">
                                 <field name="OP">ADD</field>
                                 <value name="A">
                                   <shadow type="math_number" id="gmY92N!JXY,+!_^O/6s_">
                                     <field name="NUM">1</field>
                                   </shadow>
                                   <block type="variables_get" id="I(_okp%snZFDZ{RpU5^c">
                                     <field name="VAR" id="|A(#s1Q|dT6w7z+zQyHz">value</field>
                                   </block>
                                 </value>
                                 <value name="B">
                                   <shadow type="math_number" id="i`$j`5XKn6s~*sq|tvgP">
                                     <field name="NUM">18</field>
                                   </shadow>
                                 </value>
                               </block>
                             </value>
                             <value name="AT2">
                               <block type="math_arithmetic" id="_s+dNi*+FuD+/2rp3^oq">
                                 <field name="OP">ADD</field>
                                 <value name="A">
                                   <shadow type="math_number" id=")43cmDFXu^?4F*AN~+rD">
                                     <field name="NUM">1</field>
                                   </shadow>
                                   <block type="variables_get" id="k#tgw*/aI.jc+*`7n+vv">
                                     <field name="VAR" id="|A(#s1Q|dT6w7z+zQyHz">value</field>
                                   </block>
                                 </value>
                                 <value name="B">
                                   <shadow type="math_number" id="fvDbF#_Y$vk*Sm/;hV%f">
                                     <field name="NUM">21</field>
                                   </shadow>
                                 </value>
                               </block>
                             </value>
                           </block>
                         </value>
                         <next>
                           <block type="variables_set" id="DYC-tC_HX!sfPbf}bIo#">
                             <field name="VAR" id="T!V%u*?{Lo@u?5]B+)H$">Zahl</field>
                             <value name="VALUE">
                               <block type="convert_tonumber" id="WNXgm]`S(C=E_-`Oc;yz">
                                 <value name="VALUE">
                                   <block type="variables_get" id=".8PZm%eiejMn=Nfew=KJ">
                                     <field name="VAR" id="T!V%u*?{Lo@u?5]B+)H$">Zahl</field>
                                   </block>
                                 </value>
                               </block>
                             </value>
                             <next>
                               <block type="controls_if" id="4PtA40X1C(NhBM}s_7p4">
                                 <value name="IF0">
                                   <block type="logic_compare" id="D}5KH:mC%)Zcbh3mf-Fr">
                                     <field name="OP">GT</field>
                                     <value name="A">
                                       <block type="convert_tonumber" id="!nbou9Iq@I^*#33L/M[[">
                                         <value name="VALUE">
                                           <block type="variables_get" id="N*B1XtEy++Lm!5XI8N7i">
                                             <field name="VAR" id="OP[n8/:%8L#3S*:zFXMV">Tag</field>
                                           </block>
                                         </value>
                                       </block>
                                     </value>
                                     <value name="B">
                                       <block type="math_number" id="#d[P5e$#w!_|x%nXdi9#">
                                         <field name="NUM">0</field>
                                       </block>
                                     </value>
                                   </block>
                                 </value>
                                 <statement name="DO0">
                                   <block type="control" id="86iHv3LXsiT1xbiKCp}f">
                                     <mutation xmlns="http://www.w3.org/1999/xhtml" delay_input="false"></mutation>
                                     <field name="OID">0_userdata.0.Datenpunkte.Rhasspy.Wecker.Stunde</field>
                                     <field name="WITH_DELAY">FALSE</field>
                                     <value name="VALUE">
                                       <block type="variables_get" id="tAqiD9nM/kiPv@BrlrDz">
                                         <field name="VAR" id="T!V%u*?{Lo@u?5]B+)H$">Zahl</field>
                                       </block>
                                     </value>
                                   </block>
                                 </statement>
                               </block>
                             </next>
                           </block>
                         </next>
                       </block>
                     </next>
                   </block>
                 </next>
               </block>
             </statement>
           </block>
         </next>
       </block>
       <block type="logic_boolean" id="VJ@nv6*~Q;W,@*6MXJ0b" x="-762" y="238">
         <field name="BOOL">TRUE</field>
       </block>
      </xml>
      

      Meine Frage wäre aber nun, wie ich aus dem "im Text XXX suche erstes...." zu "im Text XXX suche zweites..." machen kann?
      Würde mir bitte jemand helfen?

      F 1 Reply Last reply Reply Quote 0
      • F
        fastfoot @jwerlsdf last edited by

        @jwerlsdf das json kannst du so auswerten
        Alarm.PNG

        J 1 Reply Last reply Reply Quote 1
        • J
          jwerlsdf @fastfoot last edited by jwerlsdf

          @fastfoot
          vielen Dank mit Attribut ging es 🙂

          1 Reply Last reply Reply Quote 0
          • First post
            Last post

          Support us

          ioBroker
          Community Adapters
          Donate

          858
          Online

          32.0k
          Users

          80.5k
          Topics

          1.3m
          Posts

          2
          3
          174
          Loading More Posts
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes
          Reply
          • Reply as topic
          Log in to reply
          Community
          Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen
          The ioBroker Community 2014-2023
          logo