我现在的思路是,,1、常规化的命令,如:打开某某设备,关闭某某设备,全部自己新建1个自动化意图,这样处理,很可靠,秒处理,很快很快,ai不管这么优化,很难做到100%可靠,如果后期ha内部中文意图完善了。我在暂停这个自动化意图,用系统内置的,这种命令的设备,一般的家庭也不多,最多也就20个左右,一般体现在灯、电视、空调,电风扇、窗帘等。2、复杂的命令,直接让ai集成处理,如:哪些灯是开着的,现在空调多少度,客厅温度多少,这种命令比较宽泛,就让ai集成智谱清言处理好了。
自动化意图的示例,一般0.1秒就处理了,你可以配置1个设备试下,说下命令,马上就反馈,体验比较好。
alias: 打开和关闭设备意图
description: ""
triggers:
- trigger: conversation
command:
- 打开(电视|客厅电视|空调|电风扇|窗帘|吊灯|筒灯|厨房灯|卫生间灯|书房灯|阳台灯|入户灯)
id: open
- trigger: conversation
command:
- 关闭(电视|客厅电视|空调|电风扇|窗帘|吊灯|筒灯|厨房灯|卫生间灯|书房灯|阳台灯|入户灯)
id: close
conditions: []
actions:
- alias: 打开设备意图
if:
- condition: trigger
id:
- open
then:
- if:
- condition: template
value_template: "{{ trigger.sentence in ("打开电视", "打开客厅电视")}}"
then:
- if:
- type: is_not_connected
condition: device
device_id: 07df812f488fc97948cb2f06f1923dfd
entity_id: 181c8dd54283152d56817940fd2b3648
domain: binary_sensor
then:
- action: script.1663328520990
metadata: {}
data: {}
- set_conversation_response: 客厅电视已打开
alias: 打开客厅电视
- if:
- condition: template
value_template: "{{ trigger.sentence=='打开厨房灯' }}"
then:
- if:
- condition: device
type: is_off
device_id: 264f69209f99770695f4f8b4371262f8
entity_id: 1d03ed53a167a83b7ee9322cc6bbb611
domain: light
then:
- action: light.turn_on
metadata: {}
data: {}
target:
entity_id: light.sonoff_minir4_chufang_lamp
- set_conversation_response: 厨房灯已打开
alias: 打开厨房灯
enabled: true
- alias: 关闭设备意图
if:
- condition: trigger
id:
- close
then:
- if:
- condition: template
value_template: "{{ trigger.sentence in ("关闭电视", "关闭客厅电视")}}"
then:
- if:
- type: is_connected
condition: device
device_id: 07df812f488fc97948cb2f06f1923dfd
entity_id: 181c8dd54283152d56817940fd2b3648
domain: binary_sensor
then:
- action: script.1663328520990
metadata: {}
data: {}
- set_conversation_response: 客厅电视已关闭
alias: 关闭客厅电视
- if:
- condition: template
value_template: "{{ trigger.sentence=='关闭厨房灯' }}"
then:
- if:
- condition: device
type: is_on
device_id: 264f69209f99770695f4f8b4371262f8
entity_id: 1d03ed53a167a83b7ee9322cc6bbb611
domain: light
then:
- action: light.turn_off
metadata: {}
data: {}
target:
entity_id: light.sonoff_minir4_chufang_lamp
- set_conversation_response: 厨房灯已关闭
alias: 关闭厨房灯
enabled: true
mode: single
|