Skip to content

randellmatt/internal_tone_generator

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

internal_tone_generator

What?

To enable a backup tone for the esp alarm clock developed at https://github.com/Skons/SOAS

Installation

install the components directory and its contents into /config/eshpome

add the below yaml entries to your existing yaml for your SOAS alarm

Usage

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.

Status

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);

About

an external component for the SOAS alarm clock that generates a single tone url stream in offline mode

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published