script
morningreport:
sequence:
- service: tts.baidu_say
data_template:
entity_id: media_player.livingroom
message: >
早上好!今天是{{states('sensor.laohuangli')}},现在天气{{states('sensor.today_weather_day')}},今天{{states('sensor.today_mintmp')}}到{{states('sensor.today_maxtmp')}}度,9小时内下雨概率为百分之{{states('sensor.9hour_pop')}},现在去华林大厦路况
{{states.sensor.traffic_home_to_office.attributes.路况}},预计需要{{states.sensor.traffic_home_to_office.state}}分钟
automation
- alias: goodmorning
trigger:
platform: state
entity_id: binary_sensor.roomcheck
to: 'on'
condition:
condition: and
conditions:
- condition: time
after: '06:30:00'
before: '09:00:00'
- condition: state
entity_id: sensor.holiday
state: '工作日'
action:
- service: media_player.sonos_snapshot
- service: script.say_news
- service: switch.turn_on
entity_id: switch.tv
- delay: 00:00:20
- service: media_player.sonos_restore
- service: script.tvtojidinghe
- service: automation.turn_off
entity_id: automation.goodmorningdatou
怕是看了也没啥用 各种调用 |