Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. JavaScript
    5. [gelöst] Trigger Statusänderungen

    NEWS

    • Monatsrückblick - April 2025

    • Minor js-controller 7.0.7 Update in latest repo

    • Save The Date: ioBroker@Smart Living Forum Solingen, 14.06.

    [gelöst] Trigger Statusänderungen

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

      @AlCalzone

      Ich möchte folgendes Erreichen:

      Wenn reachable = false, dann schicke Telgrammeldung, dass der Sensor nicht erreichbar ist. Genauso würde ich dann meine Fenster offen/geschlossen Erkennung gerne darauf umbauen. Also wenn Fenster offen, dann Telgrammeldung.

      AlCalzone 1 Reply Last reply Reply Quote 0
      • A
        Andre R. last edited by

        @eumats mach dir doch ein Blockly Script wenn false dann Telegram Nachricht

        AlCalzone 1 Reply Last reply Reply Quote 0
        • AlCalzone
          AlCalzone Developer @eumats last edited by AlCalzone

          @eumats Dann brauchst du je einen Trigger für reachable und offen/zu. Die kannst du in etwa so bauen:

          const sensorIDs = [
              "sensor.0.id1",
              "sensor.0.id2",
              // ...
          ];
          
          for (const sensor of sensorIDs) {
              on({id: sensor + ".reachable", change: "ne"}, (obj) => {
                  //... Wertänderung verarbeiten
              });
              // analog für Sensorwert
          }
          
          eumats 1 Reply Last reply Reply Quote 1
          • AlCalzone
            AlCalzone Developer @Andre R. last edited by

            @Andre-R sagte in Trigger Statusänderungen:

            @eumats mach dir doch ein Blockly Script wenn false dann Telegram Nachricht

            Du hast die Frage nicht gelesen, oder? 😉 Für 20 Sensoren wird das recht umständlich in Blockly

            eumats 1 Reply Last reply Reply Quote 0
            • eumats
              eumats @AlCalzone last edited by eumats

              @AlCalzone sagte in Trigger Statusänderungen:

              @Andre-R sagte in Trigger Statusänderungen:

              @eumats mach dir doch ein Blockly Script wenn false dann Telegram Nachricht

              Du hast die Frage nicht gelesen, oder? 😉 Für 20 Sensoren wird das recht umständlich in Blockly

              Korrekt... Außerdem mag ich Blocky nicht so.... 😉

              1 Reply Last reply Reply Quote 1
              • A
                Andre R. last edited by

                @AlCalzone doch hab ich schon gelesen. ich habs halt so gemacht. weil ich Anfänger bin und von Javascript keine Ahnung habe. 😉

                AlCalzone 1 Reply Last reply Reply Quote 0
                • AlCalzone
                  AlCalzone Developer @Andre R. last edited by

                  @Andre-R Das sei dir gegönnt, aber eumats hat explizit danach gefragt, wie er es in JS mit weniger Copy&Paste hinbekommt.

                  1 Reply Last reply Reply Quote 0
                  • eumats
                    eumats @AlCalzone last edited by

                    @AlCalzone
                    Vielen Danke für die schnelle Reaktion. Ich werde es mal versuchen für mich zu adaptieren...

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

                      @AlCalzone
                      Kann ich den Namen eines Datenpunktes abfragen? Also z.B. Fenster Flur...

                      764d82b6-f258-4360-afde-0f415741df07-image.png

                      AlCalzone 1 Reply Last reply Reply Quote 0
                      • AlCalzone
                        AlCalzone Developer @eumats last edited by

                        @eumats Der name steht in getObject(id).common.name. Wenn du das häufiger brauchst, macht es Sinn, die Namen einmal zu Skriptstart zu lesen und in einer Variable zu merken.

                        eumats 1 Reply Last reply Reply Quote 1
                        • eumats
                          eumats @AlCalzone last edited by

                          @AlCalzone
                          Danke!

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

                          Support us

                          ioBroker
                          Community Adapters
                          Donate

                          544
                          Online

                          31.6k
                          Users

                          79.4k
                          Topics

                          1.3m
                          Posts

                          javascript
                          3
                          13
                          739
                          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