家里三相四线入户,买了3个培正004T装上已经能读取到数据,目前有几个疑问:
1、无法接入能源,代码中已按本坛里的坛友添加了数据,请看下面
但是在能源页面添加用电数据时没有设备可以添加,显示的都是不存在的一些设备
uart:
tx_pin: GPIO1
rx_pin: GPIO3
baud_rate: 9600
stop_bits: 1
modbus:
sensor:
- platform: pzemac
address: 1
id: pzemac_1
energy:
name: "PZEM_1 Energy"
filters:
- multiply: 0.001
unit_of_measurement: kWH
accuracy_decimals: 2
device_class: energy
state_class: total_increasing
voltage:
name: "PZEM_1 Voltage"
current:
name: "PZEM_1 Current"
power:
name: "PZEM_1 Power"
power_factor:
name: "PZEM_1 Power Factor"
frequency:
name: "PZEM_1 Frequency"
update_interval: 30s
- platform: pzemac
address: 2
id: pzemac_2
energy:
name: "PZEM_2 Energy"
filters:
- multiply: 0.001
unit_of_measurement: kWH
accuracy_decimals: 2
device_class: energy
state_class: total_increasing
voltage:
name: "PZEM_2 Voltage"
current:
name: "PZEM_2 Current"
power:
name: "PZEM_2 Power"
power_factor:
name: "PZEM_2 Power Factor"
frequency:
name: "PZEM_2 Frequency"
update_interval: 30s
- platform: pzemac
address: 3
id: pzemac_3
energy:
name: "PZEM_3 Energy"
filters:
- multiply: 0.001
unit_of_measurement: kWH
accuracy_decimals: 2
device_class: energy
state_class: total_increasing
voltage:
name: "PZEM_3 Voltage"
current:
name: "PZEM_3 Current"
power:
name: "PZEM_3 Power"
power_factor:
name: "PZEM_3 Power Factor"
frequency:
name: "PZEM_3 Frequency"
update_interval: 30s
button:
- platform: template
name: "kWh_1 reset"
on_press:
- pzemac.reset_energy: pzemac_1
- platform: template
name: "kWh_2 reset"
on_press:
- pzemac.reset_energy: pzemac_2
- platform: template
name: "kWh_3 reset"
on_press:
- pzemac.reset_energy: pzemac_3
2、上面代码中添加了复位按钮,也是取自本坛的网友的,但是点击按钮后电能数据没有归零,是什么原因?
|