【问题标题】:Home Assistance Script for Automation自动化的家庭援助脚本
【发布时间】:2021-12-27 02:19:55
【问题描述】:
尝试配置我的第一个脚本
我的目标是在我的加热器出现错误时自动发出警报......有很多类型错误......唯一好的状态是 E-00:OK'
我只想在值为 时触发脚本:“E-00: OK”
有没有办法做到这一点?
脚本 Yaml
别名:>-
加热器 E10
顺序:
条件:状态
entity_id:sensor.heater_error_string
状态:“E-00:好的”
模式:单人
图标:mdi:radiator
【问题讨论】:
标签:
automation
yaml
home-assistant
【解决方案1】:
是的,您可以创建服务器端自动化脚本,该脚本仅在您的文本传感器实体值从 OK 更改为任何其他值时触发。
例如,您可以尝试:
automation:
trigger:
- platform: state
entity_id: sensor.heater_error_string
from:
- "E-00: OK"
action:
- service: notify.mobile_phone_app
data:
message: heater is not ok
title: Heater Notification
mode: single