这是我的一个门铃自动化,使用小米官方插件,来触发小爱音箱TTS,你可以参考下
alias: 门铃
description: ""
triggers:
- domain: mqtt
device_id: 21141*******d286386b60c14(一个涂鸦的无线开关)
type: action
subtype: single
trigger: device
conditions: []
actions:
- target:
entity_id: media_player.phicomm_r1_******(你的斐讯R1音箱实体)
data:
media_content_id: media-source://media_source/local/敲门铃声.mp3(斐讯R1播放音频文件)
media_content_type: audio/mpeg
metadata:
title: 敲门铃声.mp3
thumbnail: null
media_class: music
children_media_class: null
navigateIds:
- {}
- media_content_type: app
media_content_id: media-source://media_source
action: media_player.play_media
- action: notify.send_message
target:
entity_id: notify.xiaomi_cn_********_play_text_a_7_3(你的小爱音箱实体)
data:
message: "["叮咚!叮咚!有人在敲门!有人在敲门!"]"
- data:
topic: mipad
payload: "on"
qos: 0
action: mqtt.publish
mode: single
|