小米插线板如何获取功耗呢??
家里有几个小米zigbee插座和wifi插座,还有一个小米插线板,接入HA后,插座工作正常,但是还有2个问题:1. 插座功耗显示不正常,延时特别长,如何解决?2. 插线板无法显示功耗,是不是语法写错了?
附上sensor代码(我把硬件信息都split为单独的文件了)
# 电源感应器
- platform: template
sensors:
xiaomi_plug_power_015e801e:
friendly_name: '客厅落地灯'
unit_of_measurement: W
value_template: "{{ state_attr('switch.plug_158d00015e801e', 'load_power')}}"
icon_template: mdi:flash
entity_id: sensor.158d00015e801e_power
xiaomi_plug_power_0163d30a:
friendly_name: 'PVE插座'
unit_of_measurement: W
value_template: "{{ state_attr('switch.plug_158d000163d30a', 'load_power')}}"
icon_template: mdi:flash
entity_id: sensor.158d000163d30a_power
xiaomi_plug_power_014ce87c:
friendly_name: '冰箱插座'
unit_of_measurement: W
value_template: "{{ state_attr('switch.plug_158d00014ce87c', 'load_power')}}"
icon_template: mdi:flash
entity_id: sensor.158d00014ce87c_power
xiaomi_plug_power_strip_01:
friendly_name: '宽带插线板'
unit_of_measurement: W
value_template: "{{ state_attr('switch.kuan_dai_cha_xian_ban', 'load_power')}}"
icon_template: mdi:flash
entity_id: sensor.xiaomi_plug_power_strip_01
写了value_template就不用entity_id了 情非殇 发表于 2020-4-1 18:07
写了value_template就不用entity_id了
管用啊,多谢,学习了。
sblook 发表于 2020-4-1 18:15
管用啊,多谢,学习了。
不知道为啥最近好几个帖子要提取功耗的,有什么意义,做自动化的话,你直接用template trigger做触发就好了,这样反而搞了一堆实体id出来 请问有办法看每月用电量统计吗?只看瞬时功率确实没有太大意义~ 情非殇 发表于 2020-4-1 18:19
不知道为啥最近好几个帖子要提取功耗的,有什么意义,做自动化的话,你直接用template trigger做触发就好 ...
感觉是方便了解设备特定时间的功耗,不然直接写自动化也不知道具体值
页:
[1]