Skip to content

[ESPHome 2025.7] Issues with the new ESPHome version #306

@skgsergio

Description

@skgsergio

Hi, is me and is that time of the month... it works but we have several deprecation errors.

This time some of the issues are just matter of changing the device yaml others need to be taken care but.

Error: 'register_service' was not declared in this scope

Easy fix, ESPHome made a change in esphome/esphome#9451 to conditionally compile API user services so some flash can be saved on devices that doesn't need it.

For YAML services, ESPHome automatically loads it, but for components using CustomAPIDevice in code, you need to enable it in YAML explicitly:

api:
  custom_services: true
Error log
src/esphome/components/ehmtxv2/EHMTX.cpp: In member function 'virtual void esphome::EHMTX::setup()':
src/esphome/components/ehmtxv2/EHMTX.cpp:1016:5: error: 'register_service' was not declared in this scope
1016 |     register_service(&EHMTX::get_status, "get_status");

Warning: legacy adc driver is deprecated

This one is on ESPHome, will be fixed by esphome/esphome#9021

Tested by using the PR as custom component, but users can wait for it to get into a version, is just a warning and works.

external_components:
  - source: github://pr#9021
    components: adc
Error log
In file included from src/esphome/components/adc/adc_sensor.h:9,
                 from src/esphome/components/adc/adc_sensor_common.cpp:1:
/data/cache/platformio/packages/framework-arduinoespressif32-libs/esp32/include/esp_adc/deprecated/include/esp_adc_cal.h:17:2: warning: #warning "legacy adc calibration driver is deprecated, please migrate to use esp_adc/adc_cali.h and esp_adc/adc_cali_scheme.h" [-Wcpp]
   17 | #warning "legacy adc calibration driver is deprecated, please migrate to use esp_adc/adc_cali.h and esp_adc/adc_cali_scheme.h"
      |  ^~~~~~~
In file included from src/esphome/components/adc/adc_sensor.h:10:
/data/cache/platformio/packages/framework-arduinoespressif32-libs/esp32/include/driver/deprecated/driver/adc.h:19:2: warning: #warning "legacy adc driver is deprecated, please migrate to use esp_adc/adc_oneshot.h and esp_adc/adc_continuous.h for oneshot mode and continuous mode drivers respectively" [-Wcpp]
   19 | #warning "legacy adc driver is deprecated, please migrate to use esp_adc/adc_oneshot.h and esp_adc/adc_continuous.h for oneshot mode and continuous mode drivers respectively"
      |  ^~~~~~~
In file included from src/esphome/components/adc/adc_sensor.h:9,
                 from src/esphome/components/adc/adc_sensor_esp32.cpp:3:
/data/cache/platformio/packages/framework-arduinoespressif32-libs/esp32/include/esp_adc/deprecated/include/esp_adc_cal.h:17:2: warning: #warning "legacy adc calibration driver is deprecated, please migrate to use esp_adc/adc_cali.h and esp_adc/adc_cali_scheme.h" [-Wcpp]
   17 | #warning "legacy adc calibration driver is deprecated, please migrate to use esp_adc/adc_cali.h and esp_adc/adc_cali_scheme.h"
      |  ^~~~~~~
In file included from src/esphome/components/adc/adc_sensor.h:10:
/data/cache/platformio/packages/framework-arduinoespressif32-libs/esp32/include/driver/deprecated/driver/adc.h:19:2: warning: #warning "legacy adc driver is deprecated, please migrate to use esp_adc/adc_oneshot.h and esp_adc/adc_continuous.h for oneshot mode and continuous mode drivers respectively" [-Wcpp]
   19 | #warning "legacy adc driver is deprecated, please migrate to use esp_adc/adc_oneshot.h and esp_adc/adc_continuous.h for oneshot mode and continuous mode drivers respectively"
      |  ^~~~~~~

Warning: The legacy RMT driver is deprecated

It works but I guess at some point it will stop working and also the warning in the compile log is ugly.

In this case is just a matter of stop using neopixelbus and use esp32_rmt_led_strip. I had it running for a while now and looks is working right.

This are the required changes in the light entry:

  • change platform neopixelbus to esp32_rmt_led_strip
  • change type key to rgb_order
  • change variant key to chipset
light:
  - platform: esp32_rmt_led_strip
    id: ehmtx_light
    rgb_order: GRB
    internal: true
    chipset: WS2812
    pin: $matrix_pin
    num_leds: 256
    color_correct: [30%, 30%, 30%]
    gamma_correct: 2.0
    name: "$devicename Light"
    restore_mode: ALWAYS_OFF
