Make a dumb doorbell smart with Shelly 1

I have a dumb doorbell which I wanted to make smart so I get messages on my phone including a picture from the camera.

I was using a Xiaomi vibration sensor which I sticked to my chime, but there always was a delay and when someone only pushed the doorbell button very short it doesn’t (always) work.

After some research I found that a Shelly 1 would be able to do the job, but couldn’t find a connection diagram for this. After some help from the Dutch Tweakers forum and the Shelly Support site I have successfully installed the Shelly 1. In this post I will explain how I did this and share some usefull code as well.

With this solution you can:

  • Receive messages when the doorbell button is pushed
  • Turn the chime off on certain times (and still receive a messages when the doorbell button is pushed)
  • Ring the doorbell via HA, can be useful for alarms etc.

What do you need

  • Shelly 1
  • 12V DC adapter

My doorbell button and chime are connected to a 8V transformer.

Preparing the adapter and the Shelly 1

  1. Make sure to set the bridge on the Shelly to 12V DC. Check the manual on how to do this.
  2. You have to strip the wires from the adapter in order to connect these to the Shelly 1.

Connecting the Shelly 1
See the connection diagram below on how to connect the adapter, the push button and chime to the Shelly 1.
The plus wire (normally the one with the stripes on it) goes to the N on the Shelly and the negative wire goes to the L.

Configuring the Shelly
Once the adapter is connected to a wall outlet you can configure the Shelly 1. I assume you have connected the Shelly to wifi and HA already and only mention the specific settings here.

  • Set POWER ON DEFAULT MODE to SWITCH
  • Set BUTTON TYPE to Toggle Switch

Configuration in HA

  • When the doorbell button is pushed the binary sensor of the Shelly device will go from off to on. You can listen to this state change with an automation as below where you have to change the entity_id to the one of your Shelly 1.
- alias: Notification to phone when doorbell button is pushed
  trigger:
    - platform: state
      entity_id: binary_sensor.shelly_doorbell_switch
      to: 'on'
  action:
    - service: camera.snapshot
      <etc>
    - service: notify.telegram
      <etc>

You can add a delay in the automation so you wont get multiple messages when someone is pushing the button multiple times in a short period.

  • You can add a switch in HA which you can use to turn the chime on and off. You will still get a message from the automation above no mather of the chime state, as HA will still detect the doorbell button is pushed. You can make an automation to silence the chime at certain times.
    In order to do this, we need to get the button type from the Shelly API and set it to Detached if we want the chime to be silent.
    Add the code below to get a switch showing the current status of the chime. Pushing the switch in HA will either turn the Shelly in Detached (chime is not used) or Toggle (chime is used) mode.
    Change the IP address to the one the Shelly is using (and set a fixed IP in your router).
switch:
  - platform: rest
    name: shelly_doorbell_chime_status
    resource: http://192.168.1.187/settings/relay/0
    body_on: 'btn_type=toggle'
    body_off: 'btn_type=detached'
    is_on_template: '{{ value_json.btn_type == "toggle" }}'

That’s it. Now you have made your dumb doorbell smart and it only takes a Shelly 1 and a 12V adapter.

Edit 14-02-2021
I noticed that when the button of the doorbell is only pressed for a very short period, the chime rang but HA wasn’t triggered. Played with some settings and couldn’t find a way to improve this, so now I have added under I/O URL actions and then OUTPUT SWITCHED ON URL an URL to a PHP page which is hosted on my NAS and triggers an input_boolean via the HA API. I use that input_boolean as an extra trigger in my automation. Using this also a very short press on the button is noticed and I get the notification.

Or see this post for a solution via MQTT.

21 Likes

Thanks! Will certainly try this.

1 Like

FYI, the author clearly spells out 12 volt DC. But just be aware most USA door bell circuits are AC ,transformers are AC not DC. And range in voltages of 12, 16 and 24 volt.

2 Likes

Just 24 hours ago I did an almost identical doorbell mod, except mine is hardwired into the home security system instead of a Shelly. I will be using 1 or 2 Shellys to control the chime mute function which is controlled by Home Assistant, so it can read something like if the white noise machine in the babys room is running and mute the doorbell for me, then unmute when it turns off

I am in the US and the chime is 16V AC, but I wired the button through 12V DC since the circuits are now separate. It also means the doorbell now stays lit and functions during a power outage (no chime though), since the security system is on dual battery backup

Exactly, the chime here is powered by a 8V AC transformer, but the button is indeed wired seperately via the 12V DC adapter that powers the Shelly.
Nice solution you have created, especially by linking the status of the chime to the white noise machine :sleeping:

Which software/firmware are you using on the Shelly device? I have now connected almost the exact set-up you are also using and connected the Shelly via the MQTT options in the off-the-shelf firmware, but that seems to only make a ‘switch’ topic available, not a ‘binary_sensor’ like you are using.

I use the default Shelly firmware with Shelly4HASS as custom integration.

Thanks Gerard, for the quick response. I will give that component a try, looks very promising.

Hi @gerard33 is it possible to use a sonoff mini instead of the shelly 1 ?
thanks

I don’t own a Sonoff mini so can’t answer that question for you.

@gerard33, just managed to get it working with the Shelly 1 and the latest ShellyForHASS. Thanks again.

1 Like

Hi Did this some time ago just had the button type on the shelly set to “Toggle” I also had it send Push notification to my iphone and Text to spech on my google home, I just need to set it back up as I moved it from a pi to a Docker container on my NAS

Finally got around doing this yesterday evening. Was done pretty fast. The most time it took looking for a 12V supply, luckily I had one laying around (I hope it wasn’t dedicated for something else…)

I Implemented it with MQTT (like I do for all my shellies). And I use the edge button type instead of the toggle. Probably both work.

Thanks again for this small tutorial :slight_smile:

1 Like

Yes you can:
http://redgrendel.com/the-doorbell/

However you need to wire the button to specific pins inside the sonoff. With the shelly these pins are on the outside.
If you use the outside pins of the sonoff you will put full grid power on the button (so 110V or 230V depending where you live). That is not advisable.

Thanks @gerard33, got it working! :slight_smile:

1 Like

Thnx very much for this! For a long time I was looking for an easy solution to add my dumb doorbell to HA.

My Shelly is getting very hot! Too hot to touch for 10 seconds. Is this the same at yours?

My shelly runs at approx the same as human body temp when switching a 100W load, 96F… so it should not be too hot to touch

How can you get the temp?

Normal temperature here. What type of adapter did you connect?