SOAS - Full featured alarm clock with Home Assistant integration

System Of Alarm Sound - A cheap full featured alarm clock


What?

ESPHome with Home Assistant integration?! “No shit, Sherlock”. Well yes, all ESPHome has got HA integration, but SOAS has features that enables you to have HA automations based on your alarm time. So automations can be triggered based on the alarm time set on the alarm clock. There are 4 switches that will switch relative to the alarm time, you have the choice to enable the HA switch whether the alarm will sound or not. So the alarm does not have to sound for the HA automation to be triggered.

Why?

This alarm clock is customizable, full featured and smart for under €35,-. It’s a clock that can be managed through Home Assistant and (mostly) on the clock itself. The clock can be set while your partner is asleep, a tradional clock could be making noise. And, because of the smart features, you could for instance enable the heating in your home 15 minutes before the alarm sets off. Especially when your wake up schedule is not regular, this clock can make automations efficient by associating the triggers with your alarm time.

Features

  • Alarm based on time.
  • Different display modes so there is more or less light emitted by the clock.
  • Contrast based on day or night.
  • 4 Home Assistant integrated switches that switch based on the alarm time, alarm does not have to sound. These switches can be switched manually on the clock itself.
  • Customizable sleep timer.
  • Customizable snooze timer.
  • Online radio streams.
  • Decent sound.

See GitHub - Skons/SOAS: ESP32 Alarm clock with Home Assistant integration for more information

4 Likes

Changelog

2025.2.23.1

  • Multiple switches and numbers require time to be synced before their actions will take place, this makes sure settings will survive a reboot

  • Snooze and the sleep timer are more resillient when they miss their schedule due to a reboot

  • Multiple small bug fixes

2025.2.15.1

  • Playback will be restored after reboot

2025.2.14.1

  • Number cleanup

  • Switched to sliders instead of boxes for numbers

  • Alarm volume number is not internal anymore

2025.2.13.1

  • Initial commit

Just build this on a breadboard and it looks good.
Found 2 small errors:
In the esphome code: (alarm_on_after_reboot) can’t be found, removed the after_reboot part and it seems to be working

Latitude and Longitude should be like:

sun:
latitude: 48.8584°
longitude: 2.2945°

Documentation is updated

Thank you,
Played with it for a week and compliments for the number of functions it has. It takes some time to learn how to use them but then it works great.
I use a TTP223 touch button in the housing as a replacement for the standard button, the top looks cleaner that way.
Since it is also a media player in HA, you can use TTS which is nice.
Eric

1 Like

Thank you for your reply. Please let me if stuff is too complicated or if you are missing things :slight_smile:

I have been looking at tactile dip switches for the same reason as you, but i am already using the current one so there is no real need for me.

There is an update coming for the housing. I have been experimenting with an esp32-s3-devkitc-1 because of psram. Therefor the housing had to be altered. I took that chagen and created an inside that slides in the outer housing. It makes placing the components a lot easier, and if maintenance is needed, that is also a lot easier. So if you need to print, you can await that one.

1 Like

I’m using a Xiao ESP32-S3 for the same reasons of PSRAM. I mounted everything on a 5x7 centimeter prototype board and like you, it slides in and out of the housing. I’m creating my own housing so it is also a holder/charger for my e-reader.
Eric

@EnsconcE love this project!
Want to ditch my Echo Shows for a long time, and it seems I found a solution.

Just a few questions:

  • I have 3x AZ Delivery ESP-32 DevKit C v2 (38 pins and ESP32-WROOM-32) laying around. Does the fit in the current case?

  • Did you found a solution to an local alarm sound playback? I rather love a simple chilling sound to wake up, and also if it’s local, it doesn’t matter if internet is working or not

  • Because it’s an HA media player and @DieOuweGek already mentioned, TTS is working. Are there also Notifications on the display planned?

Thx a lot for your incredible work!

If the ESP-32 DevKit C v2’s will fit, i don’t know. I also just published an updated version that has been made suitable for ESP32-S3-N16R8. If your ESP32 does not have PSRAM, i would not advice to use it.

