
Energy Meter วัดการใช้ไฟฟ้าภายในบ้าน
โจทย์สำหรับโปรเจคนี้คือ ต้องการทราบปริมาณใช้งานไฟฟ้าทั้งหมดภายในบ้าน ช่วงกลางวัน เพื่ออนาคตจะได้ติดโซล่าเซลล์แบบออนกริด และก็สามารถเชื่อมต่อกับ Home Assistant เพื่อจะดูข้อมูลแบบ realtime หรือย้อนหลัง เตรียมอุปกรณ์ NodeMCU ESP8266 PZEM-004T Clamp(CT) แบบเปิด-ปิด สายแพจัมป์ เมีย-เมีย Adaptor 5V สาย Micro USB เชื่อมต่ออุปกรณ์ สำหรับวิธีการเชื่อมต่ออุปกรณ์ หลักๆให้เริ่มที่ตัว PZEM ฝั่งนึงเชื่อมสาย CT และไฟ AC ส่วนอีกฝั่งเป็นการเชื่อมต่อกับ ESP8266 ( PZEM-004T V3 ) Code ESPHome esphome: name: energy-meter esp8266: board: nodemcuv2 # Enable logging logger: # Enable Home Assistant API api: encryption: key: "Dxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx=" ota: password: "1xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx2" wifi: ssid: !secret wifi_ssid password: !secret wifi_password # Enable fallback hotspot (captive portal) in case wifi connection fails ap: ssid: "Energy-Meter Fallback Hotspot" password: "xxxxxxxxxxxn" captive_portal: uart: tx_pin: D1 rx_pin: D2 baud_rate: 9600 switch: - platform: uart name: "EMeter Reset Energy" data: [0x01, 0x42, 0x80, 0x11] - platform: restart name: "EMeter Restart" sensor: - platform: pzemac voltage: name: "EMeter Voltage" accuracy_decimals: 2 power: name: "EMeter Power" accuracy_decimals: 2 energy: name: "EMeter Energy" unit_of_measurement: kWh accuracy_decimals: 2 filters: - multiply: 0.001 update_interval: 1s ข้อควรระวังการเชื่อมต่อสาย RX TX ระหว่าง PZEM กับ ESP8266 ...








