Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. Hue mit 2 Taster schalten

    NEWS

    • Neuer Blog: Fotos und Eindrücke aus Solingen

    • ioBroker@Smart Living Forum Solingen, 14.06. - Agenda added

    • ioBroker goes Matter ... Matter Adapter in Stable

    Hue mit 2 Taster schalten

    This topic has been deleted. Only users with topic management privileges can see it.
    • coyote
      coyote Most Active last edited by

      Eigentlich ganze einfaches Script, aber irgendwie will es nicht. Weiß nicht warum, bräuchte mal Hilfe 😉

      on({
          id: ("hm-rpc.0.MEQ0083015.1.PRESS_SHORT" || "hm-rpc.0.MEQ0083023.1.PRESS_SHORT"),  //Lichtschalter Küche
          val: true
      }, function(obj) {
          getState("hue.0.Philips_hue.Hue_Lamp_Küche.on");
          if (obj.newState.val === true){
          setState("hue.0.Philips_hue.Hue_Lamp_Küche.on", false);
      } else if (obj.newState.val === true){
      setState("hue.0.Philips_hue.Hue_Lamp_Küche.on", true);
      }
      });
      
      1 Reply Last reply Reply Quote 0
      • blauholsten
        blauholsten Developer last edited by

        Ich denke val im on Aufruf muss in "val"! (Vorausgesetzt man kann dort mehrere || oder Abfragen machen)

        Und du fragst obj.newState 2 mal auf true ab???
        4447_iobroker.2018-07-27.log

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

          on({
              id: "hm-rpc.0.MEQ0083015.1.PRESS_SHORT",  //Lichtschalter Küche
              val: true
          }, function(obj) {
              setState("hue.0.Philips_hue.Hue_Lamp_Küche.on", !getState("hue.0.Philips_hue.Hue_Lamp_Küche.on").val);
          });
          on({
              id: "hm-rpc.0.MEQ0083023.1.PRESS_SHORT",  //Lichtschalter Küche
              val: true
          }, function(obj) {
              setState("hue.0.Philips_hue.Hue_Lamp_Küche.on", !getState("hue.0.Philips_hue.Hue_Lamp_Küche.on").val);
          });
          
          

          Fehler:

          getState("hue.0.Philips_hue.Hue_Lamp_Küche.on");
          

          Macht gar nichts. Du musst das Ergebnis irgendwo speichern und dann auswerten.

          z.B. ` > var obj = getState("hue.0.Philips_hue.Hue_Lamp_Küche.on");

          if (obj.val == true)…. `

          Fehler:

          ("hm-rpc.0.MEQ0083015.1.PRESS_SHORT" || "hm-rpc.0.MEQ0083023.1.PRESS_SHORT")
          

          Geht nicht. Das Ergebnis ist "hm-rpc.0.MEQ0083015.1.PRESS_SHORT".

          1 Reply Last reply Reply Quote 0
          • coyote
            coyote Most Active last edited by

            @blauholsten, klar zweimal "true" is natürlich quatsch, hab ich mich vertippt, war schon spät letzte Nacht.

            @bluefox, danke dir werde ich dann mal testen. Brauche wohl noch etwas bis ich das richtig hinbekomme mit javascript :roll:

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

            Support us

            ioBroker
            Community Adapters
            Donate

            434
            Online

            31.9k
            Users

            80.2k
            Topics

            1.3m
            Posts

            3
            4
            893
            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