本帖最后由 花蟋蟀 于 2018-12-10 23:59 编辑
前言:需要配置time 传感器 方法看 3楼
【简单粗暴】
group:
automation_all_tts: # Tab页 自动化 中group
name: 语音提醒
view: no
icon: mdi:fingerprint
entities:
- automation.say_time # 自动化:整点7至21语音报时(有人在家)
#####################################################################################
homeassistant:
customize:
automation.say_time:
friendly_name: 整点7至21语音报时(有人在家)
homebridge_hidden: true
icon: mdi:home-assistant
#####################################################################################
automation:
##整点自动报时
- alias: say_time
#initial_state: true
trigger:
- platform: time
hours: '/1'
minutes: 0
seconds: 0
condition:
condition: and
conditions:
- condition: or
conditions:
- condition: state
entity_id: device_tracker.XXX #此处使用路由器追踪或者app定位等都可
state: 'home'
- condition: state
entity_id: device_tracker.XXX
state: 'home'
- condition: state
entity_id: device_tracker.XXX
state: 'home'
- condition: state
entity_id: device_tracker.XXX
state: 'home'
- condition: time #此时段内播报
after: '07:00:00'
before: '21:00:00'
action:
- service: tts.baidu_say #有什么TTS就用什么TTS
data_template:
entity_id: media_player.mpd #播放器随便,小爱推送等都可以
message: >
"现在时间{{states('sensor.time')}}"
可复制上面自己保存,可下载下面的直接放入packages文件夹下
|