Make Dumb Doorbells Smart Again... On Steroids (with memes)

I got into the HA game while running wire for a security system install. There was a long wait till the technicians could install the system, so I did a substantial amount of prewire work well beyond the typical wiring the company would do. I ran additional wiring for future expansion and had the whole thing setup with a modular wiring trunk so a home automation system could easily take over certain wiring pairs, or be wired in parallel for additional sensor readings.

I had grand plans well beyond what the wife expected to get out of the system. My first project after the install was completed and I had reprogrammed the panel to my liking was an auxiliary power supply (required since the panel power out is insufficient), followed by “the doorbell project”. This chronicles the doorbell project from inception to completion.

There was an event, during the wiring period, where someone rang the doorbell RIGHT after the baby had gone to sleep, and it woke him up.

Apparently the wife came out of his room now with a screaming baby and gave a deathglare to whoever was at the door, and they immediately left. This sparked the project. I told the wife that I was doing something “crazy” with the doorbell, but would not explain in detail, and just said I would explain when I was done. I started drawing up wiring diagrams for what would eventually become the “beta” system, which then required some additional hardware after testing to become rock solid reliable, and then be integrated into HomeAssistant.

THE FEATURES:
12VDC doorbell wiring power maintains dumb doorbell button with light ring
PTC protected auxiliary power supply with multiple output channels
Fully wired power and data paths
DIN rail mounted hardware at 2 meters above floor
Relay controlled AC power transformer to dumb chime dramatically reduces vampire current and heat dissipation
AC/DC voltage isolation
Latching relays for button detection guarantee even the shortest button press is detected
Chime controlled by trigger relay instead of button directly, so pressing the button multiple times has no effect on chime sound
Trigger relay runs through a bypass relay, so chime can be disabled at will
Integrated into security system, doorbell press can be detected and logged into security system app, even if internet is down or home automation system is offline
Battery backup means doorbell detection with no chime functions for several hours without power

I figured it would be a fun project, but each wiring diagram got progressively more complex as features were added and the circuits modified for maximum reliability.

The beta wiring revealed what at first seamed like an unfortunate issue that required a complex workaround, however this worked to my advantage in the end.
The security system zones have a response time that can be shorter than the button press time, so if someone pressed the button… nothing happened
However, one of the control relays I planned on using latched on press, due to the current draw of the LED in the button.
The workaround of course is to remove power to the relay or cut the button circuit for a short time, delatching the relay.
This seemed like a lot more complexity than I wanted, but eliminated the chance of an undetected button press, so I made the latching relay integral to the design.

So, here is how it works.

The doorbell button wiring runs to what I call “the rat’s nest”, which is the metal box protecting the wiring which connects the buttons to the relays, and the incoming wiring for power and outgoing wire to connect to the security system. 12V runs through the relay, to the button, causing it to light up, but not enough to trip the relay. When the button is pressed, the relay trips and there is enough current present to latch it closed. The lights on the relay indicate power is supplied to the exterior doorbell buttons. I used a high quality double relay module with a wide operational voltage range.

The wires on top go to the front door and deck buttons. The red wire is the 16VAC return wire from the chime transformer to the chime. The 2 grey wires on the left supply power to the box, and return the relay’s normally open terminals to the security system zone expander, a Honeywell 4229 which includes 2 relays.

When one of the zones are tripped, a programmed output function triggers the first relay on the zone expander for 15s, which supplies a 12V signal to a DIN rail mounted set of connectors and timer relays.


In more detail:

The black and red terminal blocks are provided with a constant source of current limited 12V ground and power. These feed back a constant power source to the zone expander relays. The separated ground blocks are connected by the black wire at the bottom. The timer relays common output terminal (15) are provided constant power from the red blocks. The left timer relay provides power when on (chime), the right relay provides power when off (button relays), their outputs are connected to the blue blocks at the bottom, and output to the chime and button relays at the top.

The red sheathed wires are from the expander relays to the DIN rail. The 12V trip signal enters the left yellow block at the top, the middle loops back to the input of the 2nd expander relay. The 2nd relay is used to bypass the chime. It’s output enters the right yellow block. The middle and right yellow blocks along with ground connect to the top activation terminals of the timer relays through the short grey wire.

When the rail receives the 12V trip signal… If the 2nd expander relay is “on”, the left timer relay activates immediately for a total of 1 seconds, this provides power to the chime transformer. Ding Dong. The second timer relay trips after a delay of around 12 seconds and stays on, this delatches the button relays by removing their power source. After the zone expander 15s function timer expires, both timer relays loose power and are reset, once again powering the doorbell buttons and their relays.

The security system keypad is used to change the 2nd expander relay position, and HA can send the same keypad entries to control the chime setting through automation.

