Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. Blockly
    5. [gelöst] Blockly - ical Termin (heute) - Biathlon

    NEWS

    • ioBroker@Smart Living Forum Solingen, 14.06. - Agenda added

    • ioBroker goes Matter ... Matter Adapter in Stable

    • Monatsrückblick - April 2025

    [gelöst] Blockly - ical Termin (heute) - Biathlon

    This topic has been deleted. Only users with topic management privileges can see it.
    • liv-in-sky
      liv-in-sky last edited by

      @soc

      ich hab ein js welches xxx-minuten (einstellbar) vor dem termin - wenn ein suchwort - an telegram sendet

      location, zeit, datum, event

      //gibt ical termine - 30 min - vorher in telegram aus
      //@liv-insky 1.1..2022
      // Forum: https://forum.iobroker.net/topic/50894/blockly-ical-termin-heute-biathlon
      
             
      
      
      
      const dpTSJsonIcal1="ical.0.data.table"
      const dpAlexa='alexa2.0.Echo-Devices.G0916D10016202R7.Commands.speak'  //  not in use
      const anfangsZeitAnsage='09:00'   //  not in use
      const endZeitAnsage='23:00'       //  not in use
      const zeitMinutenAlarm=2700000;            //45 minuten
      const suchWort="test";
      const telegramInstanz="1";
      let replayArr=[]      
      let marker;      
      
      schedule(' * * * * *',  function () {       
      let myData=getState(dpTSJsonIcal1).val;
      let nowTime=new Date().getTime()  
        
      for (let i=0;i<myData.length;i++) {             // hier eigene schleife definieren
      let  dateTime=new Date(myData[i]._date).getTime() 
      marker=999;
      if(Number(dateTime)-Number(nowTime)<zeitMinutenAlarm && Number(dateTime)-Number(nowTime) >= 0 && myData[i].event.includes(suchWort) ) {  //log(myData[i].event+"-- "+Math.floor((Number(dateTime)-Number(nowTime))/1000/60 %60))
                                     for (let werto=0;werto<replayArr.length;werto++) { if(replayArr[werto].event == myData[i].event) {marker=werto} }
                                    
                                            if (marker==999){ /*rede(myData[i].event,i);*/ telegramme(myData[i].event,i,myData[i].location,myData[i].date,telegramInstanz) //setState(dpAlexa,myData[i].event) ; 
                                                              replayArr.push({ "event":myData[i].event, "remind":myData[i]._date })
                                            }   
      
       
      } else{let marker2=999
            for (let wertoo=0;wertoo<replayArr.length;wertoo++) { if(replayArr[wertoo].event == myData[i].event &&  replayArr[wertoo].remind ==myData[i]._date) {marker2=wertoo; /*log(" löschen Arr "+marker2)*/}
                                                                    if (marker2<999){ replayArr.splice(marker2,1);  marker2=999  } }
      
      
      }}    
      //log(JSON.stringify(replayArr))
      });          
       
      
      async function rede(vari,faktor){ if (compareTime(anfangsZeitAnsage, null, ">", null) && compareTime(endZeitAnsage, null, "<", null)) {
                                         let helper=Math.floor((zeitMinutenAlarm)/1000/60 %60).toString()
                                      await wait(faktor*6000);setState(dpAlexa,"Der Termin "+vari+" startet in "+helper+" Minuten")}}
      
      async function telegramme(vari,faktor,location,myDate,telegramInstanz){ if (true) {
                                         let helper=Math.floor((zeitMinutenAlarm)/1000/60 %60).toString()
                                      await wait(faktor*100); sendTo('telegram.'+telegramInstanz, {
                                                                                    text: ("Der Termin "+vari+" startet um "+myDate+" Minuten \n in "+location),
                                                                                    type: 'text'
                                                                                    });
                                      }}
      
      
      
      
      
      
      

      Image 2.png

      1 Reply Last reply Reply Quote 0
      • David G.
        David G. last edited by David G.

        Jetzt ist alles drinnen.

        So sieht es in telegram aus:
        Screenshot_20220101-173116_Telegram.jpg

        Reihenfolge kannst du ja beliebig tauschen.
        Nur wie oben schonmal geschrieben, die ersten beiden Blöcke bei erstelle Text aus müssen so bleiben

        Das Blockly:
        Screenshot_20220101-173054_Chrome.jpg


        Ich Arbeite mit der Instanz 1. Vermutlich musst du die Datenpunkte neu Verknüpfen für Instanz 0.

        <xml xmlns="https://developers.google.com/blockly/xml">
         <variables>
           <variable id="Nin}JW*y1Vp_$;},D.7Z">liste_term</variable>
           <variable id="1]Y7`n@:hU1lh4_N4rup">j</variable>
           <variable id="mOjNB}.j)RR3:k$kM.L7">obj_termin</variable>
           <variable id="%9%0UV]g*=a-{TDxkJ2t">termin</variable>
           <variable id="b)m])isudJ]Z:`l}GrRL">anstehende_termine</variable>
           <variable id="HIJ%UiQd%]r!t2:`_t9{">termin_datum</variable>
           <variable id="wPep`OX`O^fEpJ%f1ug~">ort</variable>
         </variables>
         <block type="schedule" id="+@r~S[6?t$[fT[H@DK@b" x="-188" y="2712">
           <field name="SCHEDULE">0 6 * * *</field>
           <statement name="STATEMENT">
             <block type="controls_if" id="SG1#fy:/LT+_LtWOw9:=">
               <value name="IF0">
                 <block type="logic_compare" id="~K9qxlSw$|iqluYn$=E[">
                   <field name="OP">GT</field>
                   <value name="A">
                     <block type="get_value" id="A#AM49+2rPo@~*`kpOQQ">
                       <field name="ATTR">val</field>
                       <field name="OID">ical.1.data.count</field>
                     </block>
                   </value>
                   <value name="B">
                     <block type="math_number" id="DE1qH{lXTOIL_qY{RJs#">
                       <field name="NUM">0</field>
                     </block>
                   </value>
                 </block>
               </value>
               <statement name="DO0">
                 <block type="variables_set" id="`%F3I5HDMm{W_0J_o3Y)">
                   <field name="VAR" id="Nin}JW*y1Vp_$;},D.7Z">liste_term</field>
                   <value name="VALUE">
                     <block type="get_value" id="mw}m)@^s7YhZ#N9.YJGR">
                       <field name="ATTR">val</field>
                       <field name="OID">ical.1.data.table</field>
                     </block>
                   </value>
                   <next>
                     <block type="controls_for" id="##,smlQZuUU$Hp)Deinv">
                       <field name="VAR" id="1]Y7`n@:hU1lh4_N4rup">j</field>
                       <value name="FROM">
                         <shadow type="math_number" id="A*J}_Qh+*662ncK7Jlh@">
                           <field name="NUM">1</field>
                         </shadow>
                       </value>
                       <value name="TO">
                         <shadow type="math_number" id="2+Y:blScaLJrd?cNIno]">
                           <field name="NUM">10</field>
                         </shadow>
                         <block type="get_value" id="ZVp^WlNoFoFa)X$]=GVR">
                           <field name="ATTR">val</field>
                           <field name="OID">ical.1.data.count</field>
                         </block>
                       </value>
                       <value name="BY">
                         <shadow type="math_number" id="cf2:f+!=u[45[`5A^oR)">
                           <field name="NUM">1</field>
                         </shadow>
                       </value>
                       <statement name="DO">
                         <block type="variables_set" id="d3!_@rJ(=rJBet8eg*aw">
                           <field name="VAR" id="mOjNB}.j)RR3:k$kM.L7">obj_termin</field>
                           <value name="VALUE">
                             <block type="lists_getIndex" id="9T);!$t,Au-eE3B~1Gv;">
                               <mutation statement="false" at="true"></mutation>
                               <field name="MODE">GET</field>
                               <field name="WHERE">FROM_START</field>
                               <value name="VALUE">
                                 <block type="variables_get" id="KK36xP*]R#Wbj5[ySvU{">
                                   <field name="VAR" id="Nin}JW*y1Vp_$;},D.7Z">liste_term</field>
                                 </block>
                               </value>
                               <value name="AT">
                                 <block type="variables_get" id="[9^LOR%D~X1zA:VdfwBl">
                                   <field name="VAR" id="1]Y7`n@:hU1lh4_N4rup">j</field>
                                 </block>
                               </value>
                             </block>
                           </value>
                           <next>
                             <block type="variables_set" id="9XU7hW*5T;uB$d$6ObCI">
                               <field name="VAR" id="%9%0UV]g*=a-{TDxkJ2t">termin</field>
                               <value name="VALUE">
                                 <block type="get_attr" id="E0Mq^IGJM,XR/(-,}CrK">
                                   <value name="PATH">
                                     <shadow type="text" id="[(Cf+VL;Ft7YO0(FBwSv">
                                       <field name="TEXT">event</field>
                                     </shadow>
                                   </value>
                                   <value name="OBJECT">
                                     <block type="variables_get" id="b_LG$ZW%TE8si5J(b:Mp">
                                       <field name="VAR" id="mOjNB}.j)RR3:k$kM.L7">obj_termin</field>
                                     </block>
                                   </value>
                                 </block>
                               </value>
                               <next>
                                 <block type="variables_set" id="L-4nSiPs7tQK){NhuP}A">
                                   <field name="VAR" id="HIJ%UiQd%]r!t2:`_t9{">termin_datum</field>
                                   <value name="VALUE">
                                     <block type="get_attr" id="zSyV5QdK]%VDm{0U--z[">
                                       <value name="PATH">
                                         <shadow type="text" id="kqX{$-vh9,M%3YP5wYpE">
                                           <field name="TEXT">_date</field>
                                         </shadow>
                                       </value>
                                       <value name="OBJECT">
                                         <block type="variables_get" id="5h-v#4$+b6F~R#^F6q~?">
                                           <field name="VAR" id="mOjNB}.j)RR3:k$kM.L7">obj_termin</field>
                                         </block>
                                       </value>
                                     </block>
                                   </value>
                                   <next>
                                     <block type="variables_set" id="jaM:)-h[SvzaVr$,1{ab">
                                       <field name="VAR" id="wPep`OX`O^fEpJ%f1ug~">ort</field>
                                       <value name="VALUE">
                                         <block type="get_attr" id="S@.?MCm42pqS,F.7ACRS">
                                           <value name="PATH">
                                             <shadow type="text" id="o#}lQtc57|^_4;Y_v?ZL">
                                               <field name="TEXT">location</field>
                                             </shadow>
                                           </value>
                                           <value name="OBJECT">
                                             <block type="variables_get" id="}=.Og}t-hG5EBFM#cyo#">
                                               <field name="VAR" id="mOjNB}.j)RR3:k$kM.L7">obj_termin</field>
                                             </block>
                                           </value>
                                         </block>
                                       </value>
                                       <next>
                                         <block type="variables_set" id="Xw~K{!s8GsBtx5@tIcn5">
                                           <field name="VAR" id="b)m])isudJ]Z:`l}GrRL">anstehende_termine</field>
                                           <value name="VALUE">
                                             <block type="text_join" id="^JUvnmon_{lP[DJIaZ+l">
                                               <mutation items="9"></mutation>
                                               <value name="ADD0">
                                                 <block type="variables_get" id="8?NV/z=,lX$)}a)_`g4F">
                                                   <field name="VAR" id="b)m])isudJ]Z:`l}GrRL">anstehende_termine</field>
                                                 </block>
                                               </value>
                                               <value name="ADD1">
                                                 <block type="text_newline" id="7R{vwZ4.$e7S-Pdi^@*)">
                                                   <field name="Type">\n</field>
                                                 </block>
                                               </value>
                                               <value name="ADD2">
                                                 <block type="convert_from_date" id="`0LFOX!yru]-[dfKDn}G">
                                                   <mutation xmlns="http://www.w3.org/1999/xhtml" format="false" language="false"></mutation>
                                                   <field name="OPTION">hh:mm</field>
                                                   <value name="VALUE">
                                                     <block type="variables_get" id="lUF[SJ-mp}FL]KEGtHLL">
                                                       <field name="VAR" id="HIJ%UiQd%]r!t2:`_t9{">termin_datum</field>
                                                     </block>
                                                   </value>
                                                 </block>
                                               </value>
                                               <value name="ADD3">
                                                 <block type="text" id="GN9N$whLIIW,lY5P7Zo+">
                                                   <field name="TEXT"> </field>
                                                 </block>
                                               </value>
                                               <value name="ADD4">
                                                 <block type="variables_get" id="iXe#+!7?SY/S9X]:9Cht">
                                                   <field name="VAR" id="%9%0UV]g*=a-{TDxkJ2t">termin</field>
                                                 </block>
                                               </value>
                                               <value name="ADD5">
                                                 <block type="text" id="V$=2#]/uVg5v=;6;2U`i">
                                                   <field name="TEXT"> - </field>
                                                 </block>
                                               </value>
                                               <value name="ADD6">
                                                 <block type="variables_get" id="aHEBYTk3^_wUHV(%(tdG">
                                                   <field name="VAR" id="wPep`OX`O^fEpJ%f1ug~">ort</field>
                                                 </block>
                                               </value>
                                             </block>
                                           </value>
                                         </block>
                                       </next>
                                     </block>
                                   </next>
                                 </block>
                               </next>
                             </block>
                           </next>
                         </block>
                       </statement>
                       <next>
                         <block type="telegram" id="%R4ujjx,8M^2tV9xvj`^">
                           <field name="INSTANCE">.0</field>
                           <field name="LOG"></field>
                           <field name="SILENT">FALSE</field>
                           <field name="PARSEMODE">default</field>
                           <value name="MESSAGE">
                             <shadow type="text" id="|Y0fQkiSY@@x6f:|czT0">
                               <field name="TEXT">text</field>
                             </shadow>
                             <block type="variables_get" id=":NHFv)_bDjl2xvAC5Te~">
                               <field name="VAR" id="b)m])isudJ]Z:`l}GrRL">anstehende_termine</field>
                             </block>
                           </value>
                         </block>
                       </next>
                     </block>
                   </next>
                 </block>
               </statement>
             </block>
           </statement>
         </block>
        </xml>
        

        S 1 Reply Last reply Reply Quote 1
        • S
          Soc @David G. last edited by

          @david-g Super David.
          Einen herzlichen Dank und hoffentlich hat Deine Frau davon nix mitbekommen... 😉

          David G. 1 Reply Last reply Reply Quote 0
          • David G.
            David G. @Soc last edited by David G.

            @soc

            Gerne,

            hat gepasst.
            Am Smartphone kann man da ja zwischendurch immer mal wieder was machen.

            Kannst ha ein [gelöst] vor deinen Titel vom Beitrag setzen

            Noch was zum Blockly.
            Falls du keinen Ort eingegeben hast, steht da trotzdem immer das "-" am Ende der Zeile bei dieser Variabte.
            Könnte man aber auch noch wegbekommen mit einer Abfrage.

            1 Reply Last reply Reply Quote 0
            • David G.
              David G. last edited by

              Lasse das Blockly bei mir auch mal laufen.
              Mich hat das "-" was gestört.

              Hier habe ich es jetzt entfernt, falls lan Ort eingegeben ist.

              <block xmlns="https://developers.google.com/blockly/xml" type="controls_if" id="SG1#fy:/LT+_LtWOw9:=" x="39.319948733669946" y="2932.8166729250734">
                <value name="IF0">
                  <block type="logic_compare" id="~K9qxlSw$|iqluYn$=E[">
                    <field name="OP">GT</field>
                    <value name="A">
                      <block type="get_value" id="A#AM49+2rPo@~*`kpOQQ">
                        <field name="ATTR">val</field>
                        <field name="OID">ical.1.data.count</field>
                      </block>
                    </value>
                    <value name="B">
                      <block type="math_number" id="DE1qH{lXTOIL_qY{RJs#">
                        <field name="NUM">0</field>
                      </block>
                    </value>
                  </block>
                </value>
                <statement name="DO0">
                  <block type="variables_set" id="`%F3I5HDMm{W_0J_o3Y)">
                    <field name="VAR" id="Nin}JW*y1Vp_$;},D.7Z">liste_term</field>
                    <value name="VALUE">
                      <block type="get_value" id="mw}m)@^s7YhZ#N9.YJGR">
                        <field name="ATTR">val</field>
                        <field name="OID">ical.1.data.table</field>
                      </block>
                    </value>
                    <next>
                      <block type="controls_for" id="##,smlQZuUU$Hp)Deinv">
                        <field name="VAR" id="1]Y7`n@:hU1lh4_N4rup">j</field>
                        <value name="FROM">
                          <shadow type="math_number" id="A*J}_Qh+*662ncK7Jlh@">
                            <field name="NUM">1</field>
                          </shadow>
                        </value>
                        <value name="TO">
                          <shadow type="math_number" id="2+Y:blScaLJrd?cNIno]">
                            <field name="NUM">10</field>
                          </shadow>
                          <block type="get_value" id="ZVp^WlNoFoFa)X$]=GVR">
                            <field name="ATTR">val</field>
                            <field name="OID">ical.1.data.count</field>
                          </block>
                        </value>
                        <value name="BY">
                          <shadow type="math_number" id="cf2:f+!=u[45[`5A^oR)">
                            <field name="NUM">1</field>
                          </shadow>
                        </value>
                        <statement name="DO">
                          <block type="variables_set" id="d3!_@rJ(=rJBet8eg*aw">
                            <field name="VAR" id="mOjNB}.j)RR3:k$kM.L7">obj_termin</field>
                            <value name="VALUE">
                              <block type="lists_getIndex" id="9T);!$t,Au-eE3B~1Gv;">
                                <mutation statement="false" at="true"></mutation>
                                <field name="MODE">GET</field>
                                <field name="WHERE">FROM_START</field>
                                <value name="VALUE">
                                  <block type="variables_get" id="KK36xP*]R#Wbj5[ySvU{">
                                    <field name="VAR" id="Nin}JW*y1Vp_$;},D.7Z">liste_term</field>
                                  </block>
                                </value>
                                <value name="AT">
                                  <block type="variables_get" id="[9^LOR%D~X1zA:VdfwBl">
                                    <field name="VAR" id="1]Y7`n@:hU1lh4_N4rup">j</field>
                                  </block>
                                </value>
                              </block>
                            </value>
                            <next>
                              <block type="variables_set" id="9XU7hW*5T;uB$d$6ObCI">
                                <field name="VAR" id="%9%0UV]g*=a-{TDxkJ2t">termin</field>
                                <value name="VALUE">
                                  <block type="get_attr" id="E0Mq^IGJM,XR/(-,}CrK">
                                    <value name="PATH">
                                      <shadow type="text" id="[(Cf+VL;Ft7YO0(FBwSv">
                                        <field name="TEXT">event</field>
                                      </shadow>
                                    </value>
                                    <value name="OBJECT">
                                      <block type="variables_get" id="b_LG$ZW%TE8si5J(b:Mp">
                                        <field name="VAR" id="mOjNB}.j)RR3:k$kM.L7">obj_termin</field>
                                      </block>
                                    </value>
                                  </block>
                                </value>
                                <next>
                                  <block type="variables_set" id="L-4nSiPs7tQK){NhuP}A">
                                    <field name="VAR" id="HIJ%UiQd%]r!t2:`_t9{">termin_datum</field>
                                    <value name="VALUE">
                                      <block type="get_attr" id="zSyV5QdK]%VDm{0U--z[">
                                        <value name="PATH">
                                          <shadow type="text" id="kqX{$-vh9,M%3YP5wYpE">
                                            <field name="TEXT">_date</field>
                                          </shadow>
                                        </value>
                                        <value name="OBJECT">
                                          <block type="variables_get" id="5h-v#4$+b6F~R#^F6q~?">
                                            <field name="VAR" id="mOjNB}.j)RR3:k$kM.L7">obj_termin</field>
                                          </block>
                                        </value>
                                      </block>
                                    </value>
                                    <next>
                                      <block type="variables_set" id="jaM:)-h[SvzaVr$,1{ab">
                                        <field name="VAR" id="wPep`OX`O^fEpJ%f1ug~">ort</field>
                                        <value name="VALUE">
                                          <block type="get_attr" id="S@.?MCm42pqS,F.7ACRS">
                                            <value name="PATH">
                                              <shadow type="text" id="o#}lQtc57|^_4;Y_v?ZL">
                                                <field name="TEXT">location</field>
                                              </shadow>
                                            </value>
                                            <value name="OBJECT">
                                              <block type="variables_get" id="}=.Og}t-hG5EBFM#cyo#">
                                                <field name="VAR" id="mOjNB}.j)RR3:k$kM.L7">obj_termin</field>
                                              </block>
                                            </value>
                                          </block>
                                        </value>
                                        <next>
                                          <block type="controls_if" id="];.6ad~@C_k*YA=JZ5i9">
                                            <value name="IF0">
                                              <block type="logic_compare" id="W3Thh$n.r^`gcD#+i8rp">
                                                <field name="OP">NEQ</field>
                                                <value name="A">
                                                  <block type="variables_get" id="#kvnaF6A0U`v9#.5WCE5">
                                                    <field name="VAR" id="wPep`OX`O^fEpJ%f1ug~">ort</field>
                                                  </block>
                                                </value>
                                                <value name="B">
                                                  <block type="text" id="{=:*8e0i=^KG;@j4``p+">
                                                    <field name="TEXT"></field>
                                                  </block>
                                                </value>
                                              </block>
                                            </value>
                                            <statement name="DO0">
                                              <block type="variables_set" id="ik!KO.`x;blY`Ov]_k6E">
                                                <field name="VAR" id=";b3g/W*e;GFH|}7)uzqt">text_ort</field>
                                                <value name="VALUE">
                                                  <block type="text_join" id="SO{-r$OY3{_Q63o]:XHk">
                                                    <mutation items="2"></mutation>
                                                    <value name="ADD0">
                                                      <block type="text" id="V$=2#]/uVg5v=;6;2U`i">
                                                        <field name="TEXT"> - </field>
                                                      </block>
                                                    </value>
                                                    <value name="ADD1">
                                                      <block type="variables_get" id="aHEBYTk3^_wUHV(%(tdG">
                                                        <field name="VAR" id="wPep`OX`O^fEpJ%f1ug~">ort</field>
                                                      </block>
                                                    </value>
                                                  </block>
                                                </value>
                                              </block>
                                            </statement>
                                            <next>
                                              <block type="variables_set" id="Xw~K{!s8GsBtx5@tIcn5">
                                                <field name="VAR" id="b)m])isudJ]Z:`l}GrRL">anstehende_termine</field>
                                                <value name="VALUE">
                                                  <block type="text_join" id="^JUvnmon_{lP[DJIaZ+l">
                                                    <mutation items="9"></mutation>
                                                    <value name="ADD0">
                                                      <block type="variables_get" id="8?NV/z=,lX$)}a)_`g4F">
                                                        <field name="VAR" id="b)m])isudJ]Z:`l}GrRL">anstehende_termine</field>
                                                      </block>
                                                    </value>
                                                    <value name="ADD1">
                                                      <block type="text_newline" id="7R{vwZ4.$e7S-Pdi^@*)">
                                                        <field name="Type">\n</field>
                                                      </block>
                                                    </value>
                                                    <value name="ADD2">
                                                      <block type="convert_from_date" id="`0LFOX!yru]-[dfKDn}G">
                                                        <mutation xmlns="http://www.w3.org/1999/xhtml" format="false" language="false"></mutation>
                                                        <field name="OPTION">hh:mm</field>
                                                        <value name="VALUE">
                                                          <block type="variables_get" id="lUF[SJ-mp}FL]KEGtHLL">
                                                            <field name="VAR" id="HIJ%UiQd%]r!t2:`_t9{">termin_datum</field>
                                                          </block>
                                                        </value>
                                                      </block>
                                                    </value>
                                                    <value name="ADD3">
                                                      <block type="text" id="GN9N$whLIIW,lY5P7Zo+">
                                                        <field name="TEXT"> </field>
                                                      </block>
                                                    </value>
                                                    <value name="ADD4">
                                                      <block type="variables_get" id="iXe#+!7?SY/S9X]:9Cht">
                                                        <field name="VAR" id="%9%0UV]g*=a-{TDxkJ2t">termin</field>
                                                      </block>
                                                    </value>
                                                    <value name="ADD5">
                                                      <block type="variables_get" id="dLJn1$?9Zb38^?_[j_5-">
                                                        <field name="VAR" id=";b3g/W*e;GFH|}7)uzqt">text_ort</field>
                                                      </block>
                                                    </value>
                                                  </block>
                                                </value>
                                              </block>
                                            </next>
                                          </block>
                                        </next>
                                      </block>
                                    </next>
                                  </block>
                                </next>
                              </block>
                            </next>
                          </block>
                        </statement>
                        <next>
                          <block type="telegram" id="%R4ujjx,8M^2tV9xvj`^">
                            <field name="INSTANCE">.0</field>
                            <field name="LOG"></field>
                            <field name="SILENT">FALSE</field>
                            <field name="PARSEMODE">default</field>
                            <value name="MESSAGE">
                              <shadow type="text" id="|Y0fQkiSY@@x6f:|czT0">
                                <field name="TEXT">text</field>
                              </shadow>
                              <block type="variables_get" id=":NHFv)_bDjl2xvAC5Te~">
                                <field name="VAR" id="b)m])isudJ]Z:`l}GrRL">anstehende_termine</field>
                              </block>
                            </value>
                          </block>
                        </next>
                      </block>
                    </next>
                  </block>
                </statement>
              </block>
              
              1 Reply Last reply Reply Quote 0
              • David G.
                David G. @Soc last edited by

                @soc

                Hey,
                war noch ein kleiner Fehler im Skript.
                Die letzten Termine wurden nicht aus dem Text gelöscht und standen dann an den nächsten Tagen auch noch in der telegram.

                Zusätzlich habe ich noch eine Überschrift mit der Anzahl der Termine (mit berücksichtigung Einzahl/Mehrzahl) eingebaut.

                <xml xmlns="https://developers.google.com/blockly/xml">
                  <variables>
                    <variable id="b)m])isudJ]Z:`l}GrRL">anstehende_termine</variable>
                    <variable id="Nin}JW*y1Vp_$;},D.7Z">liste_term</variable>
                    <variable id="1]Y7`n@:hU1lh4_N4rup">j</variable>
                    <variable id="mOjNB}.j)RR3:k$kM.L7">obj_termin</variable>
                    <variable id="%9%0UV]g*=a-{TDxkJ2t">termin</variable>
                    <variable id=")kOGElBJiWDGZET7n=3d">ueberschrift</variable>
                    <variable id="HIJ%UiQd%]r!t2:`_t9{">termin_datum</variable>
                    <variable id="wPep`OX`O^fEpJ%f1ug~">ort</variable>
                    <variable id=";b3g/W*e;GFH|}7)uzqt">text_ort</variable>
                  </variables>
                  <block type="schedule" id="+@r~S[6?t$[fT[H@DK@b" x="54" y="2892">
                    <field name="SCHEDULE">0 6 * * *</field>
                    <statement name="STATEMENT">
                      <block type="controls_if" id="SG1#fy:/LT+_LtWOw9:=">
                        <value name="IF0">
                          <block type="logic_compare" id="~K9qxlSw$|iqluYn$=E[">
                            <field name="OP">GT</field>
                            <value name="A">
                              <block type="get_value" id="A#AM49+2rPo@~*`kpOQQ">
                                <field name="ATTR">val</field>
                                <field name="OID">ical.1.data.count</field>
                              </block>
                            </value>
                            <value name="B">
                              <block type="math_number" id="DE1qH{lXTOIL_qY{RJs#">
                                <field name="NUM">0</field>
                              </block>
                            </value>
                          </block>
                        </value>
                        <statement name="DO0">
                          <block type="variables_set" id="A^gv{inh+6lkFP3AX0v7">
                            <field name="VAR" id="b)m])isudJ]Z:`l}GrRL">anstehende_termine</field>
                            <value name="VALUE">
                              <block type="text" id="I||/lc65%R)%%Q/90zlN">
                                <field name="TEXT"></field>
                              </block>
                            </value>
                            <next>
                              <block type="variables_set" id="`%F3I5HDMm{W_0J_o3Y)">
                                <field name="VAR" id="Nin}JW*y1Vp_$;},D.7Z">liste_term</field>
                                <value name="VALUE">
                                  <block type="get_value" id="mw}m)@^s7YhZ#N9.YJGR">
                                    <field name="ATTR">val</field>
                                    <field name="OID">ical.1.data.table</field>
                                  </block>
                                </value>
                                <next>
                                  <block type="controls_for" id="##,smlQZuUU$Hp)Deinv">
                                    <field name="VAR" id="1]Y7`n@:hU1lh4_N4rup">j</field>
                                    <value name="FROM">
                                      <shadow type="math_number" id="A*J}_Qh+*662ncK7Jlh@">
                                        <field name="NUM">1</field>
                                      </shadow>
                                    </value>
                                    <value name="TO">
                                      <shadow type="math_number" id="2+Y:blScaLJrd?cNIno]">
                                        <field name="NUM">10</field>
                                      </shadow>
                                      <block type="get_value" id="ZVp^WlNoFoFa)X$]=GVR">
                                        <field name="ATTR">val</field>
                                        <field name="OID">ical.1.data.count</field>
                                      </block>
                                    </value>
                                    <value name="BY">
                                      <shadow type="math_number" id="cf2:f+!=u[45[`5A^oR)">
                                        <field name="NUM">1</field>
                                      </shadow>
                                    </value>
                                    <statement name="DO">
                                      <block type="variables_set" id="d3!_@rJ(=rJBet8eg*aw">
                                        <field name="VAR" id="mOjNB}.j)RR3:k$kM.L7">obj_termin</field>
                                        <value name="VALUE">
                                          <block type="lists_getIndex" id="9T);!$t,Au-eE3B~1Gv;">
                                            <mutation statement="false" at="true"></mutation>
                                            <field name="MODE">GET</field>
                                            <field name="WHERE">FROM_START</field>
                                            <value name="VALUE">
                                              <block type="variables_get" id="KK36xP*]R#Wbj5[ySvU{">
                                                <field name="VAR" id="Nin}JW*y1Vp_$;},D.7Z">liste_term</field>
                                              </block>
                                            </value>
                                            <value name="AT">
                                              <block type="variables_get" id="[9^LOR%D~X1zA:VdfwBl">
                                                <field name="VAR" id="1]Y7`n@:hU1lh4_N4rup">j</field>
                                              </block>
                                            </value>
                                          </block>
                                        </value>
                                        <next>
                                          <block type="variables_set" id="9XU7hW*5T;uB$d$6ObCI">
                                            <field name="VAR" id="%9%0UV]g*=a-{TDxkJ2t">termin</field>
                                            <value name="VALUE">
                                              <block type="get_attr" id="E0Mq^IGJM,XR/(-,}CrK">
                                                <value name="PATH">
                                                  <shadow type="text" id="[(Cf+VL;Ft7YO0(FBwSv">
                                                    <field name="TEXT">event</field>
                                                  </shadow>
                                                </value>
                                                <value name="OBJECT">
                                                  <block type="variables_get" id="b_LG$ZW%TE8si5J(b:Mp">
                                                    <field name="VAR" id="mOjNB}.j)RR3:k$kM.L7">obj_termin</field>
                                                  </block>
                                                </value>
                                              </block>
                                            </value>
                                            <next>
                                              <block type="variables_set" id="L-4nSiPs7tQK){NhuP}A">
                                                <field name="VAR" id="HIJ%UiQd%]r!t2:`_t9{">termin_datum</field>
                                                <value name="VALUE">
                                                  <block type="get_attr" id="zSyV5QdK]%VDm{0U--z[">
                                                    <value name="PATH">
                                                      <shadow type="text" id="kqX{$-vh9,M%3YP5wYpE">
                                                        <field name="TEXT">_date</field>
                                                      </shadow>
                                                    </value>
                                                    <value name="OBJECT">
                                                      <block type="variables_get" id="5h-v#4$+b6F~R#^F6q~?">
                                                        <field name="VAR" id="mOjNB}.j)RR3:k$kM.L7">obj_termin</field>
                                                      </block>
                                                    </value>
                                                  </block>
                                                </value>
                                                <next>
                                                  <block type="variables_set" id="jaM:)-h[SvzaVr$,1{ab">
                                                    <field name="VAR" id="wPep`OX`O^fEpJ%f1ug~">ort</field>
                                                    <value name="VALUE">
                                                      <block type="get_attr" id="S@.?MCm42pqS,F.7ACRS">
                                                        <value name="PATH">
                                                          <shadow type="text" id="o#}lQtc57|^_4;Y_v?ZL">
                                                            <field name="TEXT">location</field>
                                                          </shadow>
                                                        </value>
                                                        <value name="OBJECT">
                                                          <block type="variables_get" id="}=.Og}t-hG5EBFM#cyo#">
                                                            <field name="VAR" id="mOjNB}.j)RR3:k$kM.L7">obj_termin</field>
                                                          </block>
                                                        </value>
                                                      </block>
                                                    </value>
                                                    <next>
                                                      <block type="controls_if" id="];.6ad~@C_k*YA=JZ5i9">
                                                        <value name="IF0">
                                                          <block type="logic_compare" id="W3Thh$n.r^`gcD#+i8rp">
                                                            <field name="OP">NEQ</field>
                                                            <value name="A">
                                                              <block type="variables_get" id="#kvnaF6A0U`v9#.5WCE5">
                                                                <field name="VAR" id="wPep`OX`O^fEpJ%f1ug~">ort</field>
                                                              </block>
                                                            </value>
                                                            <value name="B">
                                                              <block type="text" id="{=:*8e0i=^KG;@j4``p+">
                                                                <field name="TEXT"></field>
                                                              </block>
                                                            </value>
                                                          </block>
                                                        </value>
                                                        <statement name="DO0">
                                                          <block type="variables_set" id="ik!KO.`x;blY`Ov]_k6E">
                                                            <field name="VAR" id=";b3g/W*e;GFH|}7)uzqt">text_ort</field>
                                                            <value name="VALUE">
                                                              <block type="text_join" id="SO{-r$OY3{_Q63o]:XHk">
                                                                <mutation items="2"></mutation>
                                                                <value name="ADD0">
                                                                  <block type="text" id="V$=2#]/uVg5v=;6;2U`i">
                                                                    <field name="TEXT"> - </field>
                                                                  </block>
                                                                </value>
                                                                <value name="ADD1">
                                                                  <block type="variables_get" id="aHEBYTk3^_wUHV(%(tdG">
                                                                    <field name="VAR" id="wPep`OX`O^fEpJ%f1ug~">ort</field>
                                                                  </block>
                                                                </value>
                                                              </block>
                                                            </value>
                                                          </block>
                                                        </statement>
                                                        <next>
                                                          <block type="variables_set" id="Xw~K{!s8GsBtx5@tIcn5">
                                                            <field name="VAR" id="b)m])isudJ]Z:`l}GrRL">anstehende_termine</field>
                                                            <value name="VALUE">
                                                              <block type="text_join" id="^JUvnmon_{lP[DJIaZ+l">
                                                                <mutation items="9"></mutation>
                                                                <value name="ADD0">
                                                                  <block type="variables_get" id="8?NV/z=,lX$)}a)_`g4F">
                                                                    <field name="VAR" id="b)m])isudJ]Z:`l}GrRL">anstehende_termine</field>
                                                                  </block>
                                                                </value>
                                                                <value name="ADD1">
                                                                  <block type="text_newline" id="7R{vwZ4.$e7S-Pdi^@*)">
                                                                    <field name="Type">\n</field>
                                                                  </block>
                                                                </value>
                                                                <value name="ADD2">
                                                                  <block type="convert_from_date" id="`0LFOX!yru]-[dfKDn}G">
                                                                    <mutation xmlns="http://www.w3.org/1999/xhtml" format="false" language="false"></mutation>
                                                                    <field name="OPTION">hh:mm</field>
                                                                    <value name="VALUE">
                                                                      <block type="variables_get" id="lUF[SJ-mp}FL]KEGtHLL">
                                                                        <field name="VAR" id="HIJ%UiQd%]r!t2:`_t9{">termin_datum</field>
                                                                      </block>
                                                                    </value>
                                                                  </block>
                                                                </value>
                                                                <value name="ADD3">
                                                                  <block type="text" id="GN9N$whLIIW,lY5P7Zo+">
                                                                    <field name="TEXT"> </field>
                                                                  </block>
                                                                </value>
                                                                <value name="ADD4">
                                                                  <block type="variables_get" id="iXe#+!7?SY/S9X]:9Cht">
                                                                    <field name="VAR" id="%9%0UV]g*=a-{TDxkJ2t">termin</field>
                                                                  </block>
                                                                </value>
                                                                <value name="ADD5">
                                                                  <block type="variables_get" id="dLJn1$?9Zb38^?_[j_5-">
                                                                    <field name="VAR" id=";b3g/W*e;GFH|}7)uzqt">text_ort</field>
                                                                  </block>
                                                                </value>
                                                              </block>
                                                            </value>
                                                          </block>
                                                        </next>
                                                      </block>
                                                    </next>
                                                  </block>
                                                </next>
                                              </block>
                                            </next>
                                          </block>
                                        </next>
                                      </block>
                                    </statement>
                                    <next>
                                      <block type="controls_if" id="1H`wxWFx)5v%l`?A)d7$">
                                        <mutation else="1"></mutation>
                                        <value name="IF0">
                                          <block type="logic_compare" id="64:^5hQJ`O%//%%Co;SR">
                                            <field name="OP">EQ</field>
                                            <value name="A">
                                              <block type="get_value" id="JvJp|gQR7za=Tpt8~DL(">
                                                <field name="ATTR">val</field>
                                                <field name="OID">ical.1.data.count</field>
                                              </block>
                                            </value>
                                            <value name="B">
                                              <block type="math_number" id="!Wp98-jMN0RLQ.hoA30V">
                                                <field name="NUM">1</field>
                                              </block>
                                            </value>
                                          </block>
                                        </value>
                                        <statement name="DO0">
                                          <block type="variables_set" id="OWqMiJ[;+-QyEa~oeatG">
                                            <field name="VAR" id=")kOGElBJiWDGZET7n=3d">ueberschrift</field>
                                            <value name="VALUE">
                                              <block type="text" id="5m+LKpUN~`(Vd-rr(1Rg">
                                                <field name="TEXT">Heute steht ein Termin an:</field>
                                              </block>
                                            </value>
                                          </block>
                                        </statement>
                                        <statement name="ELSE">
                                          <block type="variables_set" id="ZBMh/EPtDj`@_B|]dx6P">
                                            <field name="VAR" id=")kOGElBJiWDGZET7n=3d">ueberschrift</field>
                                            <value name="VALUE">
                                              <block type="text_join" id="1_Cf)}Q}oavQF3!I7}:8">
                                                <mutation items="3"></mutation>
                                                <value name="ADD0">
                                                  <block type="text" id="K*s_TZI:LGYY]P^sbb~=">
                                                    <field name="TEXT">Heute stehen </field>
                                                  </block>
                                                </value>
                                                <value name="ADD1">
                                                  <block type="get_value" id="7-Ox)buqV?@x^$+}2]SK">
                                                    <field name="ATTR">val</field>
                                                    <field name="OID">ical.1.data.count</field>
                                                  </block>
                                                </value>
                                                <value name="ADD2">
                                                  <block type="text" id="}xPr*8bfkxK9tqqIirg1">
                                                    <field name="TEXT"> Termine an. </field>
                                                  </block>
                                                </value>
                                              </block>
                                            </value>
                                          </block>
                                        </statement>
                                        <next>
                                          <block type="telegram" id="%R4ujjx,8M^2tV9xvj`^">
                                            <field name="INSTANCE">.0</field>
                                            <field name="LOG"></field>
                                            <field name="SILENT">FALSE</field>
                                            <field name="PARSEMODE">default</field>
                                            <value name="MESSAGE">
                                              <shadow type="text" id="|Y0fQkiSY@@x6f:|czT0">
                                                <field name="TEXT">text</field>
                                              </shadow>
                                              <block type="text_join" id="`?o9)Fu+[7E*tWvuyAmQ">
                                                <mutation items="3"></mutation>
                                                <value name="ADD0">
                                                  <block type="variables_get" id="ZH1i~F#=.qVZh/[423;T">
                                                    <field name="VAR" id=")kOGElBJiWDGZET7n=3d">ueberschrift</field>
                                                  </block>
                                                </value>
                                                <value name="ADD1">
                                                  <block type="text_newline" id="jeoPNCIgB.Y!/n1~$lf6">
                                                    <field name="Type">\n</field>
                                                  </block>
                                                </value>
                                                <value name="ADD2">
                                                  <block type="variables_get" id=":NHFv)_bDjl2xvAC5Te~">
                                                    <field name="VAR" id="b)m])isudJ]Z:`l}GrRL">anstehende_termine</field>
                                                  </block>
                                                </value>
                                              </block>
                                            </value>
                                          </block>
                                        </next>
                                      </block>
                                    </next>
                                  </block>
                                </next>
                              </block>
                            </next>
                          </block>
                        </statement>
                      </block>
                    </statement>
                  </block>
                </xml>
                
                SeiteBallon74 S 3 Replies Last reply Reply Quote 1
                • SeiteBallon74
                  SeiteBallon74 @David G. last edited by

                  @david-g

                  Leider wird Tag 4 nicht angezeigt. Die anderen Tage zuvor und danach schon:

                  Bild_2022-01-05_153707.png

                  Homoran 1 Reply Last reply Reply Quote 0
                  • S
                    sunny9999 @David G. last edited by

                    @david-g
                    Danke für das Tolle Script, rennt soweit....
                    Was muss ich da noch einfügen wenn ich auf einen Wert in den ICAL Werten "triggern" will....
                    Also zum Beispiel auf das Wort " Ereignis" ? Das er nur die Daten / Uhrzeiten postet in den Terminen auf die das "Trigger Wort" vorkommt ?

                    Danke für Eure Hilfe....
                    Grüße

                    Sunny

                    David G. 1 Reply Last reply Reply Quote 0
                    • David G.
                      David G. @sunny9999 last edited by

                      @sunny9999

                      Du könntest in der Schleife abfragen, ob das Event "Ergebnis" (muss dann genau so heißen) heißt und eine Funktion innerhalb des Blockly aufrufen.
                      Oder baust es direkt in die Schleife ein.

                      1 Reply Last reply Reply Quote 0
                      • Homoran
                        Homoran Global Moderator Administrators @SeiteBallon74 last edited by

                        @seiteballon74 sagte in [gelöst] Blockly - ical Termin (heute) - Biathlon:

                        Leider wird Tag 4 nicht angezeigt.

                        und was steht da im ics?

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

                        Support us

                        ioBroker
                        Community Adapters
                        Donate

                        494
                        Online

                        31.7k
                        Users

                        79.8k
                        Topics

                        1.3m
                        Posts

                        8
                        25
                        1810
                        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