本帖最后由 georgewu57 于 2021-9-4 13:53 编辑
esphome添加完代码后,集成添加完配置,集成内应该是没有读取到数据
下面是esphome的配置:
external_components:
- source:
type: git
url: https://ghproxy.com/https://github.com/oxan/esphome-stream-server.git
components: [ stream_server ]
stream_server:
uart_id: pzem
port: 9000
i2c:
sda: 12
scl: 14
uart:
tx_pin: 3
rx_pin: 1
baud_rate: 9600
id: pzem
sensor:
- platform: wifi_signal
name: "esp01"
update_interval: 60s
id: xinhao
- platform: pzemac
current:
name: "PZEM-004T V3 Current"
id: dianliu
voltage:
name: "PZEM-004T V3 Voltage"
id: dianya
power:
name: "PZEM-004T V3 Power"
id: gonglv
frequency:
name: "PZEM-004T V3 Frequency"
id: pinlv
power_factor:
name: "PZEM-004T V3 Power Factor"
id: yinshu
energy:
name: "PZEM-004T V3 Energy"
id: dianneng
filters:
- multiply: 0.001
unit_of_measurement: kWH
accuracy_decimals: 3
update_interval: 5s
搞清楚了,TCP透传和ESPhome读取数据只能二选一,把相应的配置删掉就正常了!
|