『瀚思彼岸』» 智能家居技术论坛

 找回密码
 立即注册
查看: 4453|回复: 2

自动化触发对象的提示问题

[复制链接]

2

主题

22

帖子

188

积分

注册会员

Rank: 2

积分
188
金钱
166
HASS币
0
发表于 2021-2-7 11:54:49 | 显示全部楼层 |阅读模式
设置了一个自动化 家里一共五扇门安装了门窗传感器,设置了自动化任意一扇开启超过15min就会提醒,请问如何在执行动作action--persistent_notification.create提醒的message中 体现出是那扇门开启超时了
目前代码如下

alias: notify
description: ''
trigger:
  - type: opened
    platform: device
    device_id: 158dxxxxxxxxxxxxx
    entity_id: binary_sensor.door_window_sensor_158dxxxxxxxxxxxxx
    domain: binary_sensor
    for:
      hours: 0
      minutes: 15
      seconds: 0
  - type: opened
    platform: device
    device_id: binary_sensor.door_window_sensor_158dxxxxxxxxxxxxx
    entity_id: 158dxxxxxxxxxxxxx
    domain: binary_sensor
    for:
      hours: 0
      minutes: 15
      seconds: 0
  - type: opened
    platform: device
    device_id: 158dxxxxxxxxxxxxx
    entity_id: binary_sensor.door_window_sensor_158dxxxxxxxxxxxxx
    domain: binary_sensor
    for:
      hours: 0
      minutes: 15
      seconds: 0
  - type: opened
    platform: device
    device_id: 158dxxxxxxxxxxxxx
    entity_id: binary_sensor.door_window_sensor_158dxxxxxxxxxxxxx
    domain: binary_sensor
    for:
      hours: 0
      minutes: 15
      seconds: 0
  - type: opened
    platform: device
    device_id: 158dxxxxxxxxxxxxx
    entity_id: binary_sensor.door_window_sensor_158dxxxxxxxxxxxxx
    domain: binary_sensor
    for:
      hours: 0
      minutes: 15
      seconds: 0
condition:
  - after: '08:00:00'
    before: '20:00:00'
    condition: time
action:
  - data:
      message: 门未关超过15min 请注意查看
    service: persistent_notification.create
mode: single


回复

使用道具 举报

7

主题

192

帖子

1705

积分

金牌会员

Rank: 6Rank: 6

积分
1705
金钱
1508
HASS币
30
发表于 2021-2-7 11:58:25 | 显示全部楼层
trigger.to_state.name 了解下
回复

使用道具 举报

2

主题

22

帖子

188

积分

注册会员

Rank: 2

积分
188
金钱
166
HASS币
0
 楼主| 发表于 2021-2-7 12:07:19 | 显示全部楼层
message: {{ trigger.to_state.name }}未关超过15min 请注意查看

这样嘛?
回复

使用道具 举报

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

本版积分规则

Archiver|手机版|小黑屋|Hassbian

GMT+8, 2024-11-26 20:46 , Processed in 0.100305 second(s), 24 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

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