The chime transformer is connected to mains power by an additional relay that accepts a 12V trigger and kept off unless the doorbell is pressed, it was uncomfortably hot to the touch when normally wired, felt like a 40W lightbulb in terms of heat output. Now it uses no power when idle. If the chime is replaced with a 12VDC unit in the future, the red wire goes away, and the output of the first timer relay would be connected directly to the chime, and the timer adjusted appropriately, all of 2 minutes to make the adjustment.

The power supply is pretty boring from the outside, it provides 8 separate power limited channels off a 10A industrial control board. All wiring in and out is protected by metal clad cable, the AC end goes through a hospital grade surge protector and regulating filter. It has 2 backup batteries (2nd installed later) providing 16AH.

The aux power supply in its current state will die before the security system battery fails. Only non-alarmed components are connected to it, but I will attach emergency lighting and smoke detectors in the future, and add more battery capacity to keep up.

The primary automation controlling the chime is if the system detects a child is sleeping, which is done primarily using the current draw of a white noise machine, detected by a Shelly plug.

The chime can also be turned off as its default setting to not be controlled by automation. Notifications are given when the chime is off, but can also be set to be always given. The chime can also be easily turned back on if it is off by automation, without disabling the automation. All these settings are accessible from the frontend.

The notifications are shown on phones with the companion app, on my TV (if using Kodi), and around the house using RGB LED bulbs specifically for notifications, by way of a “blue” flash of 20s, indicating an event has occurred that was not expected, but it is not critically important. The bulb looks white in the pic due to the exposure level, the reflections are more indicative of its color.

I didnt bother to count how much was spent, the timer relays and button relays add up to around $100, and the zone expander with relays is about the same cost. Add in new buttons, a new transformer, the metal boxes to hold wiring, and misc expenses that probably is another 100, so $300, plus the hardware I already had for other purposes, plus the many hours drawing diagrams, selecting the parts, then setting it all up and testing it, plus the hour or 2 programming and perfecting the automations to accurately detect when the kid is/is not sleeping…

It was quite expensive… and totally worth it. Not just as a fun project and learning experience, but also because some other idiot door to door salesman tried to ring the doorbell at 8pm some night after I had it all set up… and the chime was muted correctly so no ding dong, baby stays sleeping, wife very happy.

4 Likes

grafik

That’s an interresting movie plot … :wink:

2 Likes

Dude, I read your project description twice… i thought my head was going to explode! All this for the best door bell on the planet, I know, right ? Might you do a schematic of your project one day? I think it would be so much better way to follow along :smiley:

Oh I plan on making a wiring diagram and proper parts list, but it took me 4 months just to get time to make this writeup! I also had trouble remembering how the thing worked, since I was making realtime changes to the wiring well after I made the last wiring diagram, which became the beta wiring, and was only on a single doorbell and not both.

There is also the automation code and entities I am using to mute the doorbell, which seems needlessly complicated at first, but is extremely modular and is tiered to be both queued and non-blocking, which is critically important when sending keypad entries to the alarm panel, there needs to be enough time after for the panel to control the connected relays before trying to send more commands (like opening a garage door)

I setup a virtual keypad on a second partition, so activating output devices can be done without blocking the alarm partition’s keypad entries, as entering an alarm code at the same time an automation is trying to activate a relay would cause both actions to fail, since the panel would be receiving keypresses out of order from the same functional keypad.

Here is the script for the output device activation, using an Envizalink 4 virtual keypad on a separate partition from the alarm keypad:

alias: Vista Activate Output Device
sequence:
  - choose:
      - conditions:
          - condition: template
            value_template: '{{ action == ''On'' }}'
        sequence:
          - service: envisalink.alarm_keypress
            data:
              keypress: 'CODE#7{{ device }}'
            entity_id: ' alarm_control_panel.non_alarm_zones'
      - conditions:
          - condition: template
            value_template: '{{ action == ''Off'' }}'
        sequence:
          - service: envisalink.alarm_keypress
            data:
              keypress: 'CODE#8{{ device }}'
            entity_id: ' alarm_control_panel.non_alarm_zones'
      - conditions:
          - condition: template
            value_template: '{{ action == ''On/Off 3s'' }}'
        sequence:
          - service: envisalink.alarm_keypress
            data:
              keypress: 'CODE#7{{ device }}'
            entity_id: ' alarm_control_panel.non_alarm_zones'
          - delay: '00:00:03'
          - service: envisalink.alarm_keypress
            data:
              keypress: 'CODE#8{{ device }}'
            entity_id: ' alarm_control_panel.non_alarm_zones'
      - conditions:
          - condition: template
            value_template: '{{ action == ''On/Off 5s'' }}'
        sequence:
          - service: envisalink.alarm_keypress
            data:
              keypress: 'CODE#7{{ device }}'
            entity_id: ' alarm_control_panel.non_alarm_zones '
          - delay: '00:00:4.5'
          - service: envisalink.alarm_keypress
            data:
              keypress: 'CODE#8{{ device }}'
            entity_id: ' alarm_control_panel.non_alarm_zones'
      - conditions:
          - condition: template
            value_template: '{{ action == ''Off/On 3s'' }}'
        sequence:
          - service: envisalink.alarm_keypress
            data:
              keypress: 'CODE#8{{ device }}'
            entity_id: ' alarm_control_panel.non_alarm_zones'
          - delay: '00:00:03'
          - service: envisalink.alarm_keypress
            data:
              keypress: 'CODE#7{{ device }}'
            entity_id: ' alarm_control_panel.non_alarm_zones'
      - conditions:
          - condition: template
            value_template: '{{ action == ''Off/On 5s'' }}'
        sequence:
          - service: envisalink.alarm_keypress
            data:
              keypress: 'CODE#8{{ device }}'
            entity_id: ' alarm_control_panel.non_alarm_zones'
          - delay: '00:00:4.5'
          - service: envisalink.alarm_keypress
            data:
              keypress: 'CODE#7{{ device }}'
            entity_id: ' alarm_control_panel.non_alarm_zones'
    default: []
  - delay: '00:00:05'
