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. Script Aktivzeit von HM Geräten

NEWS

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

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

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

Script Aktivzeit von HM Geräten

Scheduled Pinned Locked Moved Skripten / Logik
7 Posts 2 Posters 1.5k 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.
  • G Offline
    G Offline
    Gmundner
    wrote on last edited by
    #1

    Hallo, ich hoffe ich bin hier richtig.

    Ich suche nach einem Counter Script, das Zählt wenn ein HM Aktor oder Variable auf True ist und stehen bleibt wenn auf false ist, dann aber wieder weiter läuft wenn der Aktor wieder auf True geht.

    Danke schonmal! :)

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

      Vorschlag:

      var idCount = 'javascript.0.Sekunden-Ein';
      var timer = null;
      var cnt = getState(idCount).val;
      
      function count() {
        cnt++;
        setState(idCount, cnt);
      }
      
      // Scriptstart
      if(getState('hm-rpc.0.NEQ1234567.1.STATE').val) timer = setInterval(count,1000);
      
      on('hm-rpc.0.NEQ1234567.1.STATE', function(dp) {
        if(dp.state.val) timer = setInterval(count, 1000);
        else if(timer) clearInterval(timer);
      });
      
      

      Der Zähler-Datenpunkt muss vorher erstellt werden (im Admin-Reiter "Objekte").

      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
      • G Offline
        G Offline
        Gmundner
        wrote on last edited by
        #3

        Hallo Paul,

        danke für die schnelle Antwort, leider mach ich da wohl was falsch, hab eine HM ID eingefügt und den Datenpunkt Zahl Name idCount erstellt.

        Es tut sich aber leider garnichts.

        BG Alfred

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

          Stimmt die ID im Skript

          var idCount = 'javascript.0.Sekunden-Ein';
          

          mit der Datenpunkt-ID überein ? Etwa so:
          493_sekunden-ein.jpg

          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
          • G Offline
            G Offline
            Gmundner
            wrote on last edited by
            #5

            Ahh vielen Dank, da hatte ich was übersehen!

            Noch eine Frage, was muss ich machen wenn der Datenpunkt bei ein "false" anstatt "true" liefert?

            BG Alfred

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

              @Gmundner:

              was muss ich machen wenn der Datenpunkt bei ein "false" anstatt "true" liefert? `

              if(getState('hm-rpc.0.NEQ1234567.1.STATE').val) timer = setInterval(count,1000);
              
              on('hm-rpc.0.NEQ1234567.1.STATE', function(dp) {
                if(dp.state.val) timer = setInterval(count, 1000);
                else if(timer) clearInterval(timer);
              });
              

              –>

              if(!getState('hm-rpc.0.NEQ1234567.1.STATE').val) timer = setInterval(count,1000);
              
              on('hm-rpc.0.NEQ1234567.1.STATE', function(dp) {
                if(!dp.state.val) timer = setInterval(count, 1000);
                else if(timer) clearInterval(timer);
              });
              

              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
              • G Offline
                G Offline
                Gmundner
                wrote on last edited by
                #7

                Dankeschön!!

                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

                559

                Online

                32.7k

                Users

                82.6k

                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