8000 GitHub - ulfalfa/sonos-tts: A homeassistant component for using sonos speakers as notify plattform · GitHub
[go: up one dir, main page]

Skip to content
ulfalfaPublic

About

A homeassistant component for using sonos speakers as notify plattform

Resources

Stars

4 stars

Watchers

3 watching

Forks

Latest commit

 

History

3 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sonos Notify component for homeassistant

What This Is:

This is a custom component to use sonos speakers with the notifier plattform of Homeassistant instead of writing custom scripts. E.g. it enables us to user the alert functionality

By the way: It is using the first tts plattform that is found - I'm currently using VOICERSS (and it's not tested with any other tts plattform)

Installation and Configuration

Use copy the repo to the custom_components folder of your config folder. See also [https://developers.home-assistant.io/docs/en/creating_component_loading.html]

Then edit your configuration and add notify entities to your configuration.yaml

notify:
  - name: Desk
    platform: sonos_tts
    entities: media_player.desk
    tts: google_translate
  - name: Bedroom
    platform: sonos_tts
    entities: media_player.bedroom
  - name: SomePlayers
    platform: sonos_tts
    entities:
      - media_player.desk
      - media_player.bedroom

Usage

Finally you can send notifications

# Example configuration.yaml entry
alert:
  garage_door:
    name: Garage is open
    done_message: Garage is closed
    entity_id: input_boolean.garage_door
    state: 'on'
    repeat: 30
    can_acknowledge: true
    skip_first: true
    notifiers:
      - desk

or you just send a notification in a script

....
    service: notify.someplayers
  
5C44
    data:
        volume_level: 0.5
      message: This is notification

Disclaimer

This is my first component for home assistant and even my first code written in python. So don't expect, that is all working and use it on your own risk.

Known Limitation(s)

  • When interrupting a single playing player, the pause notification comes to late and is interpreted, that the tts output is over and the old state is restored. This does not happen if using notification group or interrupting a joined player - I didn't figured out the problem yet.

About

A homeassistant component for using sonos speakers as notify plattform

Resources

Stars

4 stars

Watchers

3 watching

Forks

Releases

Packages

Contributors

Languages

0