![]() |
|
KC868-M16v2 configure yaml for ESPhome - Printable Version +- Smart Home Automation Forum (https://www.kincony.com/forum) +-- Forum: Technical Support (https://www.kincony.com/forum/forumdisplay.php?fid=20) +--- Forum: KC868-M16 / M1 / MB / M30 (https://www.kincony.com/forum/forumdisplay.php?fid=50) +--- Thread: KC868-M16v2 configure yaml for ESPhome (/showthread.php?tid=3088) |
RE: KC868-M16v2 configure yaml for ESPhome - admin - 09-02-2025 it showed "adc1 is already in use", please check whether is redefined. RE: KC868-M16v2 configure yaml for ESPhome - cignu - 09-02-2025 Can I create a new "Total Daily Energy2" entity on my M16 composed of only some of the connected sensors? Can anybody direct me on where to start? Thank you RE: KC868-M16v2 configure yaml for ESPhome - carrrettamarco - 09-04-2025 (09-02-2025, 11:34 AM)admin Wrote: it showed "adc1 is already in use", please check whether is redefined. Look, this is the code you provided, 1:1. the component adc1 is not even defined, it is definitely part of the library you generate on Git. I need help please! RE: KC868-M16v2 configure yaml for ESPhome - Savged - 09-05-2025 Hello can you help me with these errors: INFO Compiling app... Processing 1n-energija (board: esp32dev; framework: arduino; platform: https://github.com/pioarduino/platform-espressif32/releases/download/54.03.21-2/platform-espressif32.zip) -------------------------------------------------------------------------------- INFO Package configuration completed successfully INFO Package configuration completed successfully HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash - framework-arduinoespressif32 @ 3.2.1 - framework-arduinoespressif32-libs @ 5.4.0+sha.858a988d6e - tool-esptoolpy @ 5.0.2 - tool-mklittlefs @ 3.2.0 - toolchain-xtensa-esp-elf @ 14.2.0+20241119 Dependency Graph |-- Networking @ 3.2.1 |-- AsyncTCP @ 3.4.5 |-- WiFi @ 3.2.1 |-- FS @ 3.2.1 |-- Update @ 3.2.1 |-- ESPAsyncWebServer @ 3.7.10 |-- ESPmDNS @ 3.2.1 |-- noise-c @ 0.1.10 |-- Wire @ 3.2.1 |-- ArduinoJson @ 7.4.2 Compiling .pioenvs/1n-energija/src/ZMPT101B.cpp.o Compiling .pioenvs/1n-energija/src/esphome/components/display/display_buffer.cpp.o Compiling .pioenvs/1n-energija/src/esphome/components/display/rect.cpp.o Compiling .pioenvs/1n-energija/src/esphome/components/esp32/core.cpp.o src/ZMPT101B.cpp:9:6: error: redefinition of 'void esphome::zmpt101b::ZMPT101BSensor: etup()'9 | void ZMPT101BSensor: etup() {| ^~~~~~~~~~~~~~ In file included from src/ZMPT101B.cpp:1: src/zmpt101b_custom_sensor.h:23:8: note: 'virtual void esphome::zmpt101b::ZMPT101BSensor: etup()' previously defined here23 | void setup() override { | ^~~~~ src/ZMPT101B.cpp:14:6: error: redefinition of 'void esphome::zmpt101b::ZMPT101BSensor::update()' 14 | void ZMPT101BSensor::update() { | ^~~~~~~~~~~~~~ src/zmpt101b_custom_sensor.h:28:8: note: 'virtual void esphome::zmpt101b::ZMPT101BSensor::update()' previously defined here 28 | void update() override { | ^~~~~~ *** [.pioenvs/1n-energija/src/ZMPT101B.cpp.o] Error 1 ========================= [FAILED] Took 26.30 seconds ========================= RE: KC868-M16v2 configure yaml for ESPhome - hl-no - 09-06-2025 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. RE: KC868-M16v2 configure yaml for ESPhome - alexnino881 - 09-17-2025 (08-25-2025, 04:50 PM)alexnino881 Wrote:(03-06-2024, 11:39 AM)admin Wrote: do you install your home assistant on a raspberry pi? i suggest you delete your ESPhome, re install it.i was able to figure it it out, it works well on both wifi and ethernet. but the issue now is that am having the mcu crashing when i add SD card library. it seems to be hainh confict with the ethernet. any solution to this or a sample code with ethernet and SD card together? RE: KC868-M16v2 configure yaml for ESPhome - carrrettamarco - 09-22-2025 (09-06-2025, 10:44 PM)hl-no Wrote: It looks like there are actually two different issues here: 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? RE: KC868-M16v2 configure yaml for ESPhome - geo_dav - 09-30-2025 After some assistance please with getting my 868-M16-V2.1 board at least connected/visible in HA. Have read through most of this forum and seems a regular issue people had was updates to ESP making the sample YAML file outdated. I can connect my board. Prep for use, and connect all OK ... and have pulled the newest sample YAML file from here, but still errors all over the place when I try to compile/run .... any help with ID'ing/Fixing, or a new up-to-date sample YAML file that works would be appreciated .... cheers. INFO ESPHome 2025.9.1 INFO Reading configuration /config/esphome/KC868-M16v2-ESPHome.yaml... WARNING [ethernet] The 'clk_mode' option is deprecated and will be removed in ESPHome 2026.1. Please update your configuration to use 'clk' instead. WARNING GPIO5 is a strapping PIN and should only be used for I/O with care. Attaching external pullup/down resistors to strapping pins can cause unexpected failures. See https://esphome.io/guides/faq.html#why-am-i-getting-a-warning-about-strapping-pins WARNING Using `sensor.SENSOR_SCHEMA` is deprecated and will be removed in ESPHome 2025.11.0. Please use `sensor.sensor_schema(...)` instead. If you are seeing this, report an issue to the external_component author and ask them to update it. https://developers.esphome.io/blog/2025/05/14/_schema-deprecations/. Component using this schema: zmpt101b_ns WARNING Using `sensor.SENSOR_SCHEMA` is deprecated and will be removed in ESPHome 2025.11.0. Please use `sensor.sensor_schema(...)` instead. If you are seeing this, report an issue to the external_component author and ask them to update it. https://developers.esphome.io/blog/2025/05/14/_schema-deprecations/. Component using this schema: zmpt101b_ns WARNING Using `sensor.SENSOR_SCHEMA` is deprecated and will be removed in ESPHome 2025.11.0. Please use `sensor.sensor_schema(...)` instead. If you are seeing this, report an issue to the external_component author and ask them to update it. https://developers.esphome.io/blog/2025/05/14/_schema-deprecations/. Component using this schema: zmpt101b_ns WARNING `attenuation: 11db` is deprecated, use `attenuation: 12db` instead INFO Detected timezone 'Australia/Sydney' INFO Generating C++ source... INFO Compiling app... Processing m16v2 (board: esp32dev; framework: arduino; platform: https://github.com/pioarduino/platform-espressif32/releases/download/54.03.21-2/platform-espressif32.zip) -------------------------------------------------------------------------------- INFO Package configuration completed successfully INFO Package configuration completed successfully HARDWARE: ESP32 240MHz, 320KB RAM, 4MB Flash - framework-arduinoespressif32 @ 3.2.1 - framework-arduinoespressif32-libs @ 5.4.0+sha.858a988d6e - tool-esptoolpy @ 5.0.2 - tool-mklittlefs @ 3.2.0 - toolchain-xtensa-esp-elf @ 14.2.0+20241119 Traceback (most recent call last): File "<frozen runpy>", line 198, in _run_module_as_main File "<frozen runpy>", line 88, in _run_code File "/usr/local/lib/python3.12/site-packages/pip/__main__.py", line 22, in <module> from pip._internal.cli.main import main as _main File "/usr/local/lib/python3.12/site-packages/pip/_internal/cli/main.py", line 11, in <module> from pip._internal.cli.autocompletion import autocomplete File "/usr/local/lib/python3.12/site-packages/pip/_internal/cli/autocompletion.py", line 12, in <module> from pip._internal.cli.main_parser import create_main_parser File "/usr/local/lib/python3.12/site-packages/pip/_internal/cli/main_parser.py", line 9, in <module> from pip._internal.build_env import get_runnable_pip File "/usr/local/lib/python3.12/site-packages/pip/_internal/build_env.py", line 19, in <module> from pip._internal.cli.spinners import open_spinner File "/usr/local/lib/python3.12/site-packages/pip/_internal/cli/spinners.py", line 22, in <module> from pip._internal.utils.logging import get_console, get_indentation File "/usr/local/lib/python3.12/site-packages/pip/_internal/utils/logging.py", line 25, in <module> from pip._vendor.rich.logging import RichHandler File "<frozen importlib._bootstrap>", line 1360, in _find_and_load File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 935, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 995, in exec_module File "<frozen importlib._bootstrap_external>", line 1128, in get_code File "<frozen importlib._bootstrap_external>", line 757, in _compile_bytecode ValueError: bad marshal data (unknown type code) Warning! Couldn't extract the list of installed Python packages. Installing Arduino Python dependencies Traceback (most recent call last): File "<frozen runpy>", line 198, in _run_module_as_main File "<frozen runpy>", line 88, in _run_code File "/usr/local/lib/python3.12/site-packages/pip/__main__.py", line 22, in <module> from pip._internal.cli.main import main as _main File "/usr/local/lib/python3.12/site-packages/pip/_internal/cli/main.py", line 11, in <module> from pip._internal.cli.autocompletion import autocomplete File "/usr/local/lib/python3.12/site-packages/pip/_internal/cli/autocompletion.py", line 12, in <module> from pip._internal.cli.main_parser import create_main_parser File "/usr/local/lib/python3.12/site-packages/pip/_internal/cli/main_parser.py", line 9, in <module> from pip._internal.build_env import get_runnable_pip File "/usr/local/lib/python3.12/site-packages/pip/_internal/build_env.py", line 19, in <module> from pip._internal.cli.spinners import open_spinner File "/usr/local/lib/python3.12/site-packages/pip/_internal/cli/spinners.py", line 22, in <module> from pip._internal.utils.logging import get_console, get_indentation File "/usr/local/lib/python3.12/site-packages/pip/_internal/utils/logging.py", line 25, in <module> from pip._vendor.rich.logging import RichHandler File "<frozen importlib._bootstrap>", line 1360, in _find_and_load File "<frozen importlib._bootstrap>", line 1331, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 935, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 995, in exec_module File "<frozen importlib._bootstrap_external>", line 1128, in get_code File "<frozen importlib._bootstrap_external>", line 757, in _compile_bytecode ValueError: bad marshal data (unknown type code) *** Error 1 Dependency Graph |-- Networking @ 3.2.1 |-- AsyncTCP @ 3.4.5 |-- WiFi @ 3.2.1 |-- FS @ 3.2.1 |-- Update @ 3.2.1 |-- ESPAsyncWebServer @ 3.7.10 |-- ESPmDNS @ 3.2.1 |-- noise-c @ 0.1.10 |-- Wire @ 3.2.1 |-- ArduinoJson @ 7.4.2 Compiling .pioenvs/m16v2/lib4c5/Network/NetworkClient.cpp.o sh: 1: xtensa-esp32-elf-g++: not found *** [.pioenvs/m16v2/lib4c5/Network/NetworkClient.cpp.o] Error 127 Compiling .pioenvs/m16v2/lib4c5/Network/NetworkEvents.cpp.o sh: 1: xtensa-esp32-elf-g++: not found *** [.pioenvs/m16v2/lib4c5/Network/NetworkEvents.cpp.o] Error 127 ========================= [FAILED] Took 20.27 seconds ========================= RE: KC868-M16v2 configure yaml for ESPhome - athxp - 10-19-2025 Hi, On the m16V2, I'm getting incorrect voltage and current values. They're low. To make the corrections, do I need to reload the yams file on the ESP32, or can I just edit it from Home Assistant? RE: KC868-M16v2 configure yaml for ESPhome - admin - 10-19-2025 you can re download firmware. Or edit from home assistant for calibration. |