Skip to main content
Device Type:plug
Electrical Standard:us
Board:bk72xx
Difficulty:Soldering required (4/5)

Elegrp RRR00 Smart In-Wall Outlet with Energy Monitoring

Amazon Link

Elegrp RRR00 Smart In-Wall Outlet with Energy Monitoring

The front has a button for each individually-switched outlet.

Outlet Front

Outlet Rear

The relays are individual, 16A relays. Nice!

Relays detail

Inside is a CBU module, which has a Beken BK7231N: https://fccid.io/2ANDL-CBU/User-Manual/CBU-User-Manual-updated-5064101.pdf

Pinout

The PCB on my outlet had some wrong labels for pins. This confused me until I ohmed straight from the base PCB to the CBU module. Below are the correct labels, in case it helps you.

CBU module PinFunctionUse on outletLabel on ELEGRP PCB (mostly incorrect)
3P20, SCL1, TCKRED LED (LED3) active highCEN (incorrect)
8P8, PWM2Lower switch button active low (SW2)ADC (incorrect)
10P6, PWM0Upper switch button active low (SW1)P8 (incorrect)
1P14, SCKUpper white LED (LED1) active highP7 (incorrect)
19P9, PWM3Active high upper outlet enable (R15, Q1)P6 (incorrect)
17P28Lower white LED (LED2) active highP26 (incorrect)
9P7, PWM1Active high lower outlet enable (R16, Q2)P24 (incorrect)
15P11, TX1Programming and TX to BL0942 energy monitorTX1
16P10, TX1Programming and RX from BL0942 energy monitorRX1
13GNDModule GND. Connect to programmer ground when programmingGND
143V33.3V supply to CBU module. Power when programming3.3V

See this pinout for more detail on the CBU side: https://docs.libretiny.eu/boards/cbu/cbu.svg

CBU SVG

Disassembly and Initial Flash Procedure

Run the Line and WHITE scresws all the way in. Remove the 4 T7 Torx screws on the back, and remove cover. Cover comes out with module. Remove module from cover. Solder a Sparkfun FTDI Basic's wires to 3.3V, GND, TX, and RX pins. Run esphome with the yaml below, select the COM port. When ESPHome prompts to reset by driving CEN low, use a male-male dupont wire or similar to connect CEN to GND. CEN is the fourth down on the right of the module, GND is second from right on bottom row: CBU module detail

Watch ESPHome for some sign of a flash starting, then release CEN. (as of Nov 2024) Once flashed and on your network, remove soldered wires and re-assemble!

Basic Configuration

substitutions:
device_name: "elegrp-rrr00"
friendly_name: "Elegrp RRR00 Power Monitoring Outlet"

esphome:
name: ${device_name}
friendly_name: ${friendly_name}
name_add_mac_suffix: true
project:
name: Elegrp.RRR00
version: 1.0.0

bk72xx:
board: cbu

# CRITICAL: UART logging MUST be disabled for BL0942 to work
logger:
baud_rate: 0

api:

ota:
- platform: esphome

wifi:
ap: {}

captive_portal:

time:
- platform: homeassistant
id: homeassistant_time

# Status LED - Red LED (P20, incorrectly labeled CEN on PCB)
status_led:
pin:
number: P20
inverted: false

uart:
rx_pin: RX1
tx_pin: TX1
baud_rate: 4800
stop_bits: 1

binary_sensor:
# Upper switch button (P6, incorrectly labeled P8 on PCB)
- platform: gpio
id: button_1
pin:
number: P6
mode:
input: true
pullup: true
inverted: true
name: "Button 1"
on_press:
- switch.toggle: relay_1
filters:
- delayed_on: 50ms

# Lower switch button (P8, incorrectly labeled ADC on PCB)
- platform: gpio
id: button_2
pin:
number: P8
mode:
input: true
pullup: true
inverted: true
name: "Button 2"
on_press:
- switch.toggle: relay_2
filters:
- delayed_on: 50ms

output:
# Upper white LED (P14, incorrectly labeled P7 on PCB)
- platform: gpio
pin: P14
inverted: false
id: upper_white_led

# Lower white LED (P28, incorrectly labeled P26 on PCB)
- platform: gpio
pin: P28
inverted: false
id: lower_white_led

light:
- platform: binary
output: upper_white_led
id: light_upper_white
internal: true

- platform: binary
output: lower_white_led
id: light_lower_white
internal: true

switch:
# Upper relay (P9, incorrectly labeled P6 on PCB)
- platform: gpio
name: "Relay 1"
pin: P9
id: relay_1
restore_mode: RESTORE_DEFAULT_OFF
on_turn_on:
- light.turn_on: light_upper_white
on_turn_off:
- light.turn_off: light_upper_white

# Lower relay (P7, incorrectly labeled P24 on PCB)
- platform: gpio
name: "Relay 2"
pin: P7
id: relay_2
restore_mode: RESTORE_DEFAULT_OFF
on_turn_on:
- light.turn_on: light_lower_white
on_turn_off:
- light.turn_off: light_lower_white

button:
- platform: restart
id: restart_button
name: "Restart"
- platform: factory_reset
id: factory_reset_button
name: "Factory Reset"
disabled_by_default: true
entity_category: config
icon: mdi:restart-alert

sensor:
- platform: wifi_signal
name: "WiFi Signal"
update_interval: 60s
- platform: uptime
name: "Uptime"
update_interval: 60s
- platform: bl0942
voltage:
name: "Outlet Voltage"
accuracy_decimals: 3
filters:
- sliding_window_moving_average:
window_size: 64
send_every: 64
send_first_at: 64
frequency:
name: "Outlet Frequency"
accuracy_decimals: 3
filters:
- sliding_window_moving_average:
window_size: 64
send_every: 64
send_first_at: 64
current:
name: "Outlet Total Current"
accuracy_decimals: 3
filters:
- sliding_window_moving_average:
window_size: 64
send_every: 64
send_first_at: 64
power:
name: "Outlet Total Power"
id: power_monitor
accuracy_decimals: 3
energy:
name: "Outlet Total Energy"
accuracy_decimals: 3
- platform: total_daily_energy
name: "Total Daily Energy"
power_id: power_monitor
unit_of_measurement: "kWh"
state_class: total_increasing
device_class: energy
accuracy_decimals: 3
filters:
- multiply: 0.001

text_sensor:
- platform: wifi_info
ip_address:
name: "IP Address"
ssid:
name: "SSID"
- platform: libretiny
version:
name: "LibreTiny Version"