Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. [Gelöst] Timer analog CUXD

    NEWS

    • Neuer Blog: Fotos und Eindrücke aus Solingen

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

    • ioBroker goes Matter ... Matter Adapter in Stable

    [Gelöst] Timer analog CUXD

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

      Hallo,

      wir nutzen im Gästebad einen Cuxd-Timer im Zusammenhang mit einem HM-TFK.

      Ich habe nun im Keller TFK von Xiaomi verbaut und würde gerne in Blockly ein Script erstellen, dass ich nach 5 Minuten eine Pushover bekomme, sofern das Fenster nicht vorher geschlossen wurde. Wenn es vorher geschlossen wurde, erhalte ich logischerweise keine Nachricht.

      Geht das in Blockly oder kann mir jemand ein Javascript basteln?

      Ich habe davon absolut keine Ahnung und eine Recherche im Forum verlief auch erfolglos.

      Vielen Dank im Voraus.

      Gruß Stoni

      1 Reply Last reply Reply Quote 0
      • paul53
        paul53 last edited by

        @Stoni:

        kann mir jemand ein Javascript basteln? `

        const idTfk = '...';  // ID des TFK von Xiaomi eintragen
        
        var timer = null;
        
        on(idTfk, function(dp) {
           if(dp.state.val) {  // Fenster wird geöffnet
              timer = setTimeout(function() {
                 sendTo("pushover", {
                     message:  'Fenster ist seit 5 Minuten offen', 
                     title:    'Kellerfenster'
                 });
                 timer = null;
               }, 300000);  // 5 Minuten   
           } else if(timer) {
              clearTimeout(timer);  // Timer wird gestoppt
              timer = null;
           }
        });
        
        1 Reply Last reply Reply Quote 0
        • S
          Stoni last edited by

          Ui, das ging ja schnell!!! Sehr geil, vielen Dank!! Muss ich im Hinblick auf Pushover noch irgendwas ergänzen an dem Skript?

          1 Reply Last reply Reply Quote 0
          • paul53
            paul53 last edited by

            @Stoni:

            Muss ich im Hinblick auf Pushover noch irgendwas ergänzen an dem Skript? `
            Im Skript sollte es so ausreichen. Eine Instanz des Adapters iobroker.pushover muss aktiv sein.

            1 Reply Last reply Reply Quote 0
            • S
              Stoni last edited by

              Ja die PO Instanz nutze ich bereits. Prima, werde es morgen mal ausprobieren.

              Herzlichen Dank!!!

              1 Reply Last reply Reply Quote 0
              • S
                Stoni last edited by

                Hallo paul53,

                ich habe das Skript so übernommen und um die ID des TFK ergänzt.

                Das Fenster war länger als 5 Minuten auf, es kam aber keine Push-Nachricht.

                Woran kann das liegen?

                Der Status wird mit true/false ausgegeben. True = geöffnet.

                Gruß Stoni

                ~~![](</s><URL url=)<link_text text="https://uploads.tapatalk-cdn.com/201802 ... 625917.jpg">https://uploads.tapatalk-cdn.com/20180214/a9314edfa3175a5e618267bb2f625917.jpg</link_text>" />

                ![](</s><URL url=)<link_text text="https://uploads.tapatalk-cdn.com/201802 ... 4f32cf.jpg">https://uploads.tapatalk-cdn.com/20180214/0ab3cce5278baad5bb4ba8b7e14f32cf.jpg</link_text>" />~~

                1 Reply Last reply Reply Quote 0
                • paul53
                  paul53 last edited by

                  Du hast die ID des Kanals angegeben, nicht die ID des Datenpunktes. Versuche es mal so:

                  const idTfk = 'mihome.0.devices.magnet_158d0001e41c54.state';
                  
                  1 Reply Last reply Reply Quote 0
                  • S
                    Stoni last edited by

                    Yupp, das wars. Besten Dank!!!

                    1 Reply Last reply Reply Quote 0
                    • paul53
                      paul53 last edited by

                      Dann markiere bitte das Thema als gelöst (im ersten Beitrag).

                      1 Reply Last reply Reply Quote 0
                      • S
                        Stoni last edited by

                        Hallo paul53,

                        ich spiele gerade mit dem sayit Adapter und würde den Fensterzustand per Sprachausgabe mitteilen.

                        Der sayit Adapter ist installiert und funktioniert mit dem Home24 Mediaplayer. Das habe ich bereits in einem einfachen Blockly Script getestet.

                        Kannst Du Dir mal das angepasste Script ansehen? Sollte das so passen?

                        Gruss Stoni![](</s><URL url=)<link_text text="https://uploads.tapatalk-cdn.com/201802 ... d6a3e7.jpg">https://uploads.tapatalk-cdn.com/20180217/00ef22628f419d53143fe8f854d6a3e7.jpg</link_text>" />

                        1 Reply Last reply Reply Quote 0
                        • paul53
                          paul53 last edited by

                          @Doku:

                          SayIt adapter cannot be used alone. It must be controlled from javascript adapter or from "vis" with specific widget. After creation of adapter instance will can find following objects:

                          sayit.N.tts.text: Phrase to be spoken.

                          sayit.N.tts.volume: volume which will be used by playing of the phrase.

                          sayit.N.tts.playing: true if text is now playing and false if not. Supported only for "windows" and "system" play mode.

                          sayit.N.tts.cachetext: Phrase to be cached and then it can be used without internet. E.g. you can enter here manually "No internet" and if ping to google.com is negative, write "No internet" to "tts.text" and it will pronounced. Of course cache must be enabled.

                          State tts.text supports extended syntax, so the langugage/engine and volume can be defined together with text. It is used to enable multi-language text2speech engines. E.g. if adapter has engine "Google-english", it is possible with phrase de:Sag es to force to use Google-Deustch speech engine.

                          With ru;75;Погода хорошая we can force to use russian language and volume 75%.

                          You can specify the volume of announcement in percent from current or given volume (not from maximal). E.g. if command is de;75;Gutes Wetterand "announce volume" is 50%, the announce will be played with volume 38% from 100% possible. `
                          Laut https://github.com/ioBroker/ioBroker.sayit/blob/master/README.md nicht mit sendTo(), sondern mit setState() (Zeilen 8 bis 10 durch folgende ersetzen).

                                   setState('sayit.0.tts.text', 'de;Das Fenster von Maximilian ist seit zehn Minuten offen');
                          
                          
                          1 Reply Last reply Reply Quote 0
                          • S
                            Stoni last edited by

                            @paul53:

                            @Doku:

                            SayIt adapter cannot be used alone. It must be controlled from javascript adapter or from "vis" with specific widget. After creation of adapter instance will can find following objects:

                            sayit.N.tts.text: Phrase to be spoken.

                            sayit.N.tts.volume: volume which will be used by playing of the phrase.

                            sayit.N.tts.playing: true if text is now playing and false if not. Supported only for "windows" and "system" play mode.

                            sayit.N.tts.cachetext: Phrase to be cached and then it can be used without internet. E.g. you can enter here manually "No internet" and if ping to google.com is negative, write "No internet" to "tts.text" and it will pronounced. Of course cache must be enabled.

                            State tts.text supports extended syntax, so the langugage/engine and volume can be defined together with text. It is used to enable multi-language text2speech engines. E.g. if adapter has engine "Google-english", it is possible with phrase de:Sag es to force to use Google-Deustch speech engine.

                            With ru;75;Погода хорошая we can force to use russian language and volume 75%.

                            You can specify the volume of announcement in percent from current or given volume (not from maximal). E.g. if command is de;75;Gutes Wetterand "announce volume" is 50%, the announce will be played with volume 38% from 100% possible. `
                            Laut https://github.com/ioBroker/ioBroker.sayit/blob/master/README.md nicht mit sendTo(), sondern mit setState() (Zeilen 8 bis 10 durch folgende ersetzen).

                                     setState('sayit.0.tts.text', 'de;Das Fenster von Maximilian ist seit zehn Minuten offen');
                            
                            ```` `  Hallo, danke für Deine Rückmeldung.
                            

                            Leider kommen da Warnhinweise im Script. Wo ist der Fehler?

                            ![](</s><URL url=)<link_text text="https://uploads.tapatalk-cdn.com/201802 ... 0f2a5b.jpg">https://uploads.tapatalk-cdn.com/20180218/116d8d74372d17f1f0f7e8c6830f2a5b.jpg</link_text>" />

                            1 Reply Last reply Reply Quote 0
                            • paul53
                              paul53 last edited by

                              Zelie 9 ist zuviel: Löschen !

                                });
                              
                              1 Reply Last reply Reply Quote 0
                              • S
                                Stoni last edited by

                                Auch hier noch mal: viiiiiiieleeeeen Dank!!

                                1 Reply Last reply Reply Quote 0
                                • S
                                  Stoni last edited by

                                  Hallo Paul53,

                                  kann man das Script noch um die Auswahl der Stimme ergänzen? Ich hätte gerne die Hans Stimme, aber es kommt nur eine weibliche Stimme, obwohl im Sayit Adapter die Hans Stimme ausgewählt wurde.

                                  Gruß Stoni

                                  Gesendet von iPad mit Tapatalk

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

                                  Support us

                                  ioBroker
                                  Community Adapters
                                  Donate

                                  826
                                  Online

                                  31.7k
                                  Users

                                  79.8k
                                  Topics

                                  1.3m
                                  Posts

                                  2
                                  15
                                  1401
                                  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