which media player from your source support tts.google_say. click on the 3 dots from your media player you will see text to speech. if support then you can use that media player. check the name to of the media player in source to match the entity id. not every media_player you have support tts, so you have to check which one is support.
Mine I use his old speech_engine which i have to state the entity_id that match from input_select.
example:
input_select:
notification_media_player:
name: Source
icon: mdi:speaker
options:
- HA
- LG
initial: HA
example from my script speech_engine
speech_engine:
sequence:
- service: script.notification_hub
data_template:
media_player: >-
{% if states.input_select.notification_media_player.state == 'LG' %} <== this from input_select
media_player.lg_tv_remote <=== entity_id of my media_player
{% else %}
media_player.ha_speaker <=== default is this entity_id to be used from input_select is HA
{% endif %}
speech_message: >-
I’m looking for a strategy to move all my notifications (text and TTS) over to Janet and am wondering whether it is best to move all templates I currently have in automations and scripts entirely to Janet as skills or rather use the CustomMessage.
I have larger templates e.g. for looping over all entities in a battery_group to let me know of any batteries that are running low. Would I create a new skill like this in the janet_speech_engine script:
@geoffrey , thankyou for your feedback. As to your question, I think it would be great for the community if you’re willing to add your automations to the Janet Skills. This way everyone can benefit from the automations you made. If you’d like I can add you to the Github, so you can add these skills yourself.
I haven’t added new skills in a while already, but there is still much room for improvement. Your help would be greatly appreciated.
Some I put as custom message and some I put as call. I this it is depend, but both works.
The automation can make janet to inform you without asking in certain condition like event after work auotmation that Mr. Lentron has provided.
I have recently, use conversation to ask janet also, I feel like both way communication and I love it so much.
Then I just register telegram bot polly and since I have conversation added already. I can text via telegram bot to inform me the status of the house that I put in conversation.
I use this guide to communicate between telegram bot to home assistant to turn on-off light, switch whatever I want. This guide is so useful.
Extra automation skill to greet people that are back home.
- alias: Sun Greeting
trigger:
- platform: state
entity_id: device_tracker.suniphone
from: 'not_home'
to: 'home'
for: '00:01:00'
action:
- wait_template: >-
{{ not is_state('media_player.ha_speaker', 'playing') }}
- service: script.speech_engine
data_template:
personarriving: >
{% set person = "Sun" %} # original setting is to read from device_tracker. but mine device_tracker name is long and sound strange # {% set person = trigger.entity_id.split('.')[1]|replace('_', ' ')%}
{%- macro greeting_sentence(person) -%}
{{ [
"Welcome back home " ~ person,
"Guess who is home " ~ person + " is!",
person + " is now in the house.",
"Welcome Home " ~ person + ". We have missed you. Or at least I did.",
"Our home is now complete, Rest your head and relax your feet Welcome Back " ~ person,
"Life is like a song, you’re back where you belong, Welcome home " ~ person,
"Hey there " ~ person + " Welcome Home!",
"Knock Knock. Who is There " ~ person + " is!",
person ~ " You are home!",
"I know a secret " ~ person + " is home!"
] | random }}
{%- endmacro -%}
{{greeting_sentence(person)}}
call_no_announcement: 1
- alias: My Family Location
trigger:
- platform: state
entity_id: input_boolean.whoishome_status
from: 'off'
to: 'on'
action:
- wait_template: >-
{{ not is_state('media_player.ha_speaker', 'playing') }}
- service: script.speech_engine
data_template:
whoishome: >
{%- if is_state('device_tracker.suniphone', 'home') and is_state('device_tracker.dianaiphone', 'home') -%}
You are both home.
{%- else -%}
Diana is at {{ states("sensor.diana_open_street_map") }} and Sun is at {{ states("sensor.sun_open_street_map") }} .
{% endif %}
call_no_announcement: 1
call_bye: 1
- delay: 00:00:15
- service: input_boolean.turn_off
entity_id: input_boolean.whoishome_status
{%- macro security_check() -%}
S1C alarm status is {{ states('sensor.key_fob') }}. SSH alarm status is {{ states('alarm_control_panel.ssh') }}. Office camera motion status is {{ states('switch.office_camera_motion') }} and office camera record status is {{ states('switch.office_camera_alarm') }}.
{%- endmacro -%}
{% if call_security_check == 1 %}
{{ security_check() }}
{% endif %}
- alias: System Status
trigger:
- platform: state
entity_id: input_boolean.system_status
from: 'off'
to: 'on'
action:
- wait_template: >-
{{ not is_state('media_player.ha_speaker', 'playing') }}
- service: script.speech_engine
data:
call_greeting: 1
call_inform: 1
call_system_check: 1
call_no_announcement: 1
call_bye: 1
- delay: 00:00:15
- service: input_boolean.turn_off
entity_id: input_boolean.system_status
speech_engine
{%- macro system_check() -%}
CPU temperature is {{ states('sensor.cpu_temp') }} °C. Processor is running at {{ states('sensor.processor_use') }} %. Memory used is {{ states('sensor.memory_use_percent') }} %. Disk used is {{ states('sensor.disk_use_percent_') }} % and your last reboot is {{ states('sensor.ha_last_reboot') }}.
{%- endmacro -%}
{% if call_system_check == 1 %}
{{ system_check() }}
{% endif %}
- alias: Home Assistant Status
trigger:
- platform: state
entity_id: input_boolean.homeassistant_status
from: 'off'
to: 'on'
action:
- wait_template: >-
{{ not is_state('media_player.ha_speaker', 'playing') }}
- service: script.speech_engine
data:
call_greeting: 1
call_inform: 1
call_homeassistant_check: 1
call_no_announcement: 1
call_bye: 1
- delay: 00:00:15
- service: input_boolean.turn_off
entity_id: input_boolean.homeassistant_status
speech_engine
Home Assistant installed version is {{ states('sensor.installed_ha_version') }}. Database size is {{ states('sensor.ha_db_size') }} Megabytes. Uptime running is {{ states('sensor.ha_uptime') }}. SSL certificate is expiring in {{ states('sensor.ssl_cert_expiry') }} days and currently {{ states('sensor.connected_clients') }} clients are connected to Home Assistant.
{%- endmacro -%}
{% if call_homeassistant_check == 1 %}
{{ homeassistant_check() }}
{% endif %}