IPEM SIX ESPHome Integration
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
|
||||
## Home Assistant Development and Integration
|
||||
|
||||
#### Welcome to the DitroniX Home Asssitant Integration
|
||||
#### Welcome to the DitroniX Home Assistant ESPHome Integration
|
||||
|
||||
This repository is for integration of DitroniX boards into Home Assistant using the ESPHome Components.
|
||||
|
||||
@@ -71,6 +71,7 @@ An example guide has been put together which should help get your boards up and
|
||||
## Versions
|
||||
|
||||
|
||||
- 260620 - Added IPEM SIX Integration for ESPHome
|
||||
- 260618 - Added WREN Integration for ESPHome
|
||||
- 260613 - Added TCA6408 for Dev Testing
|
||||
- 260529 - Refresh Information
|
||||
|
||||
@@ -0,0 +1,217 @@
|
||||
# Dave Williams, DitroniX 2019-2026 (ditronix.net)
|
||||
# IPEM SIX - ESP32-C5 | ATM90E32 | WiFi 2.4/5GHz | Zigbee | Bluetooth | SIX Channel IoT Mains Power Energy Monitor
|
||||
|
||||
# June 2026: Example Code, to demonstrate and test the IPEM SIX
|
||||
|
||||
# Remember!
|
||||
# - Set the BOARD to Use ESP32C5 Dev Module (or similar).
|
||||
# - You can also set the BAUD rate up to 921600 to speed up flashing.
|
||||
# - The SDK does NOT need external power to flash. It will take Power from the USB 5V.
|
||||
# - The Serial Monitor is configured for BAUD 115200
|
||||
|
||||
# The purpose of this test code is to cycle through the various main functions of the board as part of bring up testing.
|
||||
|
||||
# This test code is OPEN SOURCE and formatted for easier viewing. Although is is not intended for real world use, it may be freely used, or modified as needed.
|
||||
# It is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
|
||||
# For board configuration, see github.com/DitroniX/IPEM-SIX-ESP32C5-ATM90E32-IoT-Mains-Power-Energy-Monitor/wiki/Arduino-IDE
|
||||
|
||||
# Further information, details and examples can be found on our website or github.com/DitroniX
|
||||
|
||||
# * ditronix.net
|
||||
# * github.com/DitroniX
|
||||
# * github.com/DitroniX/IPEM-SIX-ESP32C5-ATM90E32-IoT-Mains-Power-Energy-Monitor
|
||||
# * github.com/DitroniX/IPEM-SIX-ESP32C5-ATM90E32-IoT-Mains-Power-Energy-Monitor/wiki
|
||||
# * hackster.io/DitroniX/ipem-six-esp32c5-atm90e32-iot-mains-power-energy-monitor-e323bd
|
||||
|
||||
# This YAML code is used to be the equivalent of the Hello World but for the IPEM SIX and both ATM90E32's.
|
||||
|
||||
esphome:
|
||||
name: ipem-six-c5
|
||||
friendly_name: IPEM SIX C5
|
||||
|
||||
on_boot:
|
||||
priority: -100
|
||||
then:
|
||||
- delay: 2s
|
||||
- light.turn_on:
|
||||
id: heartbeat_led
|
||||
effect: "Green Heartbeat"
|
||||
|
||||
esp32:
|
||||
board: esp32-c5-devkitc-1
|
||||
variant: esp32c5
|
||||
framework:
|
||||
type: esp-idf
|
||||
|
||||
# ############################# CONFIG #############################
|
||||
|
||||
# Enable Home Assistant API
|
||||
api:
|
||||
encryption:
|
||||
key: "xxxx="
|
||||
|
||||
ota:
|
||||
- platform: esphome
|
||||
password: "xxxx"
|
||||
|
||||
wifi:
|
||||
ssid: !secret wifi_ssid
|
||||
password: !secret wifi_password
|
||||
|
||||
# Enable fallback hotspot (captive portal) in case wifi connection fails
|
||||
ap:
|
||||
ssid: "IPEM SIX C5 Fallback Hotspot"
|
||||
password: "xxxx"
|
||||
|
||||
captive_portal:
|
||||
|
||||
# ==================== LOGGING ====================
|
||||
logger:
|
||||
# level: WARN # Reduces spam - only shows warnings and errors
|
||||
# level: ERROR # Even quieter (uncomment if you want)
|
||||
# level: DEBUG # Head scratching time.
|
||||
|
||||
# ############################# CODE #############################
|
||||
|
||||
# ========================= SPI BUS (Shared) =========================
|
||||
|
||||
spi:
|
||||
clk_pin: GPIO10
|
||||
mosi_pin: GPIO8
|
||||
miso_pin: GPIO9
|
||||
|
||||
# ========================= HEARTBEAT LED =========================
|
||||
|
||||
light:
|
||||
|
||||
- platform: esp32_rmt_led_strip
|
||||
id: heartbeat_led
|
||||
pin: GPIO27
|
||||
num_leds: 1
|
||||
chipset: WS2812
|
||||
rgb_order: GRB
|
||||
restore_mode: RESTORE_AND_ON
|
||||
|
||||
effects:
|
||||
|
||||
- addressable_lambda:
|
||||
name: "Green Heartbeat"
|
||||
update_interval: 50ms
|
||||
|
||||
lambda: |-
|
||||
static uint8_t step = 0;
|
||||
|
||||
uint8_t b = 0;
|
||||
|
||||
if (step == 0 || step == 2)
|
||||
b = 30;
|
||||
else if (step == 1 || step == 3)
|
||||
b = 10;
|
||||
|
||||
it[0] = Color(0, b, 0);
|
||||
|
||||
step++;
|
||||
|
||||
if (step > 20)
|
||||
step = 0;
|
||||
|
||||
# ========================= ENERGY MONITORS =========================
|
||||
|
||||
sensor:
|
||||
|
||||
|
||||
# ==================== ATM90E32 BANK A CS GPIO6 ======================
|
||||
|
||||
- platform: atm90e32
|
||||
|
||||
id: bank_a
|
||||
cs_pin: GPIO6
|
||||
|
||||
phase_a:
|
||||
|
||||
voltage:
|
||||
name: "Bank A Mains Voltage"
|
||||
id: bank_a_voltage
|
||||
accuracy_decimals: 1
|
||||
|
||||
current:
|
||||
name: "Bank A Current"
|
||||
id: bank_a_current
|
||||
accuracy_decimals: 3
|
||||
|
||||
power:
|
||||
name: "Bank A Power"
|
||||
id: bank_a_power
|
||||
accuracy_decimals: 1
|
||||
|
||||
gain_voltage: 38300
|
||||
gain_ct: 64800
|
||||
|
||||
frequency:
|
||||
name: "Bank A Frequency"
|
||||
|
||||
chip_temperature:
|
||||
name: "Bank A Temperature"
|
||||
|
||||
line_frequency: 50Hz
|
||||
|
||||
gain_pga: 2X
|
||||
|
||||
update_interval: 1s
|
||||
|
||||
# ==================== ATM90E32 BANK B CS GPIO7 ======================
|
||||
|
||||
- platform: atm90e32
|
||||
|
||||
id: bank_b
|
||||
cs_pin: GPIO7
|
||||
|
||||
phase_a:
|
||||
|
||||
voltage:
|
||||
name: "Bank B Mains Voltage"
|
||||
id: bank_b_voltage
|
||||
accuracy_decimals: 1
|
||||
|
||||
current:
|
||||
name: "Bank B Current"
|
||||
id: bank_b_current
|
||||
accuracy_decimals: 3
|
||||
|
||||
power:
|
||||
name: "Bank B Power"
|
||||
id: bank_b_power
|
||||
accuracy_decimals: 1
|
||||
|
||||
gain_voltage: 38300
|
||||
gain_ct: 64800
|
||||
|
||||
frequency:
|
||||
name: "Bank B Frequency"
|
||||
|
||||
chip_temperature:
|
||||
name: "Bank B Temperature"
|
||||
|
||||
line_frequency: 50Hz
|
||||
|
||||
gain_pga: 2X
|
||||
|
||||
update_interval: 1s
|
||||
|
||||
# ========================== TOTALS ============================
|
||||
|
||||
- platform: template
|
||||
|
||||
name: "IPEM SIX Total Power"
|
||||
unit_of_measurement: W
|
||||
device_class: power
|
||||
state_class: measurement
|
||||
|
||||
lambda: |-
|
||||
|
||||
return id(bank_a_power).state +
|
||||
id(bank_b_power).state;
|
||||
|
||||
|
||||
update_interval: 1s
|
||||
@@ -0,0 +1,122 @@
|
||||
# Dave Williams, DitroniX 2019-2026 (ditronix.net)
|
||||
# IPEM SIX - ESP32-C5 | ATM90E32 | WiFi 2.4/5GHz | Zigbee | Bluetooth | SIX Channel IoT Mains Power Energy Monitor
|
||||
|
||||
# June 2026: Example Code, to demonstrate and test the IPEM SIX
|
||||
|
||||
# Remember!
|
||||
# - Set the BOARD to Use ESP32C5 Dev Module (or similar).
|
||||
# - You can also set the BAUD rate up to 921600 to speed up flashing.
|
||||
# - The SDK does NOT need external power to flash. It will take Power from the USB 5V.
|
||||
# - The Serial Monitor is configured for BAUD 115200
|
||||
|
||||
# The purpose of this test code is to cycle through the various main functions of the board as part of bring up testing.
|
||||
|
||||
# This test code is OPEN SOURCE and formatted for easier viewing. Although is is not intended for real world use, it may be freely used, or modified as needed.
|
||||
# It is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
|
||||
# For board configuration, see github.com/DitroniX/IPEM-SIX-ESP32C5-ATM90E32-IoT-Mains-Power-Energy-Monitor/wiki/Arduino-IDE
|
||||
|
||||
# Further information, details and examples can be found on our website or github.com/DitroniX
|
||||
|
||||
# * ditronix.net
|
||||
# * github.com/DitroniX
|
||||
# * github.com/DitroniX/IPEM-SIX-ESP32C5-ATM90E32-IoT-Mains-Power-Energy-Monitor
|
||||
# * github.com/DitroniX/IPEM-SIX-ESP32C5-ATM90E32-IoT-Mains-Power-Energy-Monitor/wiki
|
||||
# * hackster.io/DitroniX/ipem-six-esp32c5-atm90e32-iot-mains-power-energy-monitor-e323bd
|
||||
|
||||
# This YAML code is used to be the equivalent of the Hello World but for the IPEM SIX and RGB LED.
|
||||
|
||||
esphome:
|
||||
name: ipem-six-c5
|
||||
friendly_name: IPEM SIX C5
|
||||
|
||||
on_boot:
|
||||
priority: -100
|
||||
then:
|
||||
- delay: 2s
|
||||
- light.turn_on:
|
||||
id: heartbeat_led
|
||||
effect: "Green Heartbeat"
|
||||
|
||||
esp32:
|
||||
board: esp32-c5-devkitc-1
|
||||
variant: esp32c5
|
||||
framework:
|
||||
type: esp-idf
|
||||
|
||||
# ############################# CONFIG #############################
|
||||
|
||||
# Enable Home Assistant API
|
||||
api:
|
||||
encryption:
|
||||
key: "xxxx="
|
||||
|
||||
ota:
|
||||
- platform: esphome
|
||||
password: "xxxx"
|
||||
|
||||
wifi:
|
||||
ssid: !secret wifi_ssid
|
||||
password: !secret wifi_password
|
||||
|
||||
# Enable fallback hotspot (captive portal) in case wifi connection fails
|
||||
ap:
|
||||
ssid: "IPEM SIX C5 Fallback Hotspot"
|
||||
password: "xxxx"
|
||||
|
||||
captive_portal:
|
||||
|
||||
# ==================== LOGGING ====================
|
||||
logger:
|
||||
# level: WARN # Reduces spam - only shows warnings and errors
|
||||
# level: ERROR # Even quieter (uncomment if you want)
|
||||
# level: DEBUG # Head scratching time.
|
||||
|
||||
# ############################# CODE #############################
|
||||
|
||||
# ========================= SPI BUS (Shared) =========================
|
||||
|
||||
spi:
|
||||
clk_pin: GPIO10
|
||||
mosi_pin: GPIO8
|
||||
miso_pin: GPIO9
|
||||
|
||||
# ========================= HEARTBEAT LED =========================
|
||||
|
||||
light:
|
||||
|
||||
- platform: esp32_rmt_led_strip
|
||||
id: heartbeat_led
|
||||
pin: GPIO27
|
||||
num_leds: 1
|
||||
chipset: WS2812
|
||||
rgb_order: GRB
|
||||
restore_mode: RESTORE_AND_ON
|
||||
|
||||
effects:
|
||||
|
||||
- addressable_lambda:
|
||||
name: "Green Heartbeat"
|
||||
update_interval: 50ms
|
||||
|
||||
lambda: |-
|
||||
static uint8_t step = 0;
|
||||
|
||||
uint8_t b = 0;
|
||||
|
||||
if (step == 0 || step == 2)
|
||||
b = 30;
|
||||
else if (step == 1 || step == 3)
|
||||
b = 10;
|
||||
|
||||
it[0] = Color(0, b, 0);
|
||||
|
||||
step++;
|
||||
|
||||
if (step > 20)
|
||||
step = 0;
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,135 @@
|
||||
# IPEM SIX | ESP32C5 | DUAL ATM90E32 IoT Mains Power Energy Monitor
|
||||
|
||||
## **IPEM SIX - ESPHome Example Code**
|
||||
|
||||
This is a working ESPHome YAML development code for IPEM SIX, for Home Assistant.
|
||||
|
||||

