To enable a backup tone for the esp alarm clock developed at https://github.com/Skons/SOAS
install the components directory and its contents into /config/eshpome
add the below yaml entries to your existing yaml for your SOAS alarm
A Test internal tone feature will be exposed to home assistant. You can use this and the tone slider to test this internal_tone_generator idea out.
This is very much in early development and used to test the idea of internally generating a backup stream url. The idea to play synthetically generated musical tunes the same way you would with a RTTL buzzer.
So far the text button works, but I haven't implemented playing the tone as a music or alarm stream.
# Import the external component
external_components:
- source:
type: local
path: components
components: [ internal_tone_generator ]
# Create the tone generator component - FIXED SYNTAX
internal_tone_generator:
id: backup_tone_gen
frequency: 800
# Test switch
switch:
- platform: template
name: "Test Internal Tone"
id: test_internal_tone
icon: "mdi:volume-high"
lambda: |-
return id(backup_tone_gen).is_playing();
turn_on_action:
- lambda: |-
id(backup_tone_gen).start_tone();
turn_off_action:
- lambda: |-
id(backup_tone_gen).stop_tone();
# Frequency control
number:
- platform: template
name: "Internal Tone Frequency"
id: internal_tone_frequency
optimistic: true
min_value: 200
max_value: 2000
step: 25
initial_value: 800
restore_value: true
unit_of_measurement: "Hz"
device_class: frequency
on_value:
then:
- lambda: |-
id(backup_tone_gen).set_frequency(x);