Skip to content
  • Recent
  • Tags
  • 0 Unread 0
  • Categories
  • Unreplied
  • Popular
  • GitHub
  • Docu
  • Hilfe
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Logo
  1. ioBroker Community Home
  2. Deutsch
  3. Skripten / Logik
  4. On-Funktion: Brauche Hilfe

NEWS

  • Wartung am 15.11. – Forum ab 22:00 Uhr nicht erreichbar
    BluefoxB
    Bluefox
    11
    2
    211

  • UPDATE 31.10.: Amazon Alexa - ioBroker Skill läuft aus ?
    apollon77A
    apollon77
    48
    3
    7.9k

  • Monatsrückblick – September 2025
    BluefoxB
    Bluefox
    13
    1
    1.7k

On-Funktion: Brauche Hilfe

On-Funktion: Brauche Hilfe

Scheduled Pinned Locked Moved Skripten / Logik
6 Posts 3 Posters 1.2k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Strizz
    wrote on last edited by
    #1

    Hallo,

    es ist ein altes Thema. Ich habe jedoch auch nach langem Suchen hier keine Lösung für mich gefunden. Deshalb mal wieder eine Frage an die Experten:

    Ich habe den Adapter "Worx Landroid S 2017" von MeisterTR installiert. Dieser gibt mir in einem seiner Objekte den Status meines Rasenroboters ("Otto") an. Den Status kann ich mit dem Befehl

    activity = getState("landroid-s.0.mower.status").val;
    

    korrekt auslesen. Soweit so gut. Ich möchte nun bei bestimmten Statusmeldungen eine Pushover auf meine Handi bzw. (bei Diebstahl) einen Alarm auslösen. Dazu habe ich mir folgens Script gebastelt:

    //Programm wertet den Status des Objektes "landroid-s.0.mower.status" aus und sendet entsprechende Pushover-Mitteilung
    
    //var activity = getState("landroid-s.0.mower.status").val;
    
    var activity = ("landroid-s.0.mower.status");
    console.log(activity);
    
    function Meldung() {
       switch (activity) {
            case 0:  sendTo('pushover.1', 'Otto ist zu Hause und ruht');
            break;
            case 1: sendTo('pushover.1', 'Otto ist zu Hause');
            break;
            case 2:  sendTo('pushover.1', 'Otto startet');
            break;
            case 3:  sendTo('pushover.1', 'Otto verlässt die Ladestation');
            break;
            case 4:  sendTo('pushover.1', 'Otto fährt am Draht entlang');
            break;
            case 5:  sendTo('pushover.1', 'Otto sucht sein Zuhause');
            break;
            case 6:  sendTo('pushover.1', 'Otto sucht den Draht');
            break;
            case 7:  sendTo('pushover.1', {message: 'Otto mäht',sound: 'spacealarm', priority: 1});
            break;
            case 8:  sendTo('pushover.1', 'Achtung! Otto wurde hochgehoben');
            break;
            case 9:  sendTo('pushover.1', 'Otto hat ein dickes Problem');
            break;
            case 10: sendTo('pushover.1', 'Otto: Mähwerk blockiert');
            break;
            case 11: sendTo('pushover.1', 'Debug');
            break;
            case 12: sendTo('pushover.1', 'Fernbedienung');
            break;
            default: sendTo('pushover.1', 'Der Empfangsstatus ist unbekannt');
            break;
        }}
    
    on(activity, Meldung()); 
    

    Die Zuweisung

    var activity = ("landroid-s.0.mower.status");
    

    scheint nicht korrekt zu sein. Denn ich erhalte nur eine Pushover mit der Meldung: "Der Empfangsstauts ist unbekannt". Der Programm funktioniert mit der Zeile

    activity = getState("landroid-s.0.mower.status").val;
    

    Allerdings nur einmal beim Start.

    Kann mit jemand auf die Sprünge helfen und zeigen wie die Zuweisung für activity korrekt aussehen muss? Alle meine Versuche, etwa

    var activity = ("landroid-s.0.mower.status").val;
    

    sind bisher gescheitert.

    Gruß

    Strizz

    1 Reply Last reply
    0
    • S Offline
      S Offline
      SchuetzeSchulz
      wrote on last edited by
      #2

      Hallo,

      probier es mal so:

      //Programm wertet den Status des Objektes "landroid-s.0.mower.status" aus und sendet entsprechende Pushover-Mitteilung
      on({id: "landroid-s.0.mower.status"}, function(obj)						
      {
      	var activity = getState("landroid-s.0.mower.status").val;
      	switch(String(activity)) {
              case "0":  sendTo('pushover.1', 'Otto ist zu Hause und ruht');
              break;
              case "1": sendTo('pushover.1', 'Otto ist zu Hause');
              break;
              case "2":  sendTo('pushover.1', 'Otto startet');
              break;
              case "3":  sendTo('pushover.1', 'Otto verlässt die Ladestation');
              break;
              case "4":  sendTo('pushover.1', 'Otto fährt am Draht entlang');
              break;
              case "5":  sendTo('pushover.1', 'Otto sucht sein Zuhause');
              break;
              case "6":  sendTo('pushover.1', 'Otto sucht den Draht');
              break;
              case "7":  sendTo('pushover.1', {message: 'Otto mäht',sound: 'spacealarm', priority: 1});
              break;
              case "8":  sendTo('pushover.1', 'Achtung! Otto wurde hochgehoben');
              break;
              case "9":  sendTo('pushover.1', 'Otto hat ein dickes Problem');
              break;
              case "10": sendTo('pushover.1', 'Otto: Mähwerk blockiert');
              break;
              case "11": sendTo('pushover.1', 'Debug');
              break;
              case "12": sendTo('pushover.1', 'Fernbedienung');
              break;
              default: sendTo('pushover.1', 'Der Empfangsstatus ist unbekannt');
              break;
          }
      });
      
      
      1 Reply Last reply
      0
      • S Offline
        S Offline
        Strizz
        wrote on last edited by
        #3

        Danke für die schnelle Antwort. Habe eine Zeile geändert in

        on("landroid-s.0.mower.status", function(obj
        

        weil er mir sonst im Minutentakt die Pushover geschickt hat. Jetzt erhalte ich sie nur bei einer Änderung des Status.

        Noch mal besten Dank

        Strizz

        1 Reply Last reply
        0
        • S Offline
          S Offline
          SchuetzeSchulz
          wrote on last edited by
          #4

          Ach verdammt. Sorry, mein Fehler 🙂

          Aber super, wenn es jetzt funktioniert!

          1 Reply Last reply
          0
          • paul53P Offline
            paul53P Offline
            paul53
            wrote on last edited by
            #5

            ! ````
            //Programm wertet den Status des Objektes "landroid-s.0.mower.status" aus und sendet entsprechende Pushover-Mitteilung
            ! var idactivity = "landroid-s.0.mower.status";
            ! function Meldung(activity) {
            switch (activity) {
            case 0: sendTo('pushover.1', 'Otto ist zu Hause und ruht');
            break;
            case 1: sendTo('pushover.1', 'Otto ist zu Hause');
            break;
            case 2: sendTo('pushover.1', 'Otto startet');
            break;
            case 3: sendTo('pushover.1', 'Otto verlässt die Ladestation');
            break;
            case 4: sendTo('pushover.1', 'Otto fährt am Draht entlang');
            break;
            case 5: sendTo('pushover.1', 'Otto sucht sein Zuhause');
            break;
            case 6: sendTo('pushover.1', 'Otto sucht den Draht');
            break;
            case 7: sendTo('pushover.1', {message: 'Otto mäht',sound: 'spacealarm', priority: 1});
            break;
            case 8: sendTo('pushover.1', 'Achtung! Otto wurde hochgehoben');
            break;
            case 9: sendTo('pushover.1', 'Otto hat ein dickes Problem');
            break;
            case 10: sendTo('pushover.1', 'Otto: Mähwerk blockiert');
            break;
            case 11: sendTo('pushover.1', 'Debug');
            break;
            case 12: sendTo('pushover.1', 'Fernbedienung');
            break;
            default: sendTo('pushover.1', 'Der Empfangsstatus ist unbekannt');
            break;
            }
            }
            ! Meldung(getState(idactivity).val); // Script start

            on(idactivity, function(dp) { // Triggern bei Wertänderung
            Meldung(dp.state.val);
            });

            Bitte verzichtet auf Chat-Nachrichten, denn die Handhabung ist grauenhaft !
            Produktiv: RPi 2 mit S.USV, HM-MOD-RPI und SLC-USB-Stick mit root fs

            1 Reply Last reply
            0
            • S Offline
              S Offline
              Strizz
              wrote on last edited by
              #6

              @paul23: Danke für die Korrektur. Sehe jetzt etwas klarer.

              Gruß

              Strizz

              1 Reply Last reply
              0
              Reply
              • Reply as topic
              Log in to reply
              • Oldest to Newest
              • Newest to Oldest
              • Most Votes


              Support us

              ioBroker
              Community Adapters
              Donate

              82

              Online

              32.4k

              Users

              81.3k

              Topics

              1.3m

              Posts
              Community
              Impressum | Datenschutz-Bestimmungen | Nutzungsbedingungen
              ioBroker Community 2014-2025
              logo
              • Login

              • Don't have an account? Register

              • Login or register to search.
              • First post
                Last post
              0
              • Recent
              • Tags
              • Unread 0
              • Categories
              • Unreplied
              • Popular
              • GitHub
              • Docu
              • Hilfe