本帖最后由 aktifin 于 2017-6-16 09:38 编辑
群晖搭建的hass服务器,实现功能首先要基于以下几位大神的教程
1、安装虫子神写的百度TTS
https://bbs.hassbian.com/forum.php?mod=viewthread&tid=33&fromuid=45
2、虚拟黑群晖通过USB蓝牙适配器连接蓝牙音箱完美实现TTS
https://bbs.hassbian.com/forum.php?mod=viewthread&tid=351&fromuid=45
3、集成一些现有的小米网关的功能
https://bbs.hassbian.com/forum.php?mod=viewthread&tid=207&fromuid=45
4、【HomeAssistant】用了虫 子神写的和风天气插件的这里提供一...
https://bbs.hassbian.com/forum.php?mod=viewthread&tid=14&fromuid=45
在sensor.yaml加入如下代码,早晚定时播报天气,小米无线开关单击播报今天天气,双击播报明天天气
########天气提醒#######
- alias: say_weather
initial_state: true
hide_entity: True
trigger:
- platform: time
after: '07:05:00'
- platform: event
event_type: click
event_data:
entity_id: binary_sensor.switch_xxxxxxx
click_type: single
action:
- service: tts.baidu_say
data_template:
entity_id: media_player.mpd
message: >
"主人您好!现在天气{{states('sensor.now_weather')}},
温度是{{states('sensor.now_tmp')}}度,
最高温度{{states('sensor.today_maxtmp')}}度,
最低温度{{states('sensor.today_mintmp')}}度,
1小时内下雨概率为{{states('sensor.1hour_pop')}},
请主人注意调整衣物。
cache: false
########明天天气提醒#######
- alias: say_toweather
initial_state: true
hide_entity: True
trigger:
- platform: time
after: '19:05:00'
- platform: event
event_type: click
event_data:
entity_id: binary_sensor.switch_xxxxxxx
click_type: double
action:
- service: tts.baidu_say
data_template:
entity_id: media_player.mpd
message: >
"主人您好!明天天气{{states('sensor.tomorrowday_weather_day')}},
最高温度{{states('sensor.tomorrowday_maxtmp')}}度,
最低温度{{states('sensor.tomorrowday_mintmp')}}度,
下雨概率为{{states('sensor.tomorrowday_pop')}},
请主人注意调整衣物。
cache: false
|