|
||||
|
||||
## Summary
|
||||
|
||||
IPEM SIX C5 provides a complete energy monitoring platform:
|
||||
|
||||
✅ 6 CT channels
|
||||
✅ Dual ATM90E32 metering
|
||||
✅ Import/export detection
|
||||
✅ Per-channel energy tracking
|
||||
✅ Home Assistant native integration
|
||||
✅ WiFi diagnostics
|
||||
✅ Health monitoring
|
||||
✅ Configurable load alerts
|
||||
✅ OTA updates
|
||||
✅ ESP32-C5 performance platform
|
||||
|
||||
Designed as a professional-grade residential and small commercial energy monitoring solution.
|
||||
|
||||
## **Code Overview**
|
||||
|
||||
**IPEM SIX C5** is a professional 6-channel dual-bank energy monitoring device based on the **ESP32-C5** platform and dual **ATM90E32** energy measurement ICs.
|
||||
|
||||
Demonstrate the power of the IPEM SIX by reading the all the data from the six current clamps and input voltages, and provide a large range of information.
|
||||
|
||||
Provide:
|
||||
|
||||
- Live sensor updates
|
||||
- Configuration control
|
||||
- Device status
|
||||
- Diagnostics
|
||||
|
||||
The device code presents:
|
||||
|
||||
- 6 independent CT current channels
|
||||
- Dual-bank monitoring architecture
|
||||
- Real-time power monitoring
|
||||
- Import/export power calculation
|
||||
- Energy accumulation (kWh)
|
||||
- Voltage and frequency measurement
|
||||
- Power factor and reactive power monitoring
|
||||
- Internal temperature monitoring
|
||||
- Wi-Fi diagnostics
|
||||
- Health/Status monitoring
|
||||
- Configurable load activity thresholds
|
||||
- LED heartbeat indication
|
||||
|
||||
Designed for integration with **Home Assistant via ESPHome API**.
|
||||
|
||||
## Documentation - IPEM SIX Firmware Overview
|
||||
|
||||
### **Basic Examples**
|
||||
|
||||
During development, I took baby steps in understanding how YAML worked and how to integrate the various elements of the IPEM SIX board. These examples have been included for your information, in the Basic Examples folder.
|
||||
|
||||
### **Status**
|
||||
|
||||
The code should work as it is but you will ideally need to update the ESPHome API details, which I have xxxx out.
|
||||
|
||||
### Enable Home Assistant API
|
||||
api:
|
||||
encryption:
|
||||
key: "xxxx="
|
||||
|
||||
ota:
|
||||
- platform: esphome
|
||||
password: "xxxx"
|
||||
|
||||
wifi:
|
||||
ssid: !secret wifi_ssid
|
||||
password: !secret wifi_password
|
||||
|
||||
# Enable fallback hotspot (captive portal) in case wifi connection fails
|
||||
ap:
|
||||
ssid: "Wren-C5-Test Fallback Hotspot"
|
||||
password: "xxxx"
|
||||
|
||||
## **Full Code Example View**
|
||||
|
||||
The initial release of this code is for single phase and six channels. The code will be updated for split and three phase.
|
||||
|
||||
This is an example of the ESPHome Dash view
|
||||
|
||||
|
||||
## **Open Source**
|
||||
|
||||
This test code is OPEN SOURCE and formatted for easier viewing. Although is is not intended for real world use, it may be freely used, or modified as needed.
|
||||
|
||||
It is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
|
||||
## **Further Information**
|
||||
|
||||
Additional information, and other technical details on this project, maybe found in the related repository pages.
|
||||
|
||||
**Repository Folders**
|
||||
|
||||
- **Code** *(Code examples for Arduino IDE, Raspberry Pi and PlatformIO)*
|
||||
- **Datasheets and Information** *(Component Datasheets, Schematics, Board Layouts, Photos, Technical Documentation)*
|
||||
- **Certification** *(Related Repository Project or Part, Certification Information)*
|
||||
|
||||
**Repository Tabs**
|
||||
|
||||
- **Wiki** *(Related Repository Wiki pages and Technical User Information)*
|
||||
- **Discussions** *(Related Repository User Discussion Forum)*
|
||||
- **Issues** *(Related Repository Technical Issues and Fixes)*
|
||||
|
||||
***
|
||||
|
||||
We value our Customers, Users of our designs and STEM Communities, all over the World . Should you have any other questions, or feedback to share to others, please feel free to:
|
||||
|
||||
* Visit the related [Project](https://github.com/DitroniX?tab=repositories) *plus the related* **Discussions** and **Wiki** Pages. See tab in each separate repository.
|
||||
* **Project Community Information** can be found at https://www.hackster.io/DitroniX
|
||||
* [DitroniX.net Website - Contact Us](https://ditronix.net/contact/)
|
||||
* **Twitter**: [https://twitter.com/DitroniX](https://twitter.com/DitroniX)
|
||||
* [Supporting the STEM Projects - BuyMeACoffee](https://www.buymeacoffee.com/DitroniX)
|
||||
* **LinkedIN**: [https://www.linkedin.com/in/g8puo/](https://www.linkedin.com/in/g8puo/)
|
||||
|
||||
***Dave Williams, Maidstone, UK.***
|
||||
|
||||
Electronics Engineer | Software Developer | R&D Support | RF Engineering | Product Certification and Testing | STEM Ambassador
|
||||
|
||||
## STEM
|
||||
|
||||
**Supporting [STEM Learning](https://www.stem.org.uk/)**
|
||||
|
||||
Life is one long exciting learning curve, help others by setting the seed to knowledge.
|
||||
|
||||

|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 77 KiB |
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user