Error log
In file included from .piolibdeps/pixel-clock/NeoPixelBus/src/internal/methods/NeoEsp32RmtMethod.h:49,
                 from .piolibdeps/pixel-clock/NeoPixelBus/src/internal/NeoMethods.h:59,
                 from .piolibdeps/pixel-clock/NeoPixelBus/src/NeoPixelBus.h:43,
                 from src/esphome/components/neopixelbus/neopixelbus_light.h:12,
                 from src/esphome.h:66,
                 from src/esphome/components/ehmtxv2/EHMTX.cpp:11:
/data/cache/platformio/packages/framework-arduinoespressif32-libs/esp32/include/driver/deprecated/driver/rmt.h:18:2: warning: #warning "The legacy RMT driver is deprecated, please use driver/rmt_tx.h and/or driver/rmt_rx.h" [-Wcpp]
   18 | #warning "The legacy RMT driver is deprecated, please use driver/rmt_tx.h and/or driver/rmt_rx.h"
      |  ^~~~~~~
In file included from .piolibdeps/pixel-clock/NeoPixelBus/src/internal/methods/NeoEsp32RmtMethod.h:49,
                 from .piolibdeps/pixel-clock/NeoPixelBus/src/internal/NeoMethods.h:59,
                 from .piolibdeps/pixel-clock/NeoPixelBus/src/NeoPixelBus.h:43,
                 from src/esphome/components/neopixelbus/neopixelbus_light.h:12,
                 from src/esphome.h:66,
                 from src/esphome/components/ehmtxv2/EHMTX_icons.cpp:1:
/data/cache/platformio/packages/framework-arduinoespressif32-libs/esp32/include/driver/deprecated/driver/rmt.h:18:2: warning: #warning "The legacy RMT driver is deprecated, please use driver/rmt_tx.h and/or driver/rmt_rx.h" [-Wcpp]
   18 | #warning "The legacy RMT driver is deprecated, please use driver/rmt_tx.h and/or driver/rmt_rx.h"
      |  ^~~~~~~

Warning: JSON_ARRAY_SIZE is deprecated and '...::StaticJsonDocument' is deprecated: use JsonDocument instead

This one is on EspHoMaTriXv2, it works but I guess at some point it will stop working and also the warning in the compile log is ugly. It requires some changes in the code that look small, I might give it a try if I have some time in the following days.

Error log
src/esphome/components/ehmtxv2/EHMTX.cpp:590:13: warning: JSON_ARRAY_SIZE is deprecated, you don't need to compute the size anymore
  590 |     const size_t CAPACITY = JSON_ARRAY_SIZE(256);
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                      
src/esphome/components/ehmtxv2/EHMTX.cpp:664:13: warning: JSON_ARRAY_SIZE is deprecated, you don't need to compute the size anymore
  664 |     const size_t CAPACITY = JSON_ARRAY_SIZE(64);
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                       
src/esphome/components/ehmtxv2/EHMTX.cpp:725:13: warning: JSON_ARRAY_SIZE is deprecated, you don't need to compute the size anymore
  725 |     const size_t CAPACITY = JSON_ARRAY_SIZE(64);
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                       
src/esphome/components/ehmtxv2/EHMTX.cpp:927:13: warning: JSON_ARRAY_SIZE is deprecated, you don't need to compute the size anymore
  927 |     const size_t CAPACITY = JSON_ARRAY_SIZE(8);
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                        
src/esphome/components/ehmtxv2/EHMTX.cpp:2507:13: warning: JSON_ARRAY_SIZE is deprecated, you don't need to compute the size anymore
 2507 |     const size_t CAPACITY = JSON_ARRAY_SIZE(72);
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~                                       
src/esphome/components/ehmtxv2/EHMTX.cpp: In member function 'void esphome::EHMTX::bitmap_screen(std::string, int32_t, int32_t)':
src/esphome/components/ehmtxv2/EHMTX.cpp:591:5: warning: 'template<unsigned int N> class ArduinoJson::V742PB22::StaticJsonDocument' is deprecated: use JsonDocument instead [-Wdeprecated-declarations]
  591 |     StaticJsonDocument<CAPACITY> doc;
      |     ^~~~~~~~~~~~~~~~~~
