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)Geräte in Aufzählung nur bei bestimmtem Zustand

    NEWS

    • Neues Video über Aliase, virtuelle Geräte und Kategorien

    • Wir empfehlen: Node.js 22.x

    • Neuer Blog: Fotos und Eindrücke aus Solingen

    (gelöst)Geräte in Aufzählung nur bei bestimmtem Zustand

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

      @djmarc75 da ist dummerweise ein fehler im javascript code - die function muss so aussehen

      Image 047.png

      sorry

      1 Reply Last reply Reply Quote 0
      • liv-in-sky
        liv-in-sky @DJMarc75 last edited by

        @djmarc75

        oh mann, bin heut echt zerstreut - das muss so sein

        return myID.replace("volume","currentState");
        

        currentState statt CurrentState

        ich glaub, ich sollte heute keine scripte mehr machen 😞

        DJMarc75 1 Reply Last reply Reply Quote 0
        • DJMarc75
          DJMarc75 @liv-in-sky last edited by

          @liv-in-sky said in Geräte in Aufzählung nur bei bestimmtem "Zustand" steuern:

          currentState statt CurrentState

          Das hatte ich schon geändert.
          Aber ich denke ich muss das ganze komplett umbauen denn jetzt funktioniert das ganze zwar aber es wird nur der Echo mit currentState true lautstärketechnisch verändert.

          @liv-in-sky said in Geräte in Aufzählung nur bei bestimmtem "Zustand" steuern:

          ich glaub, ich sollte heute keine scripte mehr machen

          Ja, so gehts mir grad auch 😊

          liv-in-sky 2 Replies Last reply Reply Quote 0
          • liv-in-sky
            liv-in-sky @DJMarc75 last edited by

            @djmarc75

            du musst doch nur deine erste if bedingung wieder einfügen und die nei mit und dazufügen

            wenn currentState ist falsch und wert von volume ist ungleich 30

            dann soll was gemacht werden

            oder verstehe ich was falsch

            1 Reply Last reply Reply Quote 0
            • liv-in-sky
              liv-in-sky @DJMarc75 last edited by liv-in-sky

              @djmarc75 also so

              Image 048.png

              oder:

              Image 049.png

              DJMarc75 1 Reply Last reply Reply Quote 0
              • DJMarc75
                DJMarc75 @liv-in-sky last edited by

                @liv-in-sky

                Screenshot 2022-05-02 151622.png

                Habe mal die Variable in einen Datenpunkt geschrieben:

                alexa2.0.Echo-Devices.G091Exxxx52709G6.Player.volume
                

                Hmmmm.... irgendwie scheint der Replace nicht so ganz zu klappen... und es steht nur ein Device drin.

                liv-in-sky 1 Reply Last reply Reply Quote 0
                • liv-in-sky
                  liv-in-sky @DJMarc75 last edited by

                  @djmarc75

                  du musst den debug anstatt steueredp nehmen - dann siehst du im log, welche dp er findet - bei steuere einen dp wird das immer wieder überschrieben (wegen der schleife) und am ende steht ein wert drin

                  wobei natürlich der output ein alexa2.0.Echo-Devicesyyyyyyyyyy.Player.currentState sein sollte

                  machmal ein debug pv auch noch rein und poste das log - ich vermute, du frägst nicht den dp mit volume am ende ab

                  Image 050.png

                  DJMarc75 1 Reply Last reply Reply Quote 0
                  • DJMarc75
                    DJMarc75 @liv-in-sky last edited by

                    @liv-in-sky

                    	2022-05-02 15:39:00.105	error	script.js.common.Amazon.Echos.Lautstärke_nach_Zeit: alexa2.0.Echo-Devices.G090L91182xxxxxN.Player.volume
                    javascript.0
                    	2022-05-02 15:39:00.104	error	script.js.common.Amazon.Echos.Lautstärke_nach_Zeit: alexa2.0.Echo-Devices.G090L91182xxxxxN.Player.volume
                    

                    Habe an 3 Echos das Volume verändert, inklusive an dem was currentState auf true steht.
                    Alle 3 waren im LOG aufgeführt.

                    liv-in-sky 1 Reply Last reply Reply Quote 0
                    • liv-in-sky
                      liv-in-sky @DJMarc75 last edited by

                      @djmarc75

                      bei mir sieht das log so aus: habe mehrere echos

                      Image 051.png

                      mit diesem script

                      Image 052.png

                      DJMarc75 1 Reply Last reply Reply Quote 0
                      • DJMarc75
                        DJMarc75 @liv-in-sky last edited by DJMarc75

                        @liv-in-sky
                        Sodele,
                        ich habe das ganze jetzt andersrum gemacht, was ja auch mehr Sinn ergibt.
                        Ich frage per Zeitplan alle "currentState" ab.
                        Gleichzeitig wird die Variable "volume" gesetzt und zwar mit dem Wert von "currentState", allerdings wird dort dann "currentState" durch "volume" ersetzt. Somit haben wir auch alle Datenpunkte von "volume" abgefragt.

                        Auf allen Devices, welche nichts aktiv abspielen ("currentState") und dort die Lautstärke NICHT meinem Wert entsprechen, wird dann dort das "volume" auf meinen Wert gesetzt.
                        Schwere Geburt aber der Erfolg gibt einem Recht.

                        Screenshot 2022-05-02 170145.png

                        Screenshot 2022-05-02 170202.png

                        Vielen Dank @liv-in-sky

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

                        Support us

                        ioBroker
                        Community Adapters
                        Donate

                        818
                        Online

                        32.0k
                        Users

                        80.5k
                        Topics

                        1.3m
                        Posts

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