Janet (The Good Place)

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.

I love home assistant. Janet, conversation, telegram bot

3 Likes

@Sunonline do you have a github? I would like see yours configs.

Sorry. I don’t have or save anything on github.

But if you are interesting to use janet, conversation or telegram bot like the video. I can help with that ^^

So you can share with us janet.yaml? It was very cool.

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
1 Like

Extra automation to check my family location

  - 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

Extra automation to check alarm clock status. Most of the skill or in speech_engine which have to be add in.

  - 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   

in speech_engine

  {%- macro alarm_clock_check() -%}
    Alarm clock weekday status is {{ states('input_boolean.alarmclock_wd_enabled') }} at {{ states('sensor.alarmclock_wd_time_template') }} and alarm clock weekend status is {{ states('input_boolean.alarmclock_we_enabled') }} at {{ states('sensor.alarmclock_we_time_template') }}.
  {%- endmacro -%}

  {% if call_alarm_clock_check == 1 %}
    {{ alarm_clock_check() }}
  {% endif %}

Extra automation for security check

  - 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  

speech_engine

  {%- 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 %}

Extra automation for system check

  - 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 %}

Extra automation home assistant 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

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 %}

@Sunonline thanks friend.

Your welcome.

can u tell me more about that sensor open_street_map? how its configure?

I use this for open street map

1 Like

Hi

I tried following the guide and when I send a message to telegram saying “turn on heater” it says “ok turning on heater” but nothing happens.

I get an error saying: WARNING (MainThread) [homeassistant.core] Unable to find service sensor/turn_on

I am on polling method and I have also tried it with webhooks.

Can you share your configuration for telegram chat?

Do I have to write specific intents? or?

For telegram I use this guide. Once you know you can create your own text (not command) to home assistant, also conversation (shopping list).
For turn on and turn off you can you from the share project below.

For other than turn on/ turn off. I can give you example below.
########################################################
## Telegram Bot Polly ‘Bye’ to Janet ##
########################################################

##################################################
## Automation - Bye
##################################################

automation:
  - alias: "Telegram Bot Bye"
    trigger:
      platform: event
      event_type: telegram_text
      event_data:
        text: 'Bye'
    action:
      - service: conversation.process
        data_template:
          text: '{{ trigger.event.data.text }}' 
		  

##################################################
## conversation.yaml
##################################################		  
		  
conversation:
  intents:
    ByeIntent:
      - Bye
      - Thank you
      - Done
      - Finish
      - No thank you
	  
##################################################
## intent_script.yaml
##################################################		

intent_script:
  ByeIntent:
    speech:
      type: plain
      text: Good friends never say goodbye, they simply say see you soon!         
    action:     
      service: script.speech_engine
      data:
        call_bye: 1 	  
		
############################################################
## script.speech_engine (Janet) For Bye Macro and call_bye
############################################################	

            {%- macro bye() -%}
              {% set bye = [
                "How lucky I am to have something that makes saying Goodbye so hard. ",
                "Good friends never say goodbye, they simply say: see you soon! "
              ] %}
              {{ bye | random }}
            {%- endmacro -%} 		


            {% if call_bye == 1 %}
              {{ bye() }}
            {% endif %}

Turn on and turn off from telegram is call from the group you create to turn on and off. So check the devices in the group you want to turn on and off.

Hi
This is a great project
I am a newcomer
I tried to do and followed the steps above
But when I call the translation, the file sjon error
someone help me please

use call_greeting instead of Call_greeting

{
“call_greeting”: 1,
“call_introduction”: 1
}