4
348
3546
论坛元老
使用道具 举报
10
687
5798
8
2084
6129
流水无味
参考这种…… - platform: template sensors: wifixxy: friendly_name: '小敏' value_template: "{{ 'WIFI' if is_state('binary_sensor.XXYP6P', 'on') else '4G' }}"
30
997
4173
wqqs 发表于 2019-7-3 13:24 template_sensor
my_battery_charging_cn: friendly_name: 手机充电状态 value_template: "{% if is_state('sensor.my_battery_charging', 'true') %}充电中{% elif is_state('sensor.my_battery_charging', 'false') %}未充电{% endif %}"
参考这种…… - platform: template sensors: [/quote]你看下这么写行不行 [code]my_battery_charging_cn: friendly_name: 手机充电状态 value_template: "{% if is_state('sensor.my_battery_charging', 'true') %}充电中{% elif is_state('sensor.my_battery_charging', 'false') %}未充电{% endif %}"
xieahui 发表于 2019-7-3 15:39 只要有数值 数值正确都是可以的 你试试呗
本版积分规则 发表回复 回帖后跳转到最后一页
经常在论坛发帖,且发帖量较大
经常参与各类话题的讨论,发帖内容较有主见
Archiver|手机版|小黑屋|Hassbian
GMT+8, 2025-2-25 12:08 , Processed in 0.073316 second(s), 33 queries .
Powered by Discuz! X3.4
Copyright © 2001-2021, Tencent Cloud.