Navigation

    Logo
    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unread
    • Categories
    • Unreplied
    • Popular
    • GitHub
    • Docu
    • Hilfe
    1. Home
    2. Deutsch
    3. Skripten / Logik
    4. Blockly
    5. Kontaktsensor offen wenn nicht daheim

    NEWS

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

    • ioBroker goes Matter ... Matter Adapter in Stable

    • Monatsrückblick - April 2025

    Kontaktsensor offen wenn nicht daheim

    This topic has been deleted. Only users with topic management privileges can see it.
    • Asgothian
      Asgothian Developer @Olli_M last edited by

      @olli_m schau dir mal die Syntax der Blöcke in deinem Falls und deinem Sonst-Falls fall an. Da ist die Logik nicht ok.

      Die im Sonst-Falls ist korrekt, die im Falls ist nicht korrekt.

      A.

      1 Reply Last reply Reply Quote 1
      • Cinimod
        Cinimod Most Active @Olli_M last edited by Cinimod

        @olli_m

        Genau, da stimmt was in der Logik nicht ... so könnte man es machen, wobei das nicht wirklich zu deinen Vorgaben passt, weil du auch Nachricht bekommst wenn du nicht daheim bist ... und auch wenn Fenster geschlossen ... (wie es aktuell aussieht).

        Dann musst du einfach den letzten "nicht" block raus nehmen ... 😉
        a0bec282-1f91-4d53-b399-f929ce81e619-image.png

        1 Reply Last reply Reply Quote 1
        • paul53
          paul53 @Olli_M last edited by

          @olli_m sagte: soll nur wenn ich daheim bin, eine Message schicken

          Blockly_temp.JPG

          Olli_M 1 Reply Last reply Reply Quote 2
          • Codierknecht
            Codierknecht Developer Most Active @Olli_M last edited by Codierknecht

            @olli_m
            Wie meine Vorredner schon bemerkt haben:

            1. Du hast im ersten Teil und und = verwechselt
            2. Deine Logik ist auch sonst nicht OK
              Wenn offen und anwesend => Nachricht (OK)
              Wenn geschlossen und nicht anwesend => Nachricht (vermutlich nicht im Sinne des Erfinders).

            Vermutlich ist das Beispiel von @paul53 das was Du willst. Aber das kannst nur Du entscheiden.

            Das kennst Du? https://forum.iobroker.net/topic/70481/blockly-for-dummies-starthilfe-und-tipps

            Logische Werte muss man nicht per "= wahr" oder "= falsch" prüfen. Wie @Cinimod es zeigt, kann man da direkt den Wert verwenden oder diesen negieren (nicht), falls man auf "falsch" prüfen möchte. Das liest sich besser und spart einen Block.

            Auch ein "sonst" mit einem zusätzlichen "falls" kann man sich sparen. Dafür gibt es die Möglichkeit "sonst falls" zu verwenden.

            Olli_M 1 Reply Last reply Reply Quote 2
            • Olli_M
              Olli_M @Codierknecht last edited by

              Erstmal vielen Dank an Alle...

              ich probiere es jetzt mal mit dem Script von Paul

              @Codierknecht

              lese ich mir heute Abend mal durch 🙂 danke Euch

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

                @paul53

                Hallo
                also das klappt nicht, da bekomme ich jetzt Meldungen obwohl ich daheim bin wenn ich das Fenster öffne oder schließe.

                Bildschirmfoto 2025-04-20 um 09.08.10.png

                Homoran paul53 2 Replies Last reply Reply Quote 0
                • Homoran
                  Homoran Global Moderator Administrators @Olli_M last edited by

                  @olli_m was hat den der geprüfte "service...home..." für eine Wert?

                  Olli_M 1 Reply Last reply Reply Quote 0
                  • Olli_M
                    Olli_M @Homoran last edited by

                    @homoran

                    gerade false, aber bin grad nicht daheim, aber sonst true/false

                    oder was meinst du?

                    Bildschirmfoto 2025-04-20 um 10.59.01.png

                    Homoran 1 Reply Last reply Reply Quote 0
                    • Homoran
                      Homoran Global Moderator Administrators @Olli_M last edited by

                      @olli_m sagte in Kontaktsensor offen wenn nicht daheim:

                      gerade false, aber bin grad nicht daheim,

                      ja, aber wenn du zu Hause bist und trotzdem die Meldung bekommst.

                      Olli_M 1 Reply Last reply Reply Quote 0
                      • Olli_M
                        Olli_M @Homoran last edited by Olli_M

                        @homoran

                        ja aber ich will doch nur nachrichten, wenn ich nicht daheim bin 🙂

                        ich dachte das Blockly von Paul wäre genauso...?=

                        Homoran 1 Reply Last reply Reply Quote 0
                        • Homoran
                          Homoran Global Moderator Administrators @Olli_M last edited by

                          @olli_m sagte in Kontaktsensor offen wenn nicht daheim:

                          ja aber ich will doch nur nachrichten, wenn ich nicht daheim bin

                          NATÜRLICH!
                          Genau deswegen muss man ja wissen, was DANN der Zustand dieses Datenpunktes ist.

                          @olli_m sagte in Kontaktsensor offen wenn nicht daheim:

                          ich dachte das Blockly von Paul wäre genauso...

                          Eben!

                          Olli_M 1 Reply Last reply Reply Quote 0
                          • Olli_M
                            Olli_M @Homoran last edited by

                            @homoran
                            sorry ich versteh deine Kommentare nicht....

                            wie gesagt habe eine Nachricht bekommen obwohl ich daheim war.

                            was meinst du mit "DANN" kannst du dich etwas klarer ausdrücken.

                            so klappt das blockly definitiv nicht.

                            Asgothian Homoran 2 Replies Last reply Reply Quote 0
                            • Asgothian
                              Asgothian Developer @Olli_M last edited by Asgothian

                              @olli_m sagte in Kontaktsensor offen wenn nicht daheim:

                              @homoran
                              sorry ich versteh deine Kommentare nicht....

                              wie gesagt habe eine Nachricht bekommen obwohl ich daheim war.

                              was meinst du mit "DANN" kannst du dich etwas klarer ausdrücken.

                              so klappt das blockly definitiv nicht.

                              Es geht um den Wert des datenpunkte wenn du zu Hause bist. Dabei ist auch wichtig ob es wahr oder “wahr” ist - das macht einen Unterschied,

                              Dazu kommt die Frage ob der DP überhaupt korrekt funktioniert.

                              Zeig doch mal bitte die Details zu dem datenpunkt - sprich was das für ein Typ ist (string, numerisch, Zeichenkette, etc.), und überprüfe ob der Wert wirklich wahr ist (nicht “wahr”) wenn du zu Hause bist.

                              A.

                              1 Reply Last reply Reply Quote 0
                              • Homoran
                                Homoran Global Moderator Administrators @Olli_M last edited by

                                @olli_m sagte in Kontaktsensor offen wenn nicht daheim:

                                kannst du dich etwas klarer ausdrücken.

                                du sollst den Wert dieses Datenpunkts icht jetzt kontrollieren, sondern DANN wenn du eine Meldung bekommst, obwohl du zu Hause bist.

                                Ich weiß nicht, was daran noch klarer geht

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

                                  @olli_m sagte: Meldungen obwohl ich daheim bin

                                  Sieh dir den in meinem Vorschlag von dir zitierten Text an: "soll nur wenn ich daheim bin, eine Message schicken".

                                  Setze den Block "nicht" vor "Wert von anwesend", wenn es umgekehrt sein soll.

                                  Homoran Olli_M 2 Replies Last reply Reply Quote 1
                                  • Homoran
                                    Homoran Global Moderator Administrators @paul53 last edited by

                                    @paul53 sagte in Kontaktsensor offen wenn nicht daheim:

                                    Setze den Block "nicht" vor "Wert von anwesend", wenn es umgekehrt sein soll.

                                    das wäre die Konsequenz, aber die Zusatzinfo

                                    @olli_m sagte in Kontaktsensor offen wenn nicht daheim:

                                    gerade false, aber bin grad nicht daheim

                                    lässt mich an dem korrekten Status zweifeln.

                                    Olli_M 1 Reply Last reply Reply Quote 0
                                    • Olli_M
                                      Olli_M @Homoran last edited by

                                      @homoran

                                      Der DP wurde ja selbst erstellt von IOT:

                                      {
                                        "_id": "iot.0.services.custom_location.home",
                                        "type": "state",
                                        "common": {
                                          "name": "Service for location.home",
                                          "write": true,
                                          "read": true,
                                          "type": "value",
                                          "role": "value"
                                        },
                                        "native": {},
                                        "from": "system.adapter.admin.0",
                                        "user": "system.user.admin",
                                        "ts": 1741550027424
                                      }
                                      

                                      sorry ich verstehe nicht den unterschied zwischen wahr und "wahr".

                                      Olli_M paul53 2 Replies Last reply Reply Quote 0
                                      • Olli_M
                                        Olli_M @Olli_M last edited by

                                        es ist ja eh verwirrend wenn man im blockly deutsche sprache hat aber im DP dann english hat....wie kommt man auf sowas denn? :_)

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

                                          @paul53

                                          okay probiere ich 🙂

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

                                            @olli_m sagte: Der DP wurde ja selbst erstellt von IOT:

                                            Mit falschem common.type: Er muss "boolean" sein!

                                            @olli_m sagte in Kontaktsensor offen wenn nicht daheim:

                                            unterschied zwischen wahr und "wahr".

                                            wahr (true) ist ein Logikwert, "wahr" ist eine Zeichenkette.

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

                                            Support us

                                            ioBroker
                                            Community Adapters
                                            Donate

                                            961
                                            Online

                                            31.7k
                                            Users

                                            79.7k
                                            Topics

                                            1.3m
                                            Posts

                                            6
                                            21
                                            484
                                            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