Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. Blockly
    5. fb-Checkpresence Adapter und Blockly

    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

    fb-Checkpresence Adapter und Blockly

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

      Gutne Morgen,

      ich habe den Adapter installiert um die Anwesenheit abzufragen. Dazu habe ich dann ein Blockly erstellt welches mir immer mitteilen (telegramm) soll wenn jemand nicht mehr zu Hause ist.
      Wenn ich jetzt aber zu Hause oder unterwegs bin, wird mir in Regelmäßigen Abständen eine Mitteilung aufs Handy geschickt, dass alle weg sind oder noch da. Immer und immer wieder. So habe ich manchmal bis zu über 1000 Nachrichten auf meinem Handy.
      Kann mir hier jemad weiter helfen?

      on({id: 'fb-checkpresence.0.fb-devices.Galaxy-A7-PhilippHandy.active', val: false}, async function (obj) {
        var value = obj.state.val;
        var oldValue = obj.oldState.val;
        if (getState("fb-checkpresence.0.fb-devices.Galaxy-A7-PhilippHandy.active").val == false && getState("fb-checkpresence.0.fb-devices.Galaxy-S7-Luisa-Handy.active").val == false) {
          setStateDelayed("shelly.0.SHPLG-S#021788#1.Relay0.Switch"/*[object Object]*/, false, 30000, true);
          sendTo("telegram", "send", {
              text: 'Alle sind unterwegs. Ich wünsche einen schönen Tag.'
          });
        }
      });
      on({id: 'fb-checkpresence.0.fb-devices.Galaxy-S7-Luisa-Handy.active', val: false}, async function (obj) {
        var value = obj.state.val;
        var oldValue = obj.oldState.val;
        if (getState("fb-checkpresence.0.fb-devices.Galaxy-A7-PhilippHandy.active").val == false && getState("fb-checkpresence.0.fb-devices.Galaxy-S7-Luisa-Handy.active").val == false) {
          setStateDelayed("shelly.0.SHPLG-S#021788#1.Relay0.Switch"/*[object Object]*/, false, 30000, true);
          sendTo("telegram", "send", {
              text: 'Alle sind unterwegs. Ich wünsche einen schönen Tag.'
          });
        }
      });
      
      on({id: 'fb-checkpresence.0.fb-devices.Galaxy-A7-PhilippHandy.active', change: "ne"}, async function (obj) {
        var value = obj.state.val;
        var oldValue = obj.oldState.val;
        if (getState("fb-checkpresence.0.fb-devices.Galaxy-A7-PhilippHandy.active").val == true && getState("fb-checkpresence.0.fb-devices.Galaxy-S7-Luisa-Handy.active").val == true) {
          setStateDelayed("shelly.0.SHPLG-S#021788#1.Relay0.Switch"/*[object Object]*/, true, 30000, true);
          sendTo("telegram", "send", {
              text: 'Schön das ihr wieder da seit.'
          });
        }
      });
      on({id: 'fb-checkpresence.0.fb-devices.Galaxy-S7-Luisa-Handy.active', change: "ne"}, async function (obj) {
        var value = obj.state.val;
        var oldValue = obj.oldState.val;
        if (getState("fb-checkpresence.0.fb-devices.Galaxy-A7-PhilippHandy.active").val == true && getState("fb-checkpresence.0.fb-devices.Galaxy-A7-PhilippHandy.active").val == true) {
          setStateDelayed("shelly.0.SHPLG-S#021788#1.Relay0.Switch"/*[object Object]*/, true, 30000, true);
          sendTo("telegram", "send", {
              text: 'Schön das ihr wieder da seit.'
          });
        }
      });
      
      on({id: 'fb-checkpresence.0.fb-devices.Galaxy-S7-Luisa-Handy.active', val: false}, async function (obj) {
        var value = obj.state.val;
        var oldValue = obj.oldState.val;
        if (getState("fb-checkpresence.0.fb-devices.Galaxy-S7-Luisa-Handy.active").val == false) {
          sendTo("telegram", "send", {
              text: 'Luisa ist unterwegs'
          });
        }
      });
      
      on({id: 'fb-checkpresence.0.fb-devices.Galaxy-S7-Luisa-Handy.active', val: false}, async function (obj) {
        var value = obj.state.val;
        var oldValue = obj.oldState.val;
        if (getState("fb-checkpresence.0.fb-devices.Galaxy-S7-Luisa-Handy.active").val == true) {
          sendTo("telegram", "send", {
              text: 'Luisa ist wieder zu Hause.'
          });
        }
      });
      
      paul53 1 Reply Last reply Reply Quote 0
      • paul53
        paul53 @Phil87 last edited by paul53

        @phil87
        Da es nur 2 Smartphones sind, verwende auch nur 2 Trigger mit "wurde geändert". Etwa so:

        Bild_2021-06-12_170113.png

        P 1 Reply Last reply Reply Quote 0
        • P
          Phil87 @paul53 last edited by

          @paul53
          Danke für die Idee. Eine Frage habe ich aber noch dazu, was meinst du mit "msg"? Damit ist bestimmt der Messenger gemeint aber warum hat er eine eigene Variable? Kann ich da nicht gleich das sendto nehmen?

          paul53 1 Reply Last reply Reply Quote 0
          • paul53
            paul53 @Phil87 last edited by paul53

            @phil87 sagte: eine eigene Variable? Kann ich da nicht gleich das sendto nehmen?

            Kann man, verbraucht aber mehr Ressourcen, da sendTo() eine komplexe Funktion ist. Die Verwendung der Variablen msg (für Telegram message) ist effizienter.

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

            Support us

            ioBroker
            Community Adapters
            Donate

            747
            Online

            31.9k
            Users

            80.1k
            Topics

            1.3m
            Posts

            2
            4
            337
            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