Skip to content
  • Home
  • 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
ioBroker Logo

Community Forum

donate donate
  1. ioBroker Community Home
  2. Deutsch
  3. Skripten / Logik
  4. JavaScript
  5. Reaktion auf Fehlgeschlagenes SetState

NEWS

  • Monatsrückblick Januar/Februar 2026 ist online!
    BluefoxB
    Bluefox
    18
    1
    766

  • Jahresrückblick 2025 – unser neuer Blogbeitrag ist online! ✨
    BluefoxB
    Bluefox
    18
    1
    6.1k

  • Neuer Blogbeitrag: Monatsrückblick - Dezember 2025 🎄
    BluefoxB
    Bluefox
    13
    1
    1.5k

Reaktion auf Fehlgeschlagenes SetState

Scheduled Pinned Locked Moved JavaScript
2 Posts 2 Posters 190 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.
  • J Offline
    J Offline
    JinnBln
    wrote on last edited by JinnBln
    #1

    Hallo liebe Community,

    ist es mir möglich auf ein SetState aus einem Script auf ein physikalisches Device direkt zu reagieren?
    Um den konkreten Fall zu beschreiben, ich habe eine Steckdose, die ab und zu nicht reagiert.
    Die Log sagt dann Fehler 233 "Mac no Ack". Der IOBroker weiß also, das die Steckdose nicht erreicht wird beim Senden durch fehlendes Acknowledge.
    Mein Datenpunkt hat aber den Wert den ich geschrieben habe, ist aber jetzt einfach Rot.

    Ich möchte einfach eine Funktion ausführen, die noch x mal erneut sendet.

    Vielen Dank in vorraus!

    paul53P 1 Reply Last reply
    0
    • J JinnBln

      Hallo liebe Community,

      ist es mir möglich auf ein SetState aus einem Script auf ein physikalisches Device direkt zu reagieren?
      Um den konkreten Fall zu beschreiben, ich habe eine Steckdose, die ab und zu nicht reagiert.
      Die Log sagt dann Fehler 233 "Mac no Ack". Der IOBroker weiß also, das die Steckdose nicht erreicht wird beim Senden durch fehlendes Acknowledge.
      Mein Datenpunkt hat aber den Wert den ich geschrieben habe, ist aber jetzt einfach Rot.

      Ich möchte einfach eine Funktion ausführen, die noch x mal erneut sendet.

      Vielen Dank in vorraus!

      paul53P Offline
      paul53P Offline
      paul53
      wrote on last edited by paul53
      #2

      @JinnBln sagte:

      Ich möchte einfach eine Funktion ausführen, die noch x mal erneut sendet.

      Ich sende mit 1 s und 5 s Verzögerung nochmal, falls nicht der Aktor mit Ack triggert (dann werden die Timer gestoppt).

      const actid  = '...';
      const ventid = '...';
      
      var vent = getState(ventid).val; // Sollzustand
      var act = getState(actid).val; // Aktor
      
      var timer1 = null;
      var timer5 = null;
      
      function actor() {
          if(act === vent) {
              if(timer1) clearTimeout(timer1);
              if(timer5) clearTimeout(timer5);
          } else {
              setState(actid, vent);
              timer1 = setTimeout(function() {setState(actid, vent);}, 1000);
              timer5 = setTimeout(function() {setState(actid, vent);}, 5000);
          }
      }
      
      actor();  // script start
      
      on(ventid, function(dp) {
          vent = dp.state.val;
          actor();
      });
      
      on({id: actid, ack: true}, function(dp) {
          act = dp.state.val;
          actor();
      });
      

      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

      Hello! It looks like you're interested in this conversation, but you don't have an account yet.

      Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

      With your input, this post could be even better 💗

      Register Login
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      Support us

      ioBroker
      Community Adapters
      Donate

      575

      Online

      32.8k

      Users

      82.7k

      Topics

      1.3m

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

      • Don't have an account? Register

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