
Atom Socket is a smart power socket compatible with the ATOM controller. It integrates the HLW8032 high-precision energy metering IC, enabling measurement of voltage, current, power, and power factor via serial communication. The socket follows Japanese standards and includes a single-channel relay (AC 100–120V, 10A) for power control. When paired with a Wi-Fi–enabled ATOM controller, it supports remote control and energy monitoring. An onboard HY2.0-4P interface allows interaction with external devices, such as relay signal input and button signal output.
Step 1. Create New Device

Step 2. Create Device Name
CONTINUE.
New Device Setup.
NEXT.
Step 3. Choose Device Type
ESP32.
SKIP.
Step 4. Start Edit YAML File
EDIT. We can customize device functionality through YAML files.
The following is the core part of the code. Relevant references and explanations are provided below.
Add the Sensor components
The primary chip module is the HLW8032 energy metering chip, which is responsible for collecting and reading sensor data such as voltage, current, and power.
sensor:
- platform: hlw8032
voltage:
name: HLW8032 Voltage
id: hlw8032_voltage
current:
name: HLW8032 Current
id: hlw8032_current
power:
name: HLW8032 Power
id: hlw8032_power
apparent_power:
name: HLW8032 Apparent Power
id: hlw8032_apparent_power
power_factor:
name: HLW8032 Power Factor
id: hlw8032_power_factor switch:
- platform: gpio
name: "Atom Socket"
pin:
number: GPIO23
inverted: False
restore_mode: ALWAYS_ON INSTALL again to flash and wait for it to complete.
SAVE and INSTALL in the top-right corner, then choose Manual Download in the popup.
Factory format(Previously Modern)
CONNECT to connect to the device.

INSTALL

Settings -> Device & services to check the device.
Discover section.


