How to add a buzzer feature to Home Assistant Yellow?

Hi,
For a project, I would like to connect a buzzer to Home Assistant Yellow, any idea on how to achieve this?

The project purpose is to build a timetracking tool for a customer’s offices.
Basicly, when employees will reach their office, they will use RFID tag to scan a tag reader (probably the one provided by @adonno), an automation will then send employee_id to an timetracking API that’ll keep record of hours or coming/leaving.

I know the tag reader has already a buzzer, but if buzzer is enabled, from what I know it’ll beep everytime a tag is scanned. What I need is to being able to do a different sound when employee check-in, and another one when he check out. This will depend of the API feedback. It’s why I thought adding a buzzer to make the magic happen.

  • Is it possible to add in the Home Assistant Yellow box a buzzer ?
  • Is there wireless buzzer or ring that can do the job or another idea?
  • Could it be possible that H.A use the buzzer of the tag reader to send back one or two beep?

any ideas are welcomed :wink:

Use Media to play a WAV using the 3.5 mm audio jack.

If you’re using the ESPHome based tag reader, then the firmware for that will be easy to customise for different arrive/leave sounds (I assume it has a passive rtttl buzzer?)

You’d likely have a work/away binary sensor which is toggled by a card swipe (and anything else you want) and have a single beep for work and a double beep for away.

I don’t personally really see the need to get the yellow too involved, I would leave most of the work to the esp and ESPHome.

Good pont - the “standard” ESPhome RFID card reader design from a couple of years ago uses a buzzer which is really a piezo speaker which allows ESPhome to play different tones, and not just beeeeep.

This can be seen in the standard YAML where several different noises are configured:

    - rtttl.play: "success:d=24,o=5,b=100:c,g,b"
    - rtttl.play: "beep:d=8,o=5,b=100:b"
    - rtttl.play: "write:d=24,o=5,b=100:b,b"

Add two switches in ESPhome to play In and Out noises, and trigger from HASS.

1 Like

Shouldn’t even need to trigger it from Hass if you don’t want.

ESPHome should be able to track and action it all internally and basically be stand-alone without HA being involved much.

You could just have the work/away status sent to HA for reporting, and have a toggle button for HA to remotely override the work/away state if you need that functionality (say you want people to also be able to sign on/off via HA in the browser).

Thanks a lot for your feedbacks !

I get it works as expected. My API send a json feedback that allow me to modulate the sound on the ESPHome Tag reader with RTTTL melodies. I did the automation on H.A side, that was easyer to handle…

alias: Timetracking
description: Gère les scans sur le lecteur dédié au timetracking
trigger:
  - platform: event
    event_type: tag_scanned
condition:
  - condition: template
    value_template: "{{ trigger.event.data.device_id == '110266286d413c88f8755fbd2xxxxxx' }}"
action:
  - service: input_text.set_value
    target:
      entity_id: input_text.tag_id
    data:
      value: "{{ trigger.event.data.tag_id }}"
  - service: shell_command.tag_tracking
    data: {}
  - delay: "00:00:02"
  - choose:
      - conditions: "{{ states('sensor.employee_status') == 'checkin' }}"
        sequence:
          - service: esphome.tagreader_0ed2df_play_rtttl
            data:
              song_str: welcome:d=4,o=5,b=125:16a#,16c6,16d6,16d#6,2f6
      - conditions: "{{ states('sensor.employee_status') == 'checkout' }}"
        sequence:
          - service: esphome.tagreader_0ed2df_play_rtttl
            data:
              song_str: goodby:d=4,o=5,b=140:8c.,16g4,g.4
      - conditions: "{{ states('sensor.employee_status') == 'error' }}"
        sequence:
          - service: esphome.tagreader_0ed2df_play_rtttl
            data:
              song_str: error:d=24,o=4,b=100:4b,4a,4g#,4g,4b,4a,4g#,4g
mode: single

& in the config file:

shell_command:
  send_tag_id: "curl -o /config/.storage/status.json 'https://mydomain.com/timesheet.php?tag_id={{ states('input_text.tag_id') }}'"

command_line:
  - sensor:
      name: Tag Status
      command: "cat /config/.storage/status.json | jq -r '.status'"
      scan_interval: 1

input_text:
  tag_id:
    name: Tag ID
    initial: ""