Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. JavaScript - Homematic Handsender

    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

    JavaScript - Homematic Handsender

    This topic has been deleted. Only users with topic management privileges can see it.
    • V
      vlink last edited by

      Hallo,

      ich habe eine Keymatic und einen Homematic Handsender.

      Würde gerne die 4 Taste (Licht) auf der Fernbedienung programmieren das mittels JavaScript bei kurzem Tastendruck

      eine Hue-Lampe angeht, bei langem wieder aus.

      Für Aus geht das. Für Press_Short nicht. Irgendwie habe ich dann einen Loop im Script und es hört nicht mehr auf.

      Unter Objekte wird der Status für Press_Short auch komisch angezeigt.

      Weiß jemand was ich hier falsch mache?

      Vielen Dank!

      759_hm01.png

      Dass ist das Script:

      on({id: 'hm-rpc.0.MEQ0XXXXX.3.PRESS_SHORT', val: true}, 
      function (obj) { current_state = getState("hm-rpc.0.MEQ0XXXXX.3.PRESS_SHORT").val;
      console.log (current_state);
      if (current_state === true)
          {
          console.log ("Hier1");
          setState("hue.0.Philips_hue.Flur.bri", 100);
          setState("hm-rpc.0.MEQ0XXXXX.3.PRESS_SHORT", false); 
          return;
          }
      });
      
      on({id: 'hm-rpc.0.MEQ0XXXXX.3.PRESS_LONG', val: true}, 
      function (obj) { current_state = getState("hm-rpc.0.MEQ0XXXXX.3.PRESS_LONG").val;
      console.log (current_state);
      if (current_state === true)
          {
          console.log ("Hier2");        
          setState("hue.0.Philips_hue.Flur.bri", 0);
          setState("hm-rpc.0.MEQ0XXXXX.3.PRESS_LONG", false);
          return;
          }
      });
      
      1 Reply Last reply Reply Quote 0
      • apollon77
        apollon77 last edited by

        Wirf das "set false" bitte raus. Da das ein "button" ist ist das für die CCU ein weiterer Tastendruck den Du von extern triggerst, damit setzt Sie dir den State wieder auf true und so weiter.

        Buttons werden immer auf "true" getriggert (auf Aktualisierung). Die gehen an sich nie auf "false"

        1 Reply Last reply Reply Quote 0
        • V
          vlink last edited by

          das wars

          Danke!!!!!

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

          Support us

          ioBroker
          Community Adapters
          Donate

          841
          Online

          31.7k
          Users

          79.8k
          Topics

          1.3m
          Posts

          2
          3
          726
          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