找回密码
 立即注册
搜索
楼主: dscao

[经验分享] 彩云天气极端天气预警提醒的自动化示例分享

[复制链接]

4

主题

20

回帖

694

积分

高级会员

积分
694
金钱
670
HASS币
0
发表于 2024-4-10 12:55:01 | 显示全部楼层
感謝大大
回复

使用道具 举报

sym 手机认证

0

主题

6

回帖

100

积分

注册会员

积分
100
金钱
94
HASS币
0
发表于 2024-4-11 13:12:00 | 显示全部楼层
家具小管家不错啊
回复

使用道具 举报

lqm 

0

主题

8

回帖

758

积分

高级会员

积分
758
金钱
750
HASS币
0
发表于 2024-5-16 11:18:08 | 显示全部楼层
太强了,mark一下
回复

使用道具 举报

7

主题

180

回帖

1081

积分

金牌会员

积分
1081
金钱
894
HASS币
0
发表于 2025-5-22 10:35:00 | 显示全部楼层
请问下微信推送是怎么弄的?
回复

使用道具 举报

2

主题

28

回帖

354

积分

中级会员

积分
354
金钱
324
HASS币
0
发表于 2025-6-20 10:52:33 | 显示全部楼层
本帖最后由 tianyi19992000 于 2025-6-20 10:53 编辑

热心的朋友大家帮我看看哪里出了问题,手机正常推送预警信息,但是tts不播报呢,实在搞不定了
alias: 天气预警
description: ""
trigger:
  - platform: state
    entity_id:
      - weather.wo_de_jia
    attribute: forecast_alert
    enabled: true
condition:
  - condition: template
    value_template: >-
      {%if trigger.to_state.attributes.forecast_alert['content']|length>0
      %}true{%endif%}
  - condition: template
    value_template: >-
      {%if trigger.from_state.attributes.forecast_alert['content']|length == 0
      or
      (trigger.to_state.attributes.forecast_alert['content']|sort(attribute='pubtimestamp',
      reverse = True))[0]['alertId'] [-14:]|int>
      (trigger.from_state.attributes.forecast_alert['content']|sort(attribute='pubtimestamp',
      reverse = True))[0]['alertId'][-14:]|int %}true{%endif%}
    enabled: true
action:
  - parallel:
      - service: notify.mobile_app_iphone14
        data:
          message: >-
            {{trigger.to_state.name}}天气异常警告:{{(trigger.to_state.attributes.forecast_alert['content']|sort(attribute='pubtimestamp',
            reverse = True))[0]['description'] }}
          title: >-
            {{(trigger.to_state.attributes.forecast_alert['content']|sort(attribute='pubtimestamp',
            reverse = True))[0]['title'] }}
        enabled: true
      - service: xiaomi_miot.intelligent_speaker
        data:
          execute: false
          silent: false
          throw: false
          entity_id: media_player.xiaomi_s12_4ece_play_control
          text: >-
            主人,{{trigger.to_state.name}}天气异常警告:{{(trigger.to_state.attributes.forecast_alert['content']|sort(attribute='pubtimestamp',
            reverse = True))[0]['description']
            }}。{{(trigger.to_state.attributes.forecast_alert['content']|sort(attribute='pubtimestamp',
            reverse = True))[0]['title'] }}。
mode: queued
max: 5
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|Hassbian ( 晋ICP备17001384号-1 )

GMT+8, 2025-7-2 14:19 , Processed in 0.051799 second(s), 12 queries , MemCached On.

Powered by Discuz! X3.5

© 2001-2025 Discuz! Team.

快速回复 返回顶部 返回列表