本帖最后由 zonglong 于 2019-9-29 20:27 编辑
使用多组 PZEM-004T-100A(V3.0) 监控总电压、电流时, Sonoff-Tasmota 无法设定多组,因此,无法用一组 NodeMCU 同时监控电箱不同回路的电压,电流。这时 ESPhome 的好处来了。ESPHome 可以使用 Software serial (软件串口),因为可以设定多组 UART,以下的 yaml 是设定成 4 组软件串口,1 组硬件串口。只要使用一个 ESPHome 就可以同时监控多路电压、电流。
范例:
uart:
- id: pzem004t1
tx_pin: D3
rx_pin: D1
baud_rate: 9600
- id: pzem004t2
tx_pin: D4
rx_pin: D2
baud_rate: 9600
- id: pzem004t3
tx_pin: D6
rx_pin: D5
baud_rate: 9600
- id: pzem004t4
tx_pin: D0
rx_pin: D7
baud_rate: 9600
- id: pzem004t5
tx_pin: GPIO1
rx_pin: GPIO3
baud_rate: 9600
sensor:
- platform: pzemac
energy:
name: PZEM004T Channel 1 Energy
frequency:
name: PZEM004T Channel 1 Frequency
voltage:
name: PZEM004T Channel 1 Voltage
current:
name: PZEM004T Channel 1 Current
power:
name: PZEM004T Channel 1 Power
id: PZEM004T_CHANNEL1_POWER
update_interval: 1s
uart_id: pzem004t1
- platform: pzemac
energy:
name: PZEM004T Channel 2 Energy
frequency:
name: PZEM004T Channel 2 Frequency
voltage:
name: PZEM004T Channel 2 Voltage
current:
name: PZEM004T Channel 2 Current
power:
name: PZEM004T Channel 2 Power
id: PZEM004T_CHANNEL2_POWER
update_interval: 1s
uart_id: pzem004t2
- platform: pzemac
energy:
name: PZEM004T Channel 3 Energy
frequency:
name: PZEM004T Channel 3 Frequency
voltage:
name: PZEM004T Channel 3 Voltage
current:
name: PZEM004T Channel 3 Current
power:
name: PZEM004T Channel 3 Power
id: PZEM004T_CHANNEL3_POWER
update_interval: 1s
uart_id: pzem004t3
- platform: pzemac
energy:
name: PZEM004T Channel 4 Energy
frequency:
name: PZEM004T Channel 4 Frequency
voltage:
name: PZEM004T Channel 4 Voltage
current:
name: PZEM004T Channel 4 Current
power:
name: PZEM004T Channel 4 Power
id: PZEM004T_CHANNEL4_POWER
update_interval: 1s
uart_id: pzem004t4
- platform: pzemac
energy:
name: PZEM004T Channel 5 Energy
frequency:
name: PZEM004T Channel 5 Frequency
voltage:
name: PZEM004T Channel 5 Voltage
current:
name: PZEM004T Channel 5 Current
power:
name: PZEM004T Channel 5 Power
id: PZEM004T_CHANNEL5_POWER
update_interval: 1s
uart_id: pzem004t5
pzemac.zip
(6.96 KB, 下载次数: 218)
|