Janet (The Good Place)

Without your config, cannot help. There is automation of Start Up. Did you test with that?

automation:
##############################################################################

New Device has connected to the network. let everyone know.

##############################################################################

  • alias: “New device connected”
    trigger:

    • platform: event
      event_type: device_tracker_new_device

    action:

    • service: input_boolean.turn_on
      data:
      entity_id: input_boolean.janet_alert_mode

    • service: script.janet_speech_engine
      data:
      call_greeting: 1
      call_new_device: 1
      data_template:
      person: >-
      {{ trigger.event.data.name }}
      ##############################################################################

  • alias: Shut Down
    trigger:

    • event: shutdown
      platform: homeassistant
    • event_type: homeassistant.restart
      platform: event
      action:
    • service: script.janet_speech_engine
      data:
      call_bye: 1
      call_shut_down: 1
  • alias: Start Up
    trigger:

    • event: start
      platform: homeassistant

    action:

    • service: script.janet_speech_engine
      data:
      call_greeting: 1
      call_introduction: 1
  • alias: Janet Update Available
    trigger:

    • platform: state
      entity_id: sensor.up_to_date
      from: ‘true’
      to: ‘false’

    action:

    • service: script.janet_speech_engine
      data:
      call_greeting: 1
      call_update: 1
  • alias: Sun Greeting
    trigger:

    • platform: state
      entity_id: device_tracker.nhatphat
      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 = “nhatphat” %} # 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.nhatphat’, ‘home’) and is_state(‘device_tracker.android-5c97158ebdea56c2.net.fpt’, ‘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
  • alias: Alarm Clock Status
    trigger:

    • platform: state
      entity_id: input_boolean.alarm_clock_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_alarm_clock_check: 1
      call_no_announcement: 1
      call_bye: 1
    • delay: 00:00:15
    • service: input_boolean.turn_off
      entity_id: input_boolean.alarm_clock_status
  • alias: Security Status
    trigger:

    • platform: state
      entity_id: input_boolean.security_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_security_check: 1
      call_no_announcement: 1
      call_bye: 1
    • delay: 00:00:15
    • service: input_boolean.turn_off
      entity_id: input_boolean.security_status
  • 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
  • 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

That is my automation file

Is the configuration.yaml file not you?

in configuration.yaml

automation:         
  - alias: Start Up
    trigger:
      - event: start
        platform: homeassistant    
    action:
      - delay:
          minutes: 1  
      - service: script.janet_speech_engine
        data:
          call_greeting: 1
          call_introduction: 1 

put only one to test that it works. after put this check config and restart your home assistant. Janet will not speak if you put name of your media player wrongly. so check your media player as well.

I tried as you said and added to my configuration
The file you gave and restarted did not say anything
and I added input_select:
janet_notification_media_player:
name: Source
icon: mdi: speaker
options:
- “Google_Assistant”
- “HA”
- “Living Room TV 2”
- “livingroomcc”
- “whole_house”
- “living_room_tv”
- “living_room_ultra”
- “upstairs_living_room”
- “alarm_clock”
- “bedroom_alarm_panel”
initial: “Google_Assistant”

and restart
janet still says
And I’m getting the call of the still-invalid json file

show me your config of media player which support tts. Also change your google tts language to ‘en-us’

media_player:

  • platform: cast
    host: 192.168.1.127 #CCA1

You use team viewer

media_player:

platform: cast
host: 192.168.1.127 # CCA1
in my configuration file

So check the entity_id of this media player and put in Janet.

input_select:
  janet_notification_media_player:
    name: Source
    icon: mdi:speaker
    options:
      - Cast #name of your media player
      - HA
    initial: HA

speech_engine:
  sequence:      
    - service: script.notification_hub
      data_template:
        media_player: >-
          {% if states.input_select.notification_media_player.state == 'Cast' %}  <== this from input_select
             media_player.cast  <=== entity_id of your media_player
          {% else %}
             media_player.ha_speaker  <=== default is this entity_id to be used from input_select is HA
          {% endif %}

Hello
I have done and follow you your guide
I changed and checked the configuration and restarted the hassio
still does not say anything and the call still says json is invalid

You have to pasted your config in right format with </>. Now janet should be no problem with the yaml file. But wrong with the media player not match what you have. So there is no sound.

Text to speech

tts:

  • platform: google
    language: ‘en-us’
  • platform: amazon_polly
    aws_access_key_id: AKIAIXCZW3FLI4OZNAZA
    aws_secret_access_key: 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
    region_name: ‘us-east-1’
    text_type: ssml
    cache: True

cache_dir: /data/tts

#input_number: !include input_number.yaml
input_number: !include_dir_named input_number/

#input_select: !include input_select.yaml
input_select: !include_dir_named input_select/

####################

#intent_script: !include intent_scripts.yaml
intent_script: !include_dir_named intent_scripts/

automation:

  • alias: Start Up
    trigger:
    • event: start
      platform: homeassistant
      action:
    • delay:
      minutes: 1
    • service: script.janet_speech_engine
      data:
      call_greeting: 1
      call_introduction: 1

wake_on_lan:
mac_address: “48:5a:b6:aa:ed:10”

hassio:

ios:

push: !include ios_push.yaml

media_player:

  • platform: cast
    host: 192.168.1.127 #CCA1

panel_custom:

  • name: floorplan
    sidebar_title: Alarm Panel
    sidebar_icon: mdi:security-home
    url_path: floorplan
    config:
    hide_app_toolbar:
    config: /local/custom_ui/floorplan/floorplan.yaml

  • name: clock
    sidebar_title: Alarm Clock
    sidebar_icon: mdi:alarm
    url_path: clock
    config:
    hide_app_toolbar:
    config: /local/custom_ui/floorplan/floorclock.yaml

group: !include_dir_merge_named group
device_tracker: !include_dir_merge_list device_tracker
automation: !include_dir_merge_list automation
sensor: !include_dir_merge_list sensor
scene: !include_dir_merge_list scene
switch: !include_dir_merge_list switch
script: !include_dir_merge_named script
input_boolean: !include_dir_merge_named input_boolean
shell_command: !include_dir_merge_named shell_command
alexa: !include alexa.yaml
google_assistant: !include google_assistant.yaml
#history_graph: !include history_graph.yaml
dialogflow:

climate: !include_dir_merge_list climate
google_assistant: !include_dir_merge_named google_assistant

notify: !include notify.yaml

Pasted me janet.yaml and your media player config in right format </>

input_select:
janet_notification_media_player:
name: Source
icon: mdi:speaker
options:
- “Google_Assistant”
- “HA”
- “Living Room TV 2”
- “livingroomcc”
- Cast #name of your media player
- “whole_house”
- “living_room_tv”
- “living_room_ultra”
- “upstairs_living_room”
- “alarm_clock”
- “bedroom_alarm_panel”
initial: “Google_Assistant”