0

尝试配置我的第一个脚本

我的目标是在我的加热器出现错误时自动发出警报……有很多类型错误……唯一好的状态是 E-00:OK'</p>

我只想在值为 <> 时触发脚本:“E-00:OK”</p>

有没有办法做到这一点?

脚本 Yaml 别名:>- Heater E10 序列:

条件:状态 entity_id:sensor.heater_error_string 状态:“E-00:OK” 模式:单个图标:mdi:radiator

4

1 回答 1

0

是的,您可以创建服务器端自动化脚本,该脚本仅在您的文本传感器实体值从 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
于 2022-01-01T23:27:29.220 回答