|
我截图的这个表在HA里面已经加入到能源里面了
请问我如何把某个数据源(某个电表)的昨天的用电度数调用然后用tts来播报
比如下面的代码我已经成功的用小度音箱来在洗澡的时候播放第二天的温度和天气等。这些数据都是采用了
states 和 steats.xxxxxid.attributes来调用
我都掌握了调用他们并且组合用来播报的能力
- if:
- condition: time
after: "15:00:00"
before: "23:59:59"
then:
- action: tts.xiaomo_say
metadata: {}
data:
entity_id: media_player.xiao_du_zhi_neng_yin_xiang_0907_4
language: zh-CN
message: >-
当前主水箱水温{{states('sensor.zhu_re_shui_qi_temperature')}}度,备用水箱水温{{states('sensor.dian_chi_tou_temperature')}}度,{{states.weather.tian_qi.attributes['forecast_minutely']}},{{states.weather.tian_qi.attributes['forecast_hourly']}},明天最高温度{{
states.weather.tian_qi.attributes['daily_forecast'][1]['native_temperature']}}度,最低温度{{states.weather.tian_qi.attributes['daily_forecast'][1]['native_templow']}}度,天气{{states.weather.tian_qi.attributes['daily_forecast'][1]['text']}},风向{{states.weather.tian_qi.attributes['daily_forecast'][1]['winddirday']}},风力{{states.weather.tian_qi.attributes['daily_forecast'][1]['windscaleday']}}级
else:
- action: tts.xiaomo_say
metadata: {}
data:
entity_id: media_player.xiao_du_zhi_neng_yin_xiang_0907_4
language: zh-CN
message: >-
当前主水箱水温{{states('sensor.zhu_re_shui_qi_temperature')}}度,备用水箱水温{{states('sensor.dian_chi_tou_temperature')}}度,过了零点了!新的一天最高温度{{
states.weather.tian_qi.attributes['daily_forecast'][0]['native_temperature']}}度,最低温度{{
states.weather.tian_qi.attributes['daily_forecast'][0]['native_templow']}}度,天气{{
states.weather.tian_qi.attributes['daily_forecast'][0]['text']}},风向{{
states.weather.tian_qi.attributes['daily_forecast'][0]['winddirday']}},风力{{
states.weather.tian_qi.attributes['daily_forecast'][0]['windscaleday']}}级,{{
states.weather.tian_qi.attributes['forecast_minutely']}},{{
states.weather.tian_qi.attributes['forecast_hourly']}}
mode: single
但是对于在HA里面的能源分页里面的,已经添加的能源已经可以通过你点击鼠标显示昨天的用电度数。今天当前的。
比如我如果要调用昨天的某个表的用电度数要用什么命令写在tts的内容里面
请赐教!!!
|
|