As for TTS, yes that works. And you can also stream music into, but the alarm itself has not been made to stream to, it is made to play a stream. So if you want to play your own music, there are ways to create your own music stream.

My mind is playing with an idea to display stream information instead of the date when its playing for the SH1107. But, that is not really something with notification. I was not planning to implement real notifications…

The only feature i really want to implement when it is available, or when somebody can tell me how, is to play a local file. So no, i have not found out local playback :frowning:

Helllo there,
Instead off a local sound on the device, you could place a file on the media player of HomeAssistant and play that with the automation you use with the alarm clock. Works without an internet connection. I use it with different music files depending on which child to wake-up:

action: media_player.play_media
metadata: {}
data:
media_content_id: media-source://media_source/local/your audio file.mp3
media_content_type: audio/mp3
target:
entity_id: media_player.123player
mode: single

I agree with EnsconcE, not to use an ESP32 without psram

Eric

Thanks guys for your answer.

Can you please post an link to the actual used module?
There are so many out there?
Also found one o amazon with ESP32-S3-N16R8 without mentoning an PSRAM.
Forget it, found your link on the main page, thx for that.

Nice that TTS works, currentl i use that heavily with alexa and i dont want to miss that.

With “Notifications” i am meant alexa “annoucements”, with this alexa is saying (tts) the text and displaying ti for about 30 seconds.
Like “Washing machine is ready!” or something like this.

Regarding local playback (with sounds baked into the firmware).
The examples are rare in the documentation: Speaker Audio Media Player — ESPHome

But i found something interessting here: Create audio clip files for use with I²S Speakers — ESPHome
This seems todo exactly what we want!

Maybe also something like this works (also untested):

api:
  services:
    - service: play_alarm
      then:
        - i2s_audio.play:
            file: "alarm.wav"

i2s_audio:
  id: i2s_out
  i2s_dout_pin: GPIO22
  i2s_bclk_pin: GPIO26
  i2s_lrclk_pin: GPIO25

media_player:
  - platform: i2s_audio
    name: "ESP32 Audio"

binary_sensor:
  ...

file: "alarm.wav" # must be placed in folder esphome/oderesphome/files/`

Currently have no device to play with :slight_smile:
Can anyone of you please try this?

I think a major feature of an alarm clock is local (on device) alarms if any of the behind tech is failing (wifi and/or ethernet componetns, ha, internet, …) there should be an fallback which just works or a feature to just set an local alarm (without any stream from ha or internet, thats i wanna use).

Thanks for this playing something drectly from HA, seems too be handy.
But as mentioned above, local (compiled in alarms) playback is a “must” feature for me (and i think others) incl. fallback when internet/ha is down.
Sadly, all of us have to go up for work/school in the morning :wink: :sweat_smile:

P.S.: @EnsconcE can you please post pictures from inside the device (have looked but havent found some).

Hi pOpY,
Here is a render from my case. I use a prototype board and it slides in the holder on the bottom. Same goes for the small speaker on the side.

I can only upload one image.

Eric

1 Like

thx a lot. Parts are ordered and 3x prints ar running…
Hope i can build this project soon.

Any chance to get local (in the firmware) stored alarm sounds?

Don’t forget there is also a V2 housing:

As for the stored alarm sounds. It’s not possible to do this for the media player, but it maybe could be done for the speaker as your post implies. I had spare parts ordered to do some development, because i do not want to kill my production instances for obvious reasons ;). I dont know when you will get an update in regards to that.

And for the Photo’s, i only have V2’s laying around, does that fit your need?

1 Like

Hi there,
Maybe the use of the DF-Player mini can help you with the local files. It’s ESPHome supported. DF-Player mini — ESPHome

Eric

1 Like

ok, thx. Take your time.
Will also try to build an clock when i get the parts.

Yes, V2 Photos would fit my needs.
But i have ordered/printed the parts from your last update a few days ago, so the case and orderer ESP should fit.

That’s a nice find!
But i think first there should be inbuilt (short) alarm sounds.

The problem with the DF-Player is that it needs a DAC voor volume adjustments. Afaik you cannot connect a ESP dac component with the left right speaker cables. And it seems dat analog is the only output of the DF-Player

This is my development clock. I hope this fits your needs

1 Like