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. Variable nach xx Minuten zurücksetzen

NEWS

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

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

  • Weihnachtsangebot 2025! 🎄
    BluefoxB
    Bluefox
    25
    1
    2.4k

Variable nach xx Minuten zurücksetzen

Scheduled Pinned Locked Moved Skripten / Logik
4 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.
  • N Offline
    N Offline
    nobse
    wrote on last edited by
    #1

    Hallo zusammen

    ich habe ein Variable die bei einer bestimmten Aktion auf true gesetzt wird.

    Jetzt soll dies Variable nach 30 Minuten wieder false werden.

    Wie kann ich das realisieren?

    Gruß Norbert

    Gruß Norbert

    CCU2 • Raspberry für Wetterstation • CMS http://www.exv2.de • HP ProLiant MicroServer Gen8 12GB RAM, 2x3TB, Windows Essentials Server 2016 mit ioBroker

    1 Reply Last reply
    0
    • blauholstenB Offline
      blauholstenB Offline
      blauholsten
      Developer
      wrote on last edited by
      #2
      var timer;
      
      function xxx()
      
      setState('yyy', true)
              if (!timer) {
                     timer = setTimeout(function () {
                 timer = null;
                 setState('yyy', false)
              }, 1800000);
      

      2858_view_tunein.txt

      Entwickler vom: - Viessman Adapter
      - Alarm Adapter

      1 Reply Last reply
      0
      • N Offline
        N Offline
        nobse
        wrote on last edited by
        #3

        Hallo blauholsten

        vielen Dank funktioniert super.

        Gruß Norbert

        Gruß Norbert

        CCU2 • Raspberry für Wetterstation • CMS http://www.exv2.de • HP ProLiant MicroServer Gen8 12GB RAM, 2x3TB, Windows Essentials Server 2016 mit ioBroker

        1 Reply Last reply
        0
        • P Offline
          P Offline
          pix
          wrote on last edited by
          #4

          Hallo,

          oder so:

          on({ 
              id: idVariable, // Variable wird überwacht (idVariable muss natürlich im Skript oben deklariert werden)
              change: 'ne'
          }, function (obj) {
              if (obj.newState.val === true ) { // wenn Variable auf true gesetzt wird
                  setStateDelayed(idVariable, false, 30 * 60 * 1000); // nach 30min zurücksetzen
              }
          });
          
          

          oder noch kürzer müsste auch gehen (nicht probiert :roll: )

          on({"javascript.0.Variable",  // so gehts auch statt id
              val: true
          }, setStateDelayed("javascript.0.Variable", false, 30 * 60 * 1000); // nach 30min zurücksetzen
          );
          
          

          Gruß,

          Pix
          5373_img_4513.jpg

          ioBroker auf Ubuntu in Proxmox (früher Mac mini (bis OS X 10.12.6 Sierra), VIS via iOS; angeschlossen: Homematic CCU2, Homepilot 1, ConBee II, einige Wemos, Sonos, Unifi CK+Protect, Homekit, Homebridge; KEIN blockly! Github-Profil

          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

          564

          Online

          32.6k

          Users

          82.3k

          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