How do I design a desk bell that fires a script on pushing it?

Hi there,

What I like to do is to make a desk bell that fires a script on pushing it, so that people got notified with a DM in Hangout Chat (by a bot) to say their lunch has been delivered (for the people that didn’t hear the bell).
Have done some research and the idea of Aaron (https://aaronparecki.com/2017/11/13/5/kickstarter-desk-bell) with a pi zero is getting close. But where this idea goes ‘outside-in’ (app invokes bell), mine goes ‘inside-out’ (bell invokes script for external webhook). Do you have experience, recommendations (also in regards to security)?

Thanks in advance,
Hans

I’d use a Wemos D1 mini and ESPhome rather than a raspberry pi (about a 10th of the cost) but the mechanical side would stay the same.

Esphome has an addon for Hassio. The devices are configured with a yaml file and it talks to home assistant with an api that supports discovery.

There are lots of examples of how to configure devices and it is very simple to get going.

@tom_l I don’t think the mechanics remain the same. @Hans2HA wants the bell to act as a press button switch. The article by aaronparecki does the opposite - an electro-mechanical arm rings the bell.

I imagine that somewhere in the bell itself you could put a microswitch and wire it to an esp.

Sorry, I skimmed the article before rushing out the door. Then realised I was early :roll_eyes:

Replace the striker mechanical button in the centre of the bell with a small push button.

e.g.

SW-SPST-NC-2T

Wire this to one of the D1 mini GPIOs.

On detection of the button press, fire the solenoid using the D1 mini.

The button press will be reported by the ESPhome api to home assistant where it can trigger an automation to send notifications.

Example ESPhome configuration (untested):

esphome:
  name: desk_bell
  platform: ESP8266
  board: d1_mini

wifi:
  ssid: 'YOUR SSID HERE'
  password: !secret wifi_pwd # you will need a secrets file in the esphome directory
  manual_ip:
    static_ip: xxx.xxx.xxx.xxx # Optional but recommended
    gateway: xxx.xxx.xxx.xxx
    subnet: xxx.xxx.xxx.xxx

api:
  password: !secret api_password # you will need a secrets file in the esphome directory

logger:
#  level: WARN # Uncomment this once confirmed working and re-upload

ota:
  password: !secret esp_pwd # you will need a secrets file in the esphome directory

binary_sensor:
  - platform: status
    name: "Desk Bell Status"

  - platform: gpio
    name: "Desk Bell Button"
    pin:
      number: D6
      mode: INPUT_PULLUP
    filters:
      - delayed_on: 10ms # debounce time for the switch to prevent multiple triggers due to switch contacts 'bouncing'
      - delayed_off: 10ms
    on_press:
      then:
        - switch.turn_on: solenoid
        - delay: 300ms # you may have to adjust this pulse time to get the solenoid to srike effectively
        - switch.turn_off: solenoid
switch:
  - platform: gpio
    id: solenoid
    pin:
      number: D5

sensor:
  - platform: wifi_signal
    name: "Desk Bell WiFi Signal"
    update_interval: 15s
    filters:
      - sliding_window_moving_average:
          window_size: 15
          send_every: 15
          send_first_at: 15

In this example the button is connected to GPIO D6 and ground. The TIP120 transistor base (that drives the solenoid) is connected to GPIO D5.

It also includes a status sensor (is the D1 connected) and a wifi signal strength sensor that will both report to home assistant for monitoring the health of your wifi bell.

Home assistant automation:

- id: desk_bell_notification
  alias: 'Desk Bell Notification'
  trigger:
  - platform: state
    entity_id: binary_sensor.desk_bell
  action:
(your notifications here)

In the Blog for the release of 0.97, Frenck did a great HA doorbell modification… could use the ideas in that for this project.

Hi Tom, this sounds really interesting and I will look into this - thanks!!

Wow, I definitely want to review this first - such a low cost and no soldering required fits me best because I don’t have material to do this and also have no experience so this would be my preferred solution. Many thanks @DavidFW1960!

Hans

1 Like

You have basically been given the same solution twice. The tricky part will be getting a switch/pushbutton inside the bell thing.

Indeed @nickrout, I see similarities and this will indeed be a challenge. I will buy the components I need for now (the first part of the circuit) and then play around with it to get a better idea how it fits and needs to work inside the bell…