Skip to content
caiosweet edited this page Mar 6, 2023 · 93 revisions

Welcome to the Centro Notifiche wiki. Please feel free to make any changes you want and put it out.

Index

 

What This Is

Notification Center is a package for Home Assistant, which works together with the Notifier App in AppDaemon.

 

What It Does

It is used to send, in one place, text messages (Telegram, Push...), TTS Google and Alexa, Voip notifications to you and/or your devices such as Pcs, smartphones, pads, etc.

 

How this works

In summary, you send notifications with the script service ( script.my_notify ) via variables. The script creates an event in Home Assistant, with the name " notifier " and with all the data set in the variables. Appdaemon’s Notifier application, which listens to the notifier event, distributes text, audio, and persistent notifications on the various devices based on the received data. The package must be configured with the secret file, essential to get the right information and avoid continuous changes in case of future updates.

 

Requirements

Before installing this package, you must install the following requirements.

 

Installation

  1. Download the last release from the release page.
    • Initialize the download by clicking on the "Source code(zip)" link at the bottom of the page.
  2. Unzip the file you downloaded wherever you prefer.
  3. Copy the packages folder to the Home Assistant configuration folder (usually /config/).
  4. Compile the secret file with your data.
  5. Restart Home Assistant.
  6. Configure your Lovelace GUI. Here some examples and here my configuration in yaml mode.

 

In the package folder, you will find all the files you need for the Notification Center to work properly.

.
└── addons/
└── backup/
├── config/
│   │
│   ├── packages/
│   │   └── centro_notifiche/
│   │       ├── hub_main.yaml
│   │       ├── hub_alexa.yaml
│   │       ├── hub_google.yaml
│   │       └── hub_build_message.yml # <-- DO NOT MODIFY THE .yml EXTENSION
│   │
│   ├── home-assistant.log
│   └── secrets.yaml
└── share/
└── ssl/

The file secrets.yaml must be created in your Home Assistant configuration directory, if you don’t already have one.

Here are the entries related to the entities present in the package. How to compile the Secrets file

 

This is the main file needed to create the notifier event via the my_notify script ( script.my_notify ). Contains numerous entities, from sensors to calculate the time of day, to the sensor for DND (Do Not Disturb), to the various switches to control priority of messages, text, tts, holidays and more.

To know all the package entities, use this jinja code in dev-tools templates - Click to expand
{% for state in states if 'package' in state.attributes -%}
{% if 'centro notifiche' in state.attributes.package|lower %}
- {{ state.entity_id -}}
{% endif %}
{%- endfor %}
Jinja code to show all HubMain entities - Click to expand
{% for state in states if 'package' in state.attributes -%}
{% if 'centro notifiche' in state.attributes.package|lower
  and 'main' in state.attributes.version|lower %}
- {{ state.entity_id -}}
{% endif %}
{%- endfor %}

 

This file contains all the entities used for Alexa. If you don’t have any Amazon Alexa devices, you can delete it, saving useless entities in the system.

Jinja code to show all HubAlexa entities - Click to expand
{% for state in states if 'package' in state.attributes -%}
{% if 'centro notifiche' in state.attributes.package|lower
  and 'alexa' in state.attributes.version|lower %}
- {{ state.entity_id -}}
{% endif %}
{%- endfor %}

 

This file contains all entities used for Google. If you don’t have any Google devices, you can delete it, saving useless entities in the system.

Jinja code to show all HubGoogle entities - Click to expand
{% for state in states if 'package' in state.attributes -%}
{% if 'centro notifiche' in state.attributes.package|lower
  and 'google' in state.attributes.version|lower %}
- {{ state.entity_id -}}
{% endif %}
{%- endfor %}

 

Some Examples - Click to expand

Credits for inspiration and mechanism

Janet (The Good Place) (@Lentron)

Speech Engine (@CCOSTAN)

Notifications (@mf-social)

Notification Center (@3vasi0n89)

my-home-automation (@happyleavesaoc)

 

service: script.my_notify
data:
  <parameter>

Below the data: we will enter all the parameters that relate to our notification, including the actual message, if we do not enter any parameter but only the message the notification center will use all the default settings that we have set in the frontend. I'll leave you a list Complete with the parameters and their operation

Always remember that these options override those set by default.

 

