Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. JavaScript
    5. Meine Probleme beim Scripting

    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

    Meine Probleme beim Scripting

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

      @Bluefox:

      Kannst du ioBroker neu starten? `

      Ich habe ioBroker über das Terminal neu gestartet.

      root@iobroker:/opt/iobroker# ./iobroker restart

      Stopping ioBroker controller daemon…

      ioBroker controller daemon stopped.

      Starting ioBroker controller daemon...

      ioBroker controller daemon started. PID: 3396

      root@iobroker:/opt/iobroker#

      Danach habe ich das Script noch einmal getestet (den Workaround).

      Die Ansage wird wieder zweimal gesprochen. Nun finde ich mich aber im Log wieder 😉

      hm-rpc.0 2015-03-06 19:21:42 info setValue ["FEQ0060867:1","STATE",false] BOOL

      sayit.0 2015-03-06 19:21:39 info saying: de;40;Wohnungstür geöffnet

      sayit.0 2015-03-06 19:21:39 info saying: de;40;Wohnungstür geöffnet

      hm-rpc.0 2015-03-06 19:21:39 info setValue ["FEQ0060867:1","STATE",true] BOOL

      Bluefox, ich finde es wirklich stark, wie sehr Du dich reinkniest.

      Ich kann aber mit den Fehler leben, wenn es erst einmal wichtigeres gibt.

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

        Aktueller SayIt Adapter (0.2.0 von heute):

        Test mit dem Workaround-Script oben.

        Log:

        host.iobroker 2015-03-07 11:09:44 info Restart adapter system.adapter.sayit.0 because enabled

        host.iobroker 2015-03-07 11:09:44 error instance system.adapter.sayit.0 terminated with code 6 (uncaught exception)

        Error: 2015-03-07 11:09:43 error at Timer.listOnTimeout [as ontimeout] (timers.js:112:15)

        Error: 2015-03-07 11:09:43 error at null._onTimeout (/opt/iobroker/node_modules/iobroker.js-controller/lib/adapter.js:1380:34)

        Error: 2015-03-07 11:09:43 error at Adapter.emit (events.js:98:17)

        Error: 2015-03-07 11:09:43 error at Adapter.sayIndex (/opt/iobroker/node_modules/iobroker.sayit/main.js:19:13)

        Error: 2015-03-07 11:09:43 error at sayIt (/opt/iobroker/node_modules/iobroker.sayit/main.js:628:9)

        Error: 2015-03-07 11:09:43 error at sayItGetSpeech (/opt/iobroker/node_modules/iobroker.sayit/main.js:301:17)

        Error: 2015-03-07 11:09:43 error at sayItGetSpeechGoogle (/opt/iobroker/node_modules/iobroker.sayit/main.js:174:9)

        Error: 2015-03-07 11:09:43 error at getLength (/opt/iobroker/node_modules/iobroker.sayit/main.js:101:24)

        Error: 2015-03-07 11:09:43 error at Object.fs.statSync (fs.js:696:18)

        Error: 2015-03-07 11:09:43 error ENOENT, no such file or directory '/opt/iobroker/node_modules/iobroker.sayit/say.mp3'

        uncaught 2015-03-07 11:09:43 error exception: ENOENT, no such file or directory '/opt/iobroker/node_modules/iobroker.sayit/say.mp3'

        sayit.0 2015-03-07 11:09:43 info saying: de;40;Wohnungstür geöffnet

        hm-rpc.0 2015-03-07 11:09:43 info setValue ["FEQ0060867:1","STATE",true] BOOL

        sayit.0 2015-03-07 11:09:23 info starting. Version 0.2.0 in /opt/iobroker/node_modules/iobroker.sayit

        host.iobroker 2015-03-07 11:09:23 info instance system.adapter.sayit.0 started with pid 25896

        Das Verzeichnis:

        root@iobroker:/opt/iobroker/node_modules/iobroker.sayit# ls

        admin io-package.json LICENSE nircmd package.json say

        cmdmp3 lib main.js node_modules README.md

        Die Datei say.mp3 gibt es nicht.

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

          @ruhr70:

          Aktueller SayIt Adapter (0.2.0 von heute):

          Test mit dem Workaround-Script oben.

          Log:

          host.iobroker 2015-03-07 11:09:44 info Restart adapter system.adapter.sayit.0 because enabled

          host.iobroker 2015-03-07 11:09:44 error instance system.adapter.sayit.0 terminated with code 6 (uncaught exception)

          Error: 2015-03-07 11:09:43 error at Timer.listOnTimeout [as ontimeout] (timers.js:112:15)

          Error: 2015-03-07 11:09:43 error at null._onTimeout (/opt/iobroker/node_modules/iobroker.js-controller/lib/adapter.js:1380:34)

          Error: 2015-03-07 11:09:43 error at Adapter.emit (events.js:98:17)

          Error: 2015-03-07 11:09:43 error at Adapter.sayIndex (/opt/iobroker/node_modules/iobroker.sayit/main.js:19:13)

          Error: 2015-03-07 11:09:43 error at sayIt (/opt/iobroker/node_modules/iobroker.sayit/main.js:628:9)

          Error: 2015-03-07 11:09:43 error at sayItGetSpeech (/opt/iobroker/node_modules/iobroker.sayit/main.js:301:17)

          Error: 2015-03-07 11:09:43 error at sayItGetSpeechGoogle (/opt/iobroker/node_modules/iobroker.sayit/main.js:174:9)

          Error: 2015-03-07 11:09:43 error at getLength (/opt/iobroker/node_modules/iobroker.sayit/main.js:101:24)

          Error: 2015-03-07 11:09:43 error at Object.fs.statSync (fs.js:696:18)

          Error: 2015-03-07 11:09:43 error ENOENT, no such file or directory '/opt/iobroker/node_modules/iobroker.sayit/say.mp3'

          uncaught 2015-03-07 11:09:43 error exception: ENOENT, no such file or directory '/opt/iobroker/node_modules/iobroker.sayit/say.mp3'

          sayit.0 2015-03-07 11:09:43 info saying: de;40;Wohnungstür geöffnet

          hm-rpc.0 2015-03-07 11:09:43 info setValue ["FEQ0060867:1","STATE",true] BOOL

          sayit.0 2015-03-07 11:09:23 info starting. Version 0.2.0 in /opt/iobroker/node_modules/iobroker.sayit

          host.iobroker 2015-03-07 11:09:23 info instance system.adapter.sayit.0 started with pid 25896

          Das Verzeichnis:

          root@iobroker:/opt/iobroker/node_modules/iobroker.sayit# ls

          admin io-package.json LICENSE nircmd package.json say

          cmdmp3 lib main.js node_modules README.md

          Die Datei say.mp3 gibt es nicht. `
          Welche Einstellungen werden benutzt?

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

            Es gibt neuere Version von sayIt, die das Problem eventuell beseitigen kann.

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

              Guten Morgen Bluefox,

              @Bluefox:

              Welche Einstellungen werden benutzt? `

              327_sayiteinstellungen.jpg

              @Bluefox:

              Es gibt neuere Version von sayIt, die das Problem eventuell beseitigen kann. `

              Ich habe die neue Version direkt ausprobiert (mit Workaround Script und neuer Version SayIt 0.2.1):

              sayit.0 2015-03-08 10:54:03 info sayit.0 starting. Version 0.2.1 in /opt/iobroker/node_modules/iobroker.sayit

              iobroker 2015-03-08 10:54:03 info host.iobroker instance system.adapter.sayit.0 started with pid 18796

              host.iobroker 2015-03-08 10:53:33 info Restart adapter system.adapter.sayit.0 because enabled

              host.iobroker 2015-03-08 10:53:33 error instance system.adapter.sayit.0 terminated with code 6 (uncaught exception)

              ReferenceError: 2015-03-08 10:53:33 error at Timer.listOnTimeout [as ontimeout] (timers.js:112:15)

              ReferenceError: 2015-03-08 10:53:33 error at null._onTimeout (/opt/iobroker/node_modules/iobroker.js-controller/lib/adapter.js:1380:34)

              ReferenceError: 2015-03-08 10:53:33 error at Adapter.emit (events.js:98:17)

              ReferenceError: 2015-03-08 10:53:33 error at Adapter.sayIndex (/opt/iobroker/node_modules/iobroker.sayit/main.js:19:13)

              ReferenceError: 2015-03-08 10:53:33 error at sayIt (/opt/iobroker/node_modules/iobroker.sayit/main.js:628:9)

              ReferenceError: 2015-03-08 10:53:33 error at sayItGetSpeech (/opt/iobroker/node_modules/iobroker.sayit/main.js:309:17)

              ReferenceError: 2015-03-08 10:53:33 error at sayItGetSpeechGoogle (/opt/iobroker/node_modules/iobroker.sayit/main.js:182:9)

              ReferenceError: 2015-03-08 10:53:33 error at getLength (/opt/iobroker/node_modules/iobroker.sayit/main.js<emoji seq="1f4af">💯</emoji>9)

              ReferenceError: 2015-03-08 10:53:33 error fs is not defined

              uncaught 2015-03-08 10:53:33 error exception: fs is not defined

              sayit.0 2015-03-08 10:53:33 info saying: de;40;Wohnungstür geöffnet

              hm-rpc.0 2015-03-08 10:53:33 info setValue ["FEQ0060867:1","STATE",true] BOOL

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

                Und jetzt? :oops:

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

                  @Bluefox:

                  Und jetzt? :oops: `

                  Und jetzt habe ich wieder viel gelernt.

                  Also…

                  Nach dem Update auf 0.2.2 (SayIt Adapter) sind die Fehler im Log weg.

                  Log nach dem Update:

                  ! hm-rpc.0 2015-03-08 19:31:37 info hm-rpc.0 setValue ["FEQ0060867:1","STATE",false] BOOL
                  ! sayit.0 2015-03-08 19:31:34 info sayit.0 saying: de;40;Wohnungstür geöffnet
                  ! hm-rpc.0 2015-03-08 19:31:34 info hm-rpc.0 setValue ["FEQ0060867:1","STATE",true] BOOL
                  ! hm-rpc.0 2015-03-08 19:31:30 info hm-rpc.0 setValue ["FEQ0060867:1","STATE",false] BOOL
                  ! sayit.0 2015-03-08 19:31:22 info sayit.0 Copied file '/opt/iobroker/node_modules/iobroker.sayit/../../cache/24928d5f96bf7776abed90505a4aefaa.mp3' to '/opt/iobroker/node_modules/iobroker.sayit/say.mp3'
                  ! sayit.0 2015-03-08 19:31:22 info sayit.0 saying: de;40;Wohnungstür geöffnet
                  ! hm-rpc.0 2015-03-08 19:31:22 info hm-rpc.0 setValue ["FEQ0060867:1","STATE",true] BOOL
                  ! sayit-0 2015-03-08 19:31:04 info starting. Version 0.2.2 in /opt/iobroker/node_modules/iobroker.sayit
                  ! 2015-03-08 19:31:04 info info
                  ! host-iobroker 2015-03-08 19:31:04 info instance system.adapter.sayit.0 started with pid 17667
                  ! host-iobroker 2015-03-08 19:31:02 info instance system.adapter.sayit.0 terminated with code 0 (OK)
                  ! sayit-0 2015-03-08 19:31:02 info terminating
                  ! iobroker 2015-03-08 19:31:02 info exit 0
                  ! iobroker 2015-03-08 19:31:02 info Adapter "sayit" updated
                  ! iobroker 2015-03-08 19:31:02 info upload sayit.admin /opt/iobroker/node_modules/iobroker.sayit/admin/index.html index.html text/html
                  ! iobroker 2015-03-08 19:31:02 info upload sayit.admin /opt/iobroker/node_modules/iobroker.sayit/admin/sayit.png sayit.png image/png
                  ! host-iobroker 2015-03-08 19:31:02 info stopInstance system.adapter.sayit.0 killing pid 17136
                  ! host-iobroker 2015-03-08 19:31:02 info stopInstance system.adapter.sayit.0
                  ! host-iobroker 2015-03-08 19:31:02 info object change system.adapter.sayit.0
                  ! iobroker 2015-03-08 19:31:02 info got /opt/iobroker/node_modules/iobroker.sayit/admin
                  ! iobroker 2015-03-08 19:31:02 info npm install –production --prefix "/opt/iobroker/node_modules/iobroker.sayit"
                  ! iobroker 2015-03-08 19:31:02 info iobroker.sayit@0.2.2 opt/iobroker/node_modules/iobroker.sayit└── jsftp@1.5.0 (once@1.3.0, parse-listing@1.1.2, debug@2.1.1, event-stream@3.1.7, ftp-response-parser@1.0.0)
                  ! iobroker 2015-03-08 19:30:57 info npm install iobroker.sayit --production --prefix "/opt/iobroker"
                  ! iobroker 2015-03-08 19:30:55 info upgrade sayit

                  Workaround-Script:

                  ! ````
                  var idSayIt = "sayit.0.tts.text"; // Hier die entsprechende SayIt Text ID
                  var idButton = "hm-rpc.0.FEQ0060867.1.STATE"; // Test ID
                  var lastSay = null;
                  // Bei Tastendruck wird folgender Text gesprochen
                  subscribe({id: idButton, val: true}, function (obj) {
                  if (!lastSay || ((new Date()).getTime() - lastSay) > 3000) {
                  lastSay = (new Date()).getTime();
                  setState (idSayIt, "de;40;Wohnungstür geöffnet");
                  }

                  });

                  
                  Danach habe ich mit dem Workaround-Script die Ansage trotzdem zweimal gehört (zeitlich versetzt, überlagert).
                  
                  Im Log tauchte die Ansage nur einmal auf, daher habe ich überlegt, ob es vom lokalen Rechner kommen kann.
                  
                  VIS war im Chrome gestartet. Safari war parallel auf. Safari kontrolliert, kein Tab mit ioBroker/Vis offen.
                  
                  Im Chrome war die VIS Umgebung ****und**** der VIS Editor offen.
                  
                  Versuchsweise habe ich den Tab mit dem Editor geschlossen und siehe da, die Ansage kam nur noch einmal.
                  
                  ****Sorry, mir war nicht klar, dass im VIS Editor auch SayIt aktiv ist und die Ansage ebenfalls abgespielt wird**** :shock:
                  
                  VIS-Edit geschlossen und die Ansage wurde mit dem Workaround-Script nur einmal abgespielt.
                  
                  ****Nun habe ich das "normale" Script noch einmal getestet****
                  
                  

                  var idSayIt = "sayit.0.tts.text"; // Hier die entsprechende SayIt Text ID
                  var idButton = "hm-rpc.0.FEQ0060867.1.STATE"; // Test rote Lampe

                  // Bei Tastendruck wird folgender Text gesprochen
                  subscribe({id: idButton, val: true}, function (obj) {
                  setState (idSayIt, "de;40;Wohnungstür geöffnet");
                  });

                  
                  Hier wird die Ansage wieder ****zweimal**** abgespielt (der VIS Editor ist geschlossen :D ).
                  
                  Das sieht man auch im Log:
                  
                  hm-rpc.0 2015-03-08 19:42:46 info hm-rpc.0 setValue ["FEQ0060867:1","STATE",false] BOOL
                  
                  sayit.0 2015-03-08 19:42:05 info sayit.0 saying: de;40;Wohnungstür geöffnet
                  
                  sayit.0 2015-03-08 19:42:03 info sayit.0 saying: de;40;Wohnungstür geöffnet
                  
                  hm-rpc.0 2015-03-08 19:42:03 info hm-rpc.0 setValue ["FEQ0060867:1","STATE",true] BOOL
                  
                  Kurz:
                  
                  Mit dem offenen VIS Editor habe ich mir selbst ein Bein gestellt.
                  
                  SayIT startet jetzt wieder ohne Fehler im Log.
                  
                  Mit dem Workaround-Script kann ich es benutzten und komme zurecht (der generelle Fehler scheint noch vorhanden zu sein). Danke noch einmal!
                  
                  Wenn sonst jemand mal das Problem hat (meine Einschätzung):
                   *   werden doppelte Ansagen nacheinander abgespielt und der Aufruf tauch zweimal im Log auf: dann ist es doppelt
                  
                  *   Überlagert sich eine Ansage, dann kommt es vom eigenen Rechner (zweiter Tab, offener Editor, offener Tab im anderen Browser, ..)
                  1 Reply Last reply Reply Quote 0
                  • derAuge
                    derAuge last edited by

                    Habe mal das Script nachgebaut

                    var idSayIt     = "sayit.0.tts.text";               // Hier die entsprechende SayIt Text ID
                    var idButton    = "hm-rpc.0.LEQ0471993.1.STATE";  //Taster(6x):6.
                    
                    // Bei Tastendruck wird folgender Text gesprochen
                    subscribe({id: idButton, val: true}, function (obj) {
                                setState (idSayIt, "de;40;Licht im Flur eingeschaltet");
                            });
                    
                    

                    Wenn der Taster betätigt wird

                    • sonos.0 2015-03-16 19:17:58 warn sonos.0 Play text2speech during another still playing
                    sonos.0 2015-03-16 19:17:58 info sonos.0 try to control id sonos.0.root.192_168_28_232.tts with {"val":"40;[http://192.168.28.77:8082/state/sayit.0 … 1426528833](http://192.168.28.77:8082/state/sayit.0.tts.mp3%22,%22ack%22:false,%22ts%22:1426529878,%22from%22:%22system.adapter.sayit.0%22,%22lc%22:1426528833)}
                    
                    sayit.0 2015-03-16 19:17:58 info sayit.0 saying: de;40;Licht im Flur eingeschaltet
                    
                    sonos.0 2015-03-16 19:17:55 warn sonos.0 Play text2speech during another still playing
                    
                    sonos.0 2015-03-16 19:17:55 info sonos.0 try to control id sonos.0.root.192_168_28_232.tts with {"val":"40;[http://192.168.28.77:8082/state/sayit.0 ... 1426528833](http://192.168.28.77:8082/state/sayit.0.tts.mp3%22,%22ack%22:false,%22ts%22:1426529875,%22from%22:%22system.adapter.sayit.0%22,%22lc%22:1426528833)}
                    
                    sayit.0 2015-03-16 19:17:55 info sayit.0 saying: de;40;Licht im Flur eingeschaltet
                    
                    sayit.0 2015-03-16 19:17:54 warn sayit.0 Same text in less than a second.. Strange. Ignore it.
                    
                    sonos.0 2015-03-16 19:17:52 info sonos.0 try to control id sonos.0.root.192_168_28_232.tts with {"val":"40;[http://192.168.28.77:8082/state/sayit.0 ... 1426528833](http://192.168.28.77:8082/state/sayit.0.tts.mp3%22,%22ack%22:false,%22ts%22:1426529872,%22from%22:%22system.adapter.sayit.0%22,%22lc%22:1426528833)}
                    
                    sayit.0 2015-03-16 19:17:52 info sayit.0 saying: de;40;Licht im Flur eingeschaltet 
                    

                    Dann wird jedoch die letzte Playliste gestartet und nicht der Text angesagt. Die Datei (say.mp3) wird richtig erzeugt

                    Die Play:1 muss ich dann 3x ausschalten. Sie wird immer wieder automatisch eingeschaltet.

                    Was mache ich falsch?

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

                      @derAuge:

                      Was mache ich falsch? `

                      Ich behaupte mal… gar nichts 😉

                      Das über Sonos nichts ausgegeben wird, sondern die letzte Playlist gestartet wird, war Thema des andern Thread.

                      Stell mal auf die Ausgabe auf "Browser" und verwende Chrome, dann solltest Du Deinen Text hören.

                      Was dabei bei mir passiert:

                      Der Text wird zweimal hintereinander ausgegeben (dafür gibt es derzeit das Workaround-Script) plus einmal überlagert wenn der VIS Editor auch auf ist.

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

                        Super !

                        Ausgabe von SayIt auf Browser gestellt

                        und es geht

                        var idSayIt     = "sayit.0.tts.text";               // Hier die entsprechende SayIt Text ID
                        var idButton    = "hm-rpc.0.LEQ0492793.1.MOTION";  // Bewegung Terasse.MOTION
                        var lastSay     = null;
                        
                        // Bei Bewegung wird folgender Text gesprochen
                        subscribe({id: idButton, val: true}, function (obj) {
                                 if (!lastSay || ((new Date()).getTime() - lastSay) > 3000) {
                                          lastSay = (new Date()).getTime();
                                          setState (idSayIt, "de;40;Bewegung auf der Terasse festgestellt");
                                 }
                        
                                });
                        
                        
                        var idSayIt     = "sayit.0.tts.text";               // Hier die entsprechende SayIt Text ID
                        var idButton    = "hm-rpc.0.KEQ1092089.1.MOTION"; //*Bewegung innen.MOTION*/
                        var lastSay     = null;
                        
                        // Bei Bewegung wird folgender Text gesprochen
                        subscribe({id: idButton, val: true}, function (obj) {
                                 if (!lastSay || ((new Date()).getTime() - lastSay) > 3000) {
                                          lastSay = (new Date()).getTime();
                                          setState (idSayIt, "de;40;Bewegung im Flur festgestellt");
                                 }
                        
                                });
                        
                        

                        LOG:

                        sayit.0	2015-03-16 20:18:42	info	sayit.0 Copied file '/mnt/ioBroker/iobroker.Pi2/node_modules/iobroker.sayit/say.mp3' to '/mnt/ioBroker/iobroker.Pi2/node_modules/iobroker.sayit/../../cache/4278c2eec25384afdd977b2bc3e03831.mp3'
                        sayit.0	2015-03-16 20:18:42	info	sayit.0 saying: de;40;Bewegung auf der Terasse festgestellt
                        sayit.0	2015-03-16 20:18:25	info	sayit.0 saying: de;40;Bewegung im Flur festgestellt
                        
                        1 Reply Last reply Reply Quote 0
                        • First post
                          Last post

                        Support us

                        ioBroker
                        Community Adapters
                        Donate

                        911
                        Online

                        31.8k
                        Users

                        80.0k
                        Topics

                        1.3m
                        Posts

                        6
                        21
                        5432
                        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