mode: queued
max: 10

A 2s on/off is enough to open a garage door, but because the panel keypad entry timeout is 2s, it needs to be longer.

Here are the mute and unmute scripts that call that script:

alias: Doorbell Chime Mute
sequence:
  - service: script.turn_on
    data:
      variables:
        action: 'On'
        device: '06'
    entity_id: script.script_vista_activate_output_device
  - delay: '00:00:04'
  - service: input_boolean.turn_off
    data: {}
    entity_id: input_boolean.doorbell_chime
  - data:
      title: Security System
      message: Doorbell Chime Muted
      display_time_ms: 15000
      icon: info
      persistent: 'yes'
      id: doorbell_chime
    service: script.generate_alert_notification
  - service: script.script_alert_bulbs_flash
    data:
      color: Green
      seconds: 5
mode: single
icon: 'mdi:volume-off'
alias: Doorbell Chime Unmute
sequence:
  - service: script.turn_on
    data:
      variables:
        action: 'Off'
        device: '06'
    entity_id: script.script_vista_activate_output_device
  - delay: '00:00:04'
  - service: input_boolean.turn_on
    data: {}
    entity_id: input_boolean.doorbell_chime
  - data:
      title: Security System
      message: Doorbell Chime Unmuted
      display_time_ms: 15000
      icon: info
      persistent: 'yes'
      id: doorbell_chime
    service: script.generate_alert_notification
  - service: script.script_alert_bulbs_flash
    data:
      color: Green
      seconds: 5
mode: single
icon: 'mdi:volume-high'

I am using several helpers, the input_boolean.doorbell_chime referenced in the script, which is the “state” variable, another boolean for the “setting”, another for showing notifications even when not muted, and another for “child sleeping”, which is controlled by a single automation, but will eventually be controlled by one for each child.

The automations used for dealing with the changes of the booleans for chime setting can be used with numerous alternative implementations with minimal changes

alias: Doorbell Chime Setting Change
description: ''
trigger:
  - platform: state
    entity_id: input_boolean.doorbell_chime_setting
    for: '00:00:05'
condition: []
action:
  - choose:
      - conditions:
          - condition: template
            value_template: '{{ trigger.to_state.state  == ''on'' }}'
        sequence:
          - condition: state
            entity_id: input_boolean.child_sleeping
            state: 'off'
          - service: input_boolean.turn_on
            data: {}
            entity_id: input_boolean.doorbell_chime
      - conditions:
          - condition: template
            value_template: '{{ trigger.to_state.state  == ''off'' }}'
        sequence:
          - service: input_boolean.turn_off
            data: {}
            entity_id: input_boolean.doorbell_chime
    default: []
mode: single
alias: Doorbell Chime State Change
description: ''
trigger:
  - platform: state
    entity_id: input_boolean.doorbell_chime
    for: '00:00:05'
condition: []
action:
  - choose:
      - conditions:
          - condition: template
            value_template: '{{ trigger.to_state.state  == ''on'' }}'
        sequence:
          - service: script.doorbell_chime_unmute
            data: {}
            entity_id: input_boolean.doorbell_chime
      - conditions:
          - condition: template
            value_template: '{{ trigger.to_state.state  == ''off'' }}'
        sequence:
          - service: script.doorbell_chime_mute
            data: {}
            entity_id: input_boolean.doorbell_chime
    default: []
  - delay: '00:00:10'
mode: queued
max: 10
1 Like

Since covid started >90% of visitors to my house no longer push the button, they prefer to knock on a random piece of the house or door. Camera detects and sends me a photo of them still as its based on PIR and camera movement.

Even thou I have this, the following normally occurs…

  1. someone knocks on door or window.
  2. Dog barks
  3. Child gets woken by dog barking.

:slight_smile: