Von English mit KI übersetzt ·
Zuerst die Hardware. Verwende einen Optokoppler: Brückengleichrichter (oder einen PC817 mit einer Rückwärtsdiode über der LED), 1 kΩ Vorwiderstand, 10 µF am Ausgang, damit die Wechselspannungsrestwelligkeit nicht als 50 Impulse pro Sekunde auftaucht. Die Transistorseite an D5 mit INPUT_PULLUP, sodass der Pin während des Klingelns LOW ist. Im Code entprellen, bei der fallenden Flanke ring: 1 senden und ring: 0 senden, wenn es 2 s lang ruhig ist.Dann würde ich die Alarmregel auslassen. Ein Alarm hat einen Lebenszyklus (offen, quittiert, gelöscht), und für jeden Kurier würden sich Alarme stapeln. Eine Regel auf der Rules-Karte passt besser:
When: A value changes, device "intercom-d1", value "ring", becomes 1
Then: Tell people [x] Members
Message: "Someone is at the street door"
Mitglieder bekommen es in der Glocke, per Push, sofern sie das eingerichtet haben (in der App oder in einem Browser mit aktiviertem Push), und in jeder Chat-App, die sie unter Mein Profil > Chat-Apps verknüpft haben. Sobald dein Admin die Plattform verbindet, verknüpft also jede Person ihr eigenes Konto, und das ist dein Handy-Ping, mit oder ohne App. Empfänger einer Rules-Karte bekommen nie E-Mails oder SMS; für SMS bräuchtest du einen Flow mit einem Notify-Block und Telefonnummern.Eine Sache solltest du wissen: Dieselbe Benachrichtigung an dieselbe Person wird für eine 10-minütige Abklingzeit zurückgehalten. Für eine Türklingel meist in Ordnung, aber wenn zwei Kuriere innerhalb von 10 Minuten kommen, erscheint der zweite nur als „(+1)“ bei der nächsten. Details: Notifications from rules and flows.
Hardware first. Use an optocoupler: bridge rectifier (or a PC817 with a reverse diode across the LED), 1 kΩ series resistor, 10 µF across the output so the AC ripple doesn’t show up as 50 pulses a second. Transistor side to D5 with INPUT_PULLUP, so the pin goes LOW while it rings. Debounce in code, send ring: 1 on the falling edge, and ring: 0 when it’s quiet again for 2 s.
Then I’d skip the alarm rule. An alarm has a lifecycle (open, acknowledge, clear) and you’d have alarms piling up for every courier. A Rules card rule fits better:
When: A value changes, device "intercom-d1", value "ring", becomes 1
Then: Tell people [x] Members
Message: "Someone is at the street door"
Members get it in the bell, by push where they’ve set it up (the app, or a browser with push on), and in every chat app they linked under My Profile > Chat apps. So once your admin connects the platform each person links their own account and that’s your phone ping, app or not. Rules card recipients never get e-mail or SMS, for SMS you’d need a flow with a Notify block and phone numbers.
One thing to know: the same notice to the same person is held back for a 10-minute cooldown. Fine for a doorbell mostly, but if two couriers come within 10 minutes the second one only shows up as „(+1)“ on the next one. Details: Notifications from rules and flows.

