mirror of
https://github.com/smkrv/ha-text-ai.git
synced 2026-07-22 07:03:58 +08:00
Update ha_text_ai_request.yaml
This commit is contained in:
@@ -4,11 +4,64 @@ blueprint:
|
|||||||
domain: automation
|
domain: automation
|
||||||
source_url: https://github.com/smkrv/ha-text-ai/blob/main/blueprints/automation/ha_text_ai_request.yaml
|
source_url: https://github.com/smkrv/ha-text-ai/blob/main/blueprints/automation/ha_text_ai_request.yaml
|
||||||
input:
|
input:
|
||||||
|
trigger_type:
|
||||||
|
name: Trigger Type
|
||||||
|
description: Select the type of trigger for automation
|
||||||
|
default: state
|
||||||
|
selector:
|
||||||
|
select:
|
||||||
|
options:
|
||||||
|
- state
|
||||||
|
- numeric_state
|
||||||
|
- time
|
||||||
|
- template
|
||||||
trigger_entity:
|
trigger_entity:
|
||||||
name: Trigger Entity
|
name: Trigger Entity
|
||||||
description: Entity that will trigger this automation
|
description: Entity that will trigger this automation
|
||||||
selector:
|
selector:
|
||||||
entity: {}
|
entity: {}
|
||||||
|
state_from:
|
||||||
|
name: From State
|
||||||
|
description: Optional 'from state' condition (for state trigger)
|
||||||
|
default: ""
|
||||||
|
selector:
|
||||||
|
text:
|
||||||
|
required: false
|
||||||
|
state_to:
|
||||||
|
name: To State
|
||||||
|
description: Optional 'to state' condition (for state trigger)
|
||||||
|
default: ""
|
||||||
|
selector:
|
||||||
|
text:
|
||||||
|
required: false
|
||||||
|
numeric_above:
|
||||||
|
name: Above Value
|
||||||
|
description: Trigger when numeric value is above (for numeric state)
|
||||||
|
required: false
|
||||||
|
selector:
|
||||||
|
number:
|
||||||
|
mode: box
|
||||||
|
step: 0.1
|
||||||
|
numeric_below:
|
||||||
|
name: Below Value
|
||||||
|
description: Trigger when numeric value is below (for numeric state)
|
||||||
|
required: false
|
||||||
|
selector:
|
||||||
|
number:
|
||||||
|
mode: box
|
||||||
|
step: 0.1
|
||||||
|
time_at:
|
||||||
|
name: Time
|
||||||
|
description: Time for the trigger (for time trigger)
|
||||||
|
required: false
|
||||||
|
selector:
|
||||||
|
time: {}
|
||||||
|
template_value:
|
||||||
|
name: Template
|
||||||
|
description: Template condition (for template trigger)
|
||||||
|
required: false
|
||||||
|
selector:
|
||||||
|
template: {}
|
||||||
prompt_template:
|
prompt_template:
|
||||||
name: Prompt Template
|
name: Prompt Template
|
||||||
description: Template for the prompt. You can use template syntax, e.g., {{ states('sensor.temperature') }}
|
description: Template for the prompt. You can use template syntax, e.g., {{ states('sensor.temperature') }}
|
||||||
@@ -25,7 +78,11 @@ blueprint:
|
|||||||
description: The AI model to use for generation
|
description: The AI model to use for generation
|
||||||
default: gpt-3.5-turbo
|
default: gpt-3.5-turbo
|
||||||
selector:
|
selector:
|
||||||
text:
|
select:
|
||||||
|
options:
|
||||||
|
- gpt-4
|
||||||
|
- gpt-3.5-turbo
|
||||||
|
- gpt-3.5-turbo-16k
|
||||||
temperature:
|
temperature:
|
||||||
name: Temperature
|
name: Temperature
|
||||||
description: Controls randomness in the response (0-2)
|
description: Controls randomness in the response (0-2)
|
||||||
@@ -80,8 +137,35 @@ mode: queued
|
|||||||
max_exceeded: silent
|
max_exceeded: silent
|
||||||
|
|
||||||
trigger:
|
trigger:
|
||||||
- platform: state
|
- choose:
|
||||||
entity_id: !input trigger_entity
|
- conditions:
|
||||||
|
- condition: template
|
||||||
|
value_template: "{{ trigger_type == 'state' }}"
|
||||||
|
sequence:
|
||||||
|
- platform: state
|
||||||
|
entity_id: !input trigger_entity
|
||||||
|
from: !input state_from
|
||||||
|
to: !input state_to
|
||||||
|
- conditions:
|
||||||
|
- condition: template
|
||||||
|
value_template: "{{ trigger_type == 'numeric_state' }}"
|
||||||
|
sequence:
|
||||||
|
- platform: numeric_state
|
||||||
|
entity_id: !input trigger_entity
|
||||||
|
above: !input numeric_above
|
||||||
|
below: !input numeric_below
|
||||||
|
- conditions:
|
||||||
|
- condition: template
|
||||||
|
value_template: "{{ trigger_type == 'time' }}"
|
||||||
|
sequence:
|
||||||
|
- platform: time
|
||||||
|
at: !input time_at
|
||||||
|
- conditions:
|
||||||
|
- condition: template
|
||||||
|
value_template: "{{ trigger_type == 'template' }}"
|
||||||
|
sequence:
|
||||||
|
- platform: template
|
||||||
|
value_template: !input template_value
|
||||||
|
|
||||||
variables:
|
variables:
|
||||||
prompt_template: !input prompt_template
|
prompt_template: !input prompt_template
|
||||||
|
|||||||
Reference in New Issue
Block a user