Open Fusseldieb opened 3 years ago
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Don't stale, issue is still there
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Don't stale, issue is still there
Well, I settled with a workaround for now:
uart:
rx_pin: D5
tx_pin: D4
baud_rate: 9600
sensor:
- platform: template
name: "Threephase Energy Sensor"
lambda: |-
int all_phases = id(p1).state+id(p2).state+id(p3).state;
if (all_phases < 100000) {
return all_phases;
} else {
return {};
}
unit_of_measurement: "W"
accuracy_decimals: 0
update_interval: 3s
- platform: pzemac
voltage:
name: "Phase 1 Voltage"
power:
name: "Phase 1 Power"
id: p1
internal: true
update_interval: 1s
address: 1
- platform: pzemac
voltage:
name: "Phase 2 Voltage"
power:
name: "Phase 2 Power"
id: p2
internal: true
update_interval: 1.03s // Slightly out of sync - If all have the same interval, they give read errors more often!
address: 2
- platform: pzemac
voltage:
name: "Phase 3 Voltage"
power:
name: "Phase 3 Power"
id: p3
internal: true
update_interval: 1.05s // Slightly out of sync
address: 3
It basically makes a virtual sensor that combines all three values and sends the value to Home Assistant.
The if (all_phases < 100000)
I did to filter out some spikes that it gives occasionally (misreadings from the sensor).
@Fusseldieb just in case, can you please show me whole config for 3 PZEMs? I'm trying to setup same configuration, but only 2 of 3 is working at the same time. My config looks like this:
uart:
- tx_pin: D1
rx_pin: D2
baud_rate: 9600
id: uart_phase_1
- tx_pin: D3
rx_pin: D4
baud_rate: 9600
id: uart_phase_2
- tx_pin: D5
rx_pin: D6
baud_rate: 9600
id: uart_phase_3
modbus:
- id: modbus_phase_1
uart_id: uart_phase_1
- id: modbus_phase_2
uart_id: uart_phase_2
- id: modbus_phase_3
uart_id: uart_phase_3
sensor:
- platform: pzemac
current:
name: "Phase 1 Current"
voltage:
name: "Phase 1 Voltage"
power:
name: "Phase 1 Power"
update_interval: 10s
modbus_id: modbus_phase_1
id: pzemac1
- platform: pzemac
current:
name: "Phase 2 Current"
voltage:
name: "Phase 2 Voltage"
power:
name: "Phase 2 Power"
update_interval: 11s
modbus_id: modbus_phase_2
id: pzemac2
- platform: pzemac
current:
name: "Phase 3 Current"
voltage:
name: "Phase 3 Voltage"
power:
name: "Phase 3 Power"
update_interval: 12s
modbus_id: modbus_phase_3
id: pzemac3
And getting values only for phase_2 and phase_3, or phase_1 and phase_2, but not all 3 at the same time.
Operating environment/Installation (Hass.io/Docker/pip/etc.):
Home Assistant running in Docker on Ubuntu 18.04.4 LTS (irrelevant)
ESP (ESP32/ESP8266, Board/Sonoff):
ESP8266
ESPHome version (latest production, beta, dev branch)
1.15.0
Affected component:
PZEM-004T 10A/100A
Description of problem: I have 3 PZEM sensors hooked up on one ESP and all three get updated on different intervals and the data is sent in rapid succession to Home Assistant. Why can't it wait to "loop" over all sensors first and only then pass the data over to Home Assistant? Since I'm adding all three Wattages together in Home Assistant, the Wattage changes 3 times in rapid succession and the log graph gets 3 times bigger than it should.
Problem-relevant YAML-configuration entries:
Logs (if applicable):
Additional information and things you've tried: -
Would be nice if this could be implemented in the next version :)