Modello
Support DIN Rail
This project was born from the need to want to monitor the power lines of the house, the project in question can handle up to 4 Pzem 004T and wanting with a little work you could expand everything up to 8 Pzem 004T.
Print Settings:
Assembly material:
Specifiche ESPhome e Wemos
To make it work I attach below the code used on ESPHome, also in addition to the code was made a change on the Pzem 004T putting a resistance of 1.5 kohm, below the photo of the change, this serves to lower the voltage voltage to 3.3v.
The wiring was done in series, then going in and out of every single Pzem coming up to the Wemos.
Code ESPHome
uart:
- id: ubus
rx_pin: GPIO1
tx_pin: GPIO3
baud_rate: 9600
stop_bits: 1
modbus:
id: mbus
uart_id: ubus
sensor:
################################ Linea 1 #######################################
- platform: pzemac
modbus_id: mbus
id: pzemac_01
address: 1
current:
name: "Current Linea 1"
voltage:
name: "Voltage Linea 1"
power:
name: "Power Linea 1"
id: "Power_Linea_1"
filters:
- multiply: 0.001
unit_of_measurement: kW
frequency:
name: "Frequency Linea 1"
power_factor:
name: "Power Factor Linea 1"
update_interval: never
################################ Linea 2 #######################################
- platform: pzemac
modbus_id: mbus
id: pzemac_02
address: 2
current:
name: "Current Linea 2"
voltage:
name: "Voltage Linea 2"
power:
name: "Power Linea 2"
id: "Power_Linea_2"
filters:
- multiply: 0.001
unit_of_measurement: kW
frequency:
name: "Frequency Linea 2"
power_factor:
name: "Power Factor Linea 2"
update_interval: never
################################ Linea 3 #######################################
- platform: pzemac
modbus_id: mbus
id: pzemac_03
address: 3
current:
name: "Current Linea 3"
voltage:
name: "Voltage Linea 3"
power:
name: "Power Linea 3"
id: "Power_Linea_3"
filters:
- multiply: 0.001
unit_of_measurement: kW
frequency:
name: "Frequency Linea 3"
power_factor:
name: "Power Factor Linea 3"
update_interval: never
################################ Linea 4 #######################################
- platform: pzemac
modbus_id: mbus
id: pzemac_04
address: 4
current:
name: "Current Linea 4"
voltage:
name: "Voltage Linea 4"
power:
name: "Power Linea 4"
id: "Power_Linea_4"
filters:
- multiply: 0.001
unit_of_measurement: kW
frequency:
name: "Frequency Linea 3"
power_factor:
name: "Power Factor Linea 3"
update_interval: never
################################ Totale Giornaliero #######################################
- platform: total_daily_energy
name: "Totale Energia Giornaliera 1"
power_id: Power_Linea_1
unit_of_measurement: 'kWh'
state_class: total_increasing
device_class: energy
accuracy_decimals: 3
- platform: total_daily_energy
name: "Totale Energia Giornaliera 2"
power_id: Power_Linea_2
unit_of_measurement: 'kWh'
state_class: total_increasing
device_class: energy
accuracy_decimals: 3
- platform: total_daily_energy
name: "Totale Energia Giornaliera 3"
power_id: Power_Linea_3
unit_of_measurement: 'kWh'
state_class: total_increasing
device_class: energy
accuracy_decimals: 3
- platform: total_daily_energy
name: "Totale Energia Giornaliera 4"
power_id: Power_Linea_4
unit_of_measurement: 'kWh'
state_class: total_increasing
device_class: energy
accuracy_decimals: 3