2018-01-02 00:00:45 +00:00
|
|
|
#-------------------------------------------
|
|
|
|
# @CCOSTAN
|
|
|
|
# Original Repo : https://github.com/CCOSTAN/Home-AssistantConfig
|
|
|
|
#-------------------------------------------
|
|
|
|
homeassistant:
|
|
|
|
customize:
|
|
|
|
input_boolean.lastmsg:
|
|
|
|
friendly_name: 'Repeat Message'
|
|
|
|
icon: mdi:repeat-once
|
2024-07-24 05:48:36 +00:00
|
|
|
|
2018-01-02 00:00:45 +00:00
|
|
|
#-------------------------------------------
|
|
|
|
input_boolean:
|
|
|
|
lastmsg:
|
|
|
|
name: Last Message
|
|
|
|
initial: off
|
|
|
|
#-------------------------------------------
|
2024-07-24 05:48:36 +00:00
|
|
|
|
|
|
|
template:
|
|
|
|
- trigger:
|
|
|
|
platform: event
|
|
|
|
event_type: openai_instructions_sent
|
|
|
|
sensor:
|
2024-07-26 13:58:13 +00:00
|
|
|
- name: "openai_instructions"
|
|
|
|
unique_id: openai_instructions
|
|
|
|
state: "on"
|
2024-07-24 05:48:36 +00:00
|
|
|
attributes:
|
|
|
|
instructions: "{{ trigger.event.data.instructions }}"
|
|
|
|
|
|
|
|
- trigger:
|
|
|
|
platform: event
|
|
|
|
event_type: openai_response
|
|
|
|
sensor:
|
2024-07-26 13:58:13 +00:00
|
|
|
- name: "openai_response"
|
|
|
|
unique_id: openai_response
|
|
|
|
state: "on"
|
2024-07-24 05:48:36 +00:00
|
|
|
attributes:
|
|
|
|
response: "{{ trigger.event.data.response }}"
|
|
|
|
|
|
|
|
|
2018-01-02 00:00:45 +00:00
|
|
|
##############################################################################
|
|
|
|
### Automations -
|
|
|
|
##############################################################################
|
|
|
|
|
|
|
|
automation:
|
|
|
|
- alias: 'Repeat Last Message'
|
2020-07-20 18:33:03 +00:00
|
|
|
id: a57b487c-e7dd-440e-b78b-08704ded8458
|
2018-01-02 00:00:45 +00:00
|
|
|
|
|
|
|
trigger:
|
|
|
|
- platform: state
|
|
|
|
entity_id: input_boolean.lastmsg
|
|
|
|
to: 'on'
|
|
|
|
|
|
|
|
action:
|
2024-05-24 14:07:49 +00:00
|
|
|
- service: tts.cloud_say
|
2018-01-02 00:00:45 +00:00
|
|
|
entity_id:
|
|
|
|
- media_player.livingroomCC
|
2024-10-18 22:08:06 +00:00
|
|
|
# - media_player.entry_alarm_panel
|
|
|
|
# - media_player.bedroom_alarm_panel
|
2020-09-26 14:52:45 +00:00
|
|
|
data:
|
2024-05-24 14:07:49 +00:00
|
|
|
options:
|
|
|
|
voice: JennyNeural
|
|
|
|
message: >-
|
2024-07-26 13:58:13 +00:00
|
|
|
"{{ state_attr('sensor.openai_response', 'response') }}"
|
2024-05-24 14:07:49 +00:00
|
|
|
cache: false
|
2018-01-02 00:00:45 +00:00
|
|
|
|
|
|
|
- service: input_boolean.turn_off
|
|
|
|
entity_id:
|
|
|
|
- input_boolean.lastmsg
|
2024-05-24 14:07:49 +00:00
|
|
|
|