Skip to content

Instantly share code, notes, and snippets.

@hugokernel
Last active September 6, 2023 08:08
Show Gist options
  • Save hugokernel/d261bed1b4a1517181d6f9a10f752dd9 to your computer and use it in GitHub Desktop.
Save hugokernel/d261bed1b4a1517181d6f9a10f752dd9 to your computer and use it in GitHub Desktop.
Using a Dreammachine as a Doorbell with Home Assistant

Dreammachines have a speaker and LED's that can be easily controlled with simple commands.

Thus, it is possible to play a WAV file with the following command aplay -l ding.wav and to play with the lights with this other command.

Link: https://www.reddit.com/r/Ubiquiti/comments/i928s7/that_speaker_in_the_dream_machine_you_can_do/

Put the Wav files in the /mnt/persistent directory of the DreamMachine.

On the Home Assistant side, put this in the configuration:

shell_command:
  dreammachine_doorchime: ssh dreammachine 'aplay /mnt/persistent/doorchime.wav'
  dreammachine_doorchime_led: ssh dreammachine 'echo 240 > /proc/gpio/led_tempo && echo 124 > /proc/gpio/led_pattern && aplay /mnt/persistent/doorchime.wav && echo 0 > /proc/gpio/led_pattern'
  dreammachine_led_on: ssh dreammachine 'echo 240 > /proc/gpio/led_tempo && echo 124 > /proc/gpio/led_pattern'
  dreammachine_led_off: ssh dreammachine 'echo 0 > /proc/gpio/led_pattern'

Then, you can call the service you want like that:

- service: shell_command.dreammachine_led_on
  data: {}
- service: shell_command.dreammachine_doorchime
  data: {}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment