本帖最后由 dscao 于 2026-1-26 16:31 编辑
target:
entity_id:
- media_player.dlna_r1_0f6b
data:
message: >-
现在时间:{{ states("sensor.time") }},室内客厅PM2.5为{{
states("sensor.zm1_b0f893290ad2_pm25") }}、温度为{{
states("sensor.zm1_b0f893290ad2_temperature") }}度、湿度为百分之{{
states("sensor.zm1_b0f893290ad2_humidity") }}。室外PM2.5为{{
state_attr("weather.shi_tai","pm25") }},室外温度为{{
states("sensor.shi_wai_wen_du") }}度;室外湿度为百分之{{
states("sensor.shi_wai_shi_du") }};今天气温 {{
(state_attr("weather.shi_tai","daily_forecast")[0].native_templow
|round(0)|string).replace("-", "零下") }} 到 {{
(state_attr("weather.shi_tai","daily_forecast")[0].native_temperature|round(0)|string).replace("-",
"零下") }} 摄氏度。当前 {{
(state_attr("weather.shi_tai","temperature")|round(0)|string).replace("-","零下")
}} 摄氏度,空气质量{{ state_attr("weather.shi_tai","aqi_description") }}。今天 {{
state_attr("weather.shi_tai","forecast_hourly") }}。当前 {{
state_attr("weather.shi_tai","forecast_minutely") }}。 {% for state in
state_attr("weather.shi_tai","suggestion") -%}
{% if state.title=="ComfortIndex" -%}
{{state.txt}}
{%- endif %}
{%- endfor %}
language: zh-CN-XiaoxiaoNeural
cache: false
chime_path: custom_components/chime_tts/mp3s/glockenspiel.mp3
delay: 450
tts_platform: tts.edge_tts
tts_playback_speed: 100
volume_level: 0.75
join_players: false
unjoin_players: false
announce: true
action: chime_tts.say
我的这个脚本正常播报呀,只是比较慢,触发后可能要等10至20秒,“叮”,开始播报内容。当然这个字数内容也比较多。
我的系统环境,os、core、集成都会尽量更新到最新版的。
|