N.B. Valid boolean value can be 1, True, On, Yes or 0, False, Off, No, even in lowercase letters.

Name Type Default Description
title string None Title for text notifications
message string Greeting Message to be sent. Including build message template.
target - None Not yet implemented :-/
called_number string default Telephone number for DssVoip or username/number for CallMeBot.
caption string Message Comment accompanying an image. If missing, message is used.
html bool False True, format text in HTML instead of markdown.
image string None The local path of an image to attach to the notification or a url.
link string None A web address to attach to the text notification. Will not be considered by TTS.
location string None Send notification only if you are at home (home) or away (not_home).
no_show bool False True, disables persistent notification.
notify bool/string default The notify service to send the notification. Multiple notification service is allowed, comma-separated. False not to send.
priority bool False True, by-pass DND (do not disturb).
alexa bool/dict None True, enable Alexa and send the main message. Other parameters see below in dictionary mode.
google bool/dict None True, enable Google and send the main message. Other parameters see below in dictionary mode.
discord dict None All data under Discord.
mobile dict None All data under Mobile App.
pushover dict None All data under Pushover.
telegram dict None All data under Telegram.
whatsapp dict None All data under Whatsapp addon (whatsapp.send_message).

 

Name Type Default Description
message string Main message You can also use message, overwrites the main message anyway and does not pass to the build message template.
media_player string/list group entity_id, friendly_name or both, for media player, sensor or group. (comma separated list)
volume float 0.1 Set the volume to a value between 0 and 1 (e.g. 0.3)
method string all all, speak.
type string tts tts, announce, push, dropin_notification or dropin, it's the same.
title string Main title Title for the push service (not valid for dropin notification).
push bool False Send a push notification in addition to the tts message.
wait_time float 3.0 Estimated time to finish the message before moving on to the next. Value expressed in seconds (e.g. -2 or 8).
ssml bool off By-pass switch SSML mode. (see Alexa SSML options)
notifier string alexa_media Alexa services.
media_content_id string None Ex. amzn_sfx_doorbell_chime_01, Alexa. GoodMorning. Play...
media_content_type string None sound, sequence, image, TUNEIN, AMAZON_MUSIC, SPOTIFY, APPLE_MUSIC...
mode bool False Useful to use as a switch with templates.
priority bool False By-pass Alexa switch and dnd.
event_id string None Alexa Actions custom skill.

Alexa SSML options

Options Type Default Description
audio string None Audio file to play.
language string it-IT The format is xx-XX (e.g. en-GB) see supported language table.
pitch float 0.0 Raise or lower the tone (pitch) of the speech. min value -33.3 max 50.
rate float 100 Modify the rate of the speech. min value 20 max 200.
ssml_volume float 0.0 Change the volume for the speech. min value -50 max 4.08.
voice string Alexa Speak the text with the specified Amazon Polly voice. See supported voice-id table.
whisper bool False If true, applies a whispering effect to the speech.

Alexa supported language and Voice

Table - Click to expand
Language Code Voice-id
Italian it-IT Carla, Giorgio, Bianca
English US en-US Ivy, Joanna, Joey, Justin, Kendra, Kimberly, Matthew, Salli,
English Canada en-CA
English Australia en-AU Nicole, Russell,
English UK en-GB Amy, Brian, Emma,
English India en-IN Aditi, Raveena,
French France fr-CA Chantal,
French Canada fr-FR Celine, Lea, Mathieu,
German de-DE Hans, Marlene, Vicki,
Hindi hi-IN Aditi,
Japanese ja-JP Mizuki, Takumi,
Portuguese Brazilian pt-BR Vitoria, Camila, Ricardo,
Spanish US es-US Penelope, Lupe, Miguel,
Spanish Spain es-ES Conchita, Enrique, Lucia,
Spanish Mexico es-MX Mia

See Examples Alexa

 

Name Type Default Description
message string Main Message Alternative message to the main one
media_player string/list selected entity_id comma separated list.
volume float None Volume with a value between 0 to 1 (e.g. 0.9)
media_content_id float None xxxxxxx
media_content_type string None xxxxxxx
mode bool Optional Useful to use as a switch with templates.
priority bool False By-pass Alexa switch and dnd.

See Examples Google

 

License

MIT

N|Solid

Clone this wiki locally