显示效果图,和大佬们的差不多
解决了kWH问题,顺便给功率因素增加了单位,由于代码东拼西凑,这次固件重刷后由原ESPHOME集成变成了MQTT集成,以下是刷机代码,请大家给看看,怎么修改调整换回ESPHOME集成:
esphome:
name: esp8266
esp8266:
board: esp01_1m
uart:
tx_pin: GPIO1
rx_pin: GPIO3
baud_rate: 9600
stop_bits: 1
wifi:
networks:
- ssid: "ChinaNet"
password: "Cn123456789"
ota:
password: "123"
#以下内容导致由原ESPHOME集成,转换为MQTT集成
mqtt: #mqtt组件
broker: 192.168.3.123
port: "1883"
username: "mqtt"
password: "mqtt"
birth_message: #mqtt出生消息
topic: 612/cs #主题
payload: online
qos: 2
retain: true
will_message: #mqtt最后的遗志消息
topic: 612/yz # 主题
payload: offline
qos: 2
retain: true
shutdown_message: #mqtt节点关闭消息
topic: 612/gb #主题
payload: Server shutdown #发送的消息
qos: 2
retain: true
#以上内容导致由原ESPHOME集成,转换为MQTT集成
logger:
level: DEBUG
sensor:
- platform: pzemac
current:
name: "PZEM-004T Current"
id: IN_current
voltage:
name: "PZEM-004T Voltage"
id: IN_voltage
energy:
name: "PZEM-004T Energy"
id: IN_energy
filters:
- multiply: 0.001
unit_of_measurement: "kWh"
accuracy_decimals: 3
power:
name: "PZEM-004T Power"
id: IN_power
frequency:
name: "PZEM-004T Frequency"
id: IN_Fr
power_factor:
name: "PZEM-004T Power Factor"
id: IN_PF
unit_of_measurement: "cosΦ"
update_interval: 10s
- platform: wifi_signal
name: "WiFi Signal Sensor"
update_interval: 1000s
如果删除MQTT那段代码,在线刷固件时就会出线如下信息:
|