Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. State Unifi Protect

    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

    State Unifi Protect

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

      Hallo zusammem,
      ich habe mal wieder ein Problem beim Scripten.
      Ich hätte gern ein Script welches den mode bei der Unifi Kamera auf motion oder never stellt.
      Im Objekt Explorer kann ich ja unter

      unifi-protect.0.cameras.6123d895035bed03e701xxxx.recordingSettings.mode
      

      always, never und motion auswählen. Nur wie bau ich mir da ein setstate draus zusammen?

      Kann mir da wer helfen?

      Gruß 5tift

      paul53 2 Replies Last reply Reply Quote 0
      • paul53
        paul53 @5tift last edited by

        @5tift Wie sehen die Objektdaten (bitte in Code tags posten) von "unifi-protect.0.cameras.6123d895035bed03e701xxxx.recordingSettings.mode" aus?

        5 1 Reply Last reply Reply Quote 0
        • 5
          5tift @paul53 last edited by

          @paul53
          Meinst Du das?

          {
            "type": "state",
            "common": {
              "name": "mode",
              "type": "string",
              "read": true,
              "write": true,
              "states": {
                "always": "always",
                "never": "never",
                "motion": "motion"
              }
            },
          
          1 Reply Last reply Reply Quote 0
          • paul53
            paul53 @5tift last edited by paul53

            @5tift sagte: mode bei der Unifi Kamera auf motion oder never stellt.

            Man muss an setState(id, val) den String-Wert "motion" bzw. "never" übergeben.

            5 1 Reply Last reply Reply Quote 0
            • 5
              5tift @paul53 last edited by 5tift

              @paul53
              Das dachte ich ja auch, aber folgendes geht nicht:

              setState('unifi-protect.0.cameras.6123d895035bed03e701xxxx.recordingSettings.mode ', motion);
              

              ReferenceError: motion is not defined

              paul53 1 Reply Last reply Reply Quote 0
              • paul53
                paul53 @5tift last edited by paul53

                @5tift sagte: aber folgendes geht nicht:

                Natürlich nicht, denn motion ist kein String, sondern eine nicht deklarierte Variable. Richtig:

                setState('unifi-protect.0.cameras.6123d895035bed03e701xxxx.recordingSettings.mode', 'motion');
                

                Innerhalb der Hochkommata dürfen auch keine zusätzlichen Leerzeichen stehen.

                5 1 Reply Last reply Reply Quote 0
                • 5
                  5tift @paul53 last edited by

                  @paul53
                  Vielen Dank,
                  ob ich mir sowas je merken kann....

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

                  Support us

                  ioBroker
                  Community Adapters
                  Donate

                  869
                  Online

                  31.9k
                  Users

                  80.1k
                  Topics

                  1.3m
                  Posts

                  2
                  7
                  269
                  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