2019-07-12 20:32:25 +00:00
|
|
|
|
###############################################################################
|
|
|
|
|
# @author : Jeffrey Stone
|
|
|
|
|
# @date : 07/09/2019
|
|
|
|
|
# @package : Jarvis
|
2019-11-10 00:16:53 +00:00
|
|
|
|
# @description : Bringing some Jarvis to Home Assistant
|
2019-07-12 20:32:25 +00:00
|
|
|
|
###############################################################################
|
|
|
|
|
|
2019-11-10 00:16:53 +00:00
|
|
|
|
input_boolean:
|
2021-05-24 15:55:52 +00:00
|
|
|
|
house_party_protocol_switch:
|
|
|
|
|
name: House Party Switch
|
2019-07-16 01:40:39 +00:00
|
|
|
|
|
2019-11-10 00:16:53 +00:00
|
|
|
|
automation:
|
|
|
|
|
- id: house_party_protocol_on
|
|
|
|
|
alias: Turn On House Party Protocol
|
|
|
|
|
initial_state: true
|
|
|
|
|
trigger:
|
|
|
|
|
- platform: state
|
2021-05-24 15:55:52 +00:00
|
|
|
|
entity_id: input_boolean.house_party_protocol_switch
|
2019-11-10 00:16:53 +00:00
|
|
|
|
to: 'on'
|
|
|
|
|
action:
|
2019-11-22 02:32:19 +00:00
|
|
|
|
- service: homeassistant.turn_on
|
|
|
|
|
entity_id: group.incense
|
2021-05-24 15:55:52 +00:00
|
|
|
|
- delay: 00:00:05
|
|
|
|
|
- service: script.status_annc
|
2019-11-22 02:32:19 +00:00
|
|
|
|
data_template:
|
2021-05-24 15:55:52 +00:00
|
|
|
|
who: '{{ states.sensor.room_presence.state }}'
|
|
|
|
|
call_house_party_protocol_enabled: 1
|
2019-11-10 00:16:53 +00:00
|
|
|
|
|
|
|
|
|
- id: house_party_protocol_off
|
|
|
|
|
alias: Turn Off House Party Protocol
|
|
|
|
|
initial_state: true
|
|
|
|
|
trigger:
|
|
|
|
|
- platform: state
|
2021-05-24 15:55:52 +00:00
|
|
|
|
entity_id: input_boolean.house_party_protocol_switch
|
2019-11-10 00:16:53 +00:00
|
|
|
|
to: 'off'
|
|
|
|
|
action:
|
2019-11-22 02:32:19 +00:00
|
|
|
|
- service: homeassistant.turn_off
|
2019-11-10 00:16:53 +00:00
|
|
|
|
entity_id: group.incense
|
2021-05-24 15:55:52 +00:00
|
|
|
|
- delay: 00:00:05
|
|
|
|
|
- service: script.status_annc
|
2019-11-10 00:16:53 +00:00
|
|
|
|
data_template:
|
2021-05-24 15:55:52 +00:00
|
|
|
|
who: '{{ states.sensor.room_presence.state }}'
|
|
|
|
|
call_house_party_protocol_disabled: 1
|
2020-12-03 05:11:42 +00:00
|
|
|
|
|
2021-05-24 15:55:52 +00:00
|
|
|
|
script:
|
2021-10-17 15:19:07 +00:00
|
|
|
|
|
|
|
|
|
# To Use:
|
|
|
|
|
# service: script.amp_voice
|
|
|
|
|
# Data
|
|
|
|
|
# who: media_player_ha_speaker
|
|
|
|
|
# #who: “{{ states(‘sensor.room_presence’) }}”
|
|
|
|
|
# message: something to say
|
|
|
|
|
#
|
|
|
|
|
amp_voice:
|
|
|
|
|
sequence:
|
|
|
|
|
- service: media_player.turn_on
|
|
|
|
|
data_template:
|
|
|
|
|
entity_id: >
|
|
|
|
|
{{ who }}
|
|
|
|
|
- service: script.dim_main_volume
|
|
|
|
|
- service: media_player.volume_set
|
|
|
|
|
data_template:
|
|
|
|
|
entity_id: >
|
|
|
|
|
{{ who }}
|
|
|
|
|
volume_level: >
|
|
|
|
|
{% if is_state('input_boolean.audible_notifications.state','on') %}
|
|
|
|
|
.6
|
|
|
|
|
{% else %}
|
|
|
|
|
.4
|
|
|
|
|
{% endif %}
|
|
|
|
|
- service: >
|
|
|
|
|
{{ who }}
|
|
|
|
|
data:
|
|
|
|
|
message: >
|
|
|
|
|
{{ message }}
|
|
|
|
|
data:
|
|
|
|
|
type: tts
|
|
|
|
|
- delay: 00:00:20
|
|
|
|
|
- service: script.raise_main_volume
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# To Use:
|
|
|
|
|
# service: script.polly_voice
|
|
|
|
|
# Data
|
|
|
|
|
# who: media_player_ha_speaker
|
|
|
|
|
# #who: “{{ states(‘sensor.room_presence’) }}”
|
|
|
|
|
# message: something to say
|
|
|
|
|
#
|
|
|
|
|
polly_voice:
|
|
|
|
|
sequence:
|
|
|
|
|
- service: media_player.turn_on
|
|
|
|
|
data_template:
|
|
|
|
|
entity_id: >
|
|
|
|
|
{{ who }}
|
|
|
|
|
- service: media_player.volume_set
|
|
|
|
|
data_template:
|
|
|
|
|
entity_id: >
|
|
|
|
|
{{ who }}
|
|
|
|
|
volume_level: >
|
|
|
|
|
{% if states.input_boolean.audible_notifications.state == 'on' %}
|
|
|
|
|
.7
|
|
|
|
|
{% else %}
|
|
|
|
|
.4
|
|
|
|
|
{% endif %}
|
|
|
|
|
- service: tts.amazon_polly_say
|
|
|
|
|
data_template:
|
|
|
|
|
entity_id: >
|
|
|
|
|
{{ who }}
|
|
|
|
|
message: >-
|
|
|
|
|
<speak>
|
|
|
|
|
<break time="1s"/>
|
|
|
|
|
{{ message }}
|
|
|
|
|
</speak>
|
|
|
|
|
cache: true
|
|
|
|
|
|
2021-05-24 15:55:52 +00:00
|
|
|
|
|
|
|
|
|
alexa_interjection:
|
|
|
|
|
sequence:
|
|
|
|
|
- service: script.status_annc
|
|
|
|
|
data:
|
|
|
|
|
who: '{{ states.sensor.alexa_audio.state}}'
|
|
|
|
|
call_interuption: 1
|
|
|
|
|
|
|
|
|
|
google_interjection:
|
|
|
|
|
sequence:
|
|
|
|
|
- service: script.status_annc
|
|
|
|
|
data:
|
|
|
|
|
who: '{{ states.sensor.room_audio.state }}'
|
|
|
|
|
call_interuption: 1
|
|
|
|
|
|
|
|
|
|
|