09-22-2025, 03:05 PM
(09-06-2025, 10:44 PM)hl-no Wrote: It looks like there are actually two different issues here:
1) adc_oneshot_new_unit(98): adc1 is already in use
This happens because the YAML is mixing both the external zmpt101b component (from KinCony repo) and ESPHome’s own adc platform sensors on ADC1 pins (GPIO34/35/36/39 with multiplexer on ADC35).
In Arduino-ESP32 3.x, the oneshot driver initializes ADC1, and the custom zmpt101b component also tries to initialize it – which causes a conflict.
How to solve:
Use only one ADC implementation. Either:
A) Drop the external zmpt101b component and read the ZMPT sensors with ESPHome’s adc platform (then apply filters/templates for RMS and scaling), or
B) Keep the external zmpt101b, but remove the ESPHome adc sensor on ADC35 with the multiplexer. Don’t mix both.
As a temporary workaround, you can pin Arduino core back to 2.0.x in platformio_options, but the clean fix is to unify the ADC handling.
2) Compilation error (redefinition of ... ZMPT101BSensor:etup() / update())
This comes from having two definitions of the same class functions: src/ZMPT101B.cpp and the header src/zmpt101b_custom_sensor.h (which already implements setup()/update() inline).
Solution: remove ZMPT101B.cpp or change the header to only contain declarations (move implementation out), so that each function is only defined once.
Summary:
The YAML on page 10 mixes zmpt101b and adc on the same ADC1, which causes the runtime error. The compilation error on page 11 is due to duplicate definitions in the custom component files. Cleaning up so that only one component “owns” ADC1 – and ensuring only one implementation of each function – should fix both problems.
Hello, ok but if I'm using the ESPHome ADC component I'm not able to apply the correct filters. Can you please help me with that? Do you have a proper config file?


etup() / update())