We have an old-fashioned doorbell that ran off a 12V AC transformer. This page details how we changed our doorbell.

The doorbell was frankly too loud; Ian tried muffling it a few times, though our cats still panicked, so I ended up disconnecting the bell.

We have home deliveries, so it made sense to reactivate the doorbell somehow. Ian did some searching on the internet and found that some people had used Zigbee Door and Window sensors, though the results were a bit hit and miss.

Ian had used a number of Sonoff ZBMINI switches in the past, so thought somehow I could rig something up.

The ZBMINI has Live and Neutral in, with a switched live out. In addition, it has the ability to wire an on / off switch in carrying no voltage. Ian only wired up the input Live and Neutral so that the device live, they connected directly to the ZBMINI to house mains, though protected by a 20mm 10 Amp fuse.

A doorbell is a very simple circuit, when the button is pressed just completes a circuit, in our case it would have delivered 12V AC to the bell, I cut into this circuit and wired in a 12V AC Coil Power Relay, so that when the doorbell is pressed, the relay becomes energised, which mimics a switch being turned on briefly. 2 wires from the relay are then into the switch connectors on the ZBMINI.

Parts list:

The parts list above contains paid links

Ian drilled a 12mm hole into the side of the Pattress Back Box to mount the fuse holder, then soldered suitable live mains cable to the fuse holder, to which I then applied heat shrink, so there is no exposed live wire. One wire goes into the house circuit, the other side of the fuse goes to the ZBMINI. Some bell wire Ian used goes to connect 7 and 8 on the AC power relay to energise it when the doorbell is pressed. A little more bell wire goes from the normally not connected terminals of the relay to the switch contacts on the ZBMINI.

Inside this pattress box is the 12V AC relay and Sonoff ZBMINI, ultimate aim is to construct a cupboard around this box and other devices mounted on the wall. We printed the warning and information labels on our Brother thermal printer.

Ian developed the doorbell automation in 2 parts, initially using an input_boolean, as a proof of concept before making the bell interface. I created input_boolean.doorbell_pressed

By using the input_boolean and the automation below, I could test the script

alias: Door Bell pressed
description: ""
trigger:
  - platform: state
    entity_id:
      - input_boolean.doorbell_pressed
    from: "off"
    to: "on"
condition: []
action:
  - service: script.new_script
    data: {}
mode: single

Below is how the automation looks in the Home Assistant visual editor:

The script that is called when the input_boolean.doorbell_pressed is switched from off to on:

alias: ScriptFrontDoorBell
sequence:
  - service: sonos.snapshot
    data:
      entity_id: all
      with_group: false
  - service: media_player.volume_set
    data:
      volume_level: 0.5
    target:
      entity_id:
        - media_player.office
        - media_player.kitchen
        - media_player.sandra_room
        - media_player.headphones
  - service: media_player.play_media
    target:
      entity_id:
        - media_player.office
        - media_player.kitchen
        - media_player.headphones
        - media_player.sandra_room
    data:
      media_content_id: /media/local/FrontDoorBell.mp3
      media_content_type: music
      announce: true
  - delay:
      hours: 0
      minutes: 0
      seconds: 5
      milliseconds: 0
  - service: sonos.restore
    data:
      entity_id: all
      with_group: false
mode: single

A breakdown of what the script above does:

  • service: sonos.snapshot – this takes a copy of all the devices listed in the entity_id, recording currently volume, track list and playing position of current track
  • service: media_player.volume_set specifies a volume amount between 0 and 1, devices to set are in the entity_id section
  • service: media_player.play_media – is where we specify which Sonos speakers will play our media filw
  • media_content_id: /media/local/FrontDoorBell.mp3 – is the location on the Home Assistant where the media file is to be accessed from
  • delay: – for 5 seconds
  • service: sonos.restore – this restores all the settings captured by the earlier sonos.snapshot

Special Note: where the FrontDoorBell.mp3 is stored from a windows network location is as follows – \192.168.*.***\media, the script above is correct and that is where Home Assistant ‘sees’ the media file

The following audio file is what we play to all our Sonos speakers when our front door bell is pushed.

We used this website to generate our .mp3 file

Warning – If you are not competent with Electrics do not attempt to wire anything yourself, get an electrician to do it.