家里有几个小米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
|