In file included from .piolibdeps/pixel-clock/ArduinoJson/src/ArduinoJson.hpp:65,
                 from .piolibdeps/pixel-clock/ArduinoJson/src/ArduinoJson.h:9,
                 from src/esphome/components/json/json_util.h:11,
                 from src/esphome/core/string_ref.h:11,
                 from src/esphome/core/entity_base.h:5,
                 from src/esphome/components/sensor/sensor.h:4,
                 from src/esphome/components/adc/adc_sensor.h:3,
                 from src/esphome.h:3,
                 from src/esphome/components/ehmtxv2/EHMTX.cpp:11:
.piolibdeps/pixel-clock/ArduinoJson/src/ArduinoJson/compatibility.hpp:63:58: note: declared here
   63 | class ARDUINOJSON_DEPRECATED("use JsonDocument instead") StaticJsonDocument
      |                                                          ^~~~~~~~~~~~~~~~~~
src/esphome/components/ehmtxv2/EHMTX.cpp: In member function 'void esphome::EHMTX::bitmap_small(std::string, std::string, int32_t, int32_t, bool, int32_t, int32_t, int32_t)':
src/esphome/components/ehmtxv2/EHMTX.cpp:665:5: warning: 'template<unsigned int N> class ArduinoJson::V742PB22::StaticJsonDocument' is deprecated: use JsonDocument instead [-Wdeprecated-declarations]
  665 |     StaticJsonDocument<CAPACITY> doc;
      |     ^~~~~~~~~~~~~~~~~~
.piolibdeps/pixel-clock/ArduinoJson/src/ArduinoJson/compatibility.hpp:63:58: note: declared here
   63 | class ARDUINOJSON_DEPRECATED("use JsonDocument instead") StaticJsonDocument
      |                                                          ^~~~~~~~~~~~~~~~~~
src/esphome/components/ehmtxv2/EHMTX.cpp: In member function 'void esphome::EHMTX::rainbow_bitmap_small(std::string, std::string, int32_t, int32_t, bool)':
src/esphome/components/ehmtxv2/EHMTX.cpp:726:5: warning: 'template<unsigned int N> class ArduinoJson::V742PB22::StaticJsonDocument' is deprecated: use JsonDocument instead [-Wdeprecated-declarations]
  726 |     StaticJsonDocument<CAPACITY> doc;
      |     ^~~~~~~~~~~~~~~~~~
.piolibdeps/pixel-clock/ArduinoJson/src/ArduinoJson/compatibility.hpp:63:58: note: declared here
   63 | class ARDUINOJSON_DEPRECATED("use JsonDocument instead") StaticJsonDocument
      |                                                          ^~~~~~~~~~~~~~~~~~
src/esphome/components/ehmtxv2/EHMTX.cpp: In member function 'void esphome::EHMTX::color_gauge(std::string)':
src/esphome/components/ehmtxv2/EHMTX.cpp:928:5: warning: 'template<unsigned int N> class ArduinoJson::V742PB22::StaticJsonDocument' is deprecated: use JsonDocument instead [-Wdeprecated-declarations]
  928 |     StaticJsonDocument<CAPACITY> doc;
      |     ^~~~~~~~~~~~~~~~~~
.piolibdeps/pixel-clock/ArduinoJson/src/ArduinoJson/compatibility.hpp:63:58: note: declared here
   63 | class ARDUINOJSON_DEPRECATED("use JsonDocument instead") StaticJsonDocument
      |                                                          ^~~~~~~~~~~~~~~~~~
src/esphome/components/ehmtxv2/EHMTX.cpp: In member function 'void esphome::EHMTX::icon_prognosis_screen_rgb(std::string, std::string, std::string, int32_t, int32_t, bool, int32_t, int32_t, int32_t)':
src/esphome/components/ehmtxv2/EHMTX.cpp:2508:5: warning: 'template<unsigned int N> class ArduinoJson::V742PB22::StaticJsonDocument' is deprecated: use JsonDocument instead [-Wdeprecated-declarations]
 2508 |     StaticJsonDocument<CAPACITY> doc;
      |     ^~~~~~~~~~~~~~~~~~
.piolibdeps/pixel-clock/ArduinoJson/src/ArduinoJson/compatibility.hpp:63:58: note: declared here
   63 | class ARDUINOJSON_DEPRECATED("use JsonDocument instead") StaticJsonDocument
      |                                                          ^~~~~~~~~~~~~~~~~~

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions