daweizhangau / esphome_addressable_light_digital_display

MIT License
32 stars 1 forks source link

Digital Clock Stopped Compiling in ESP Home #2

Closed DougKennaugh closed 1 month ago

DougKennaugh commented 8 months ago

The last successful compile was ESPHome version 2023.11.6 See arror log below, can you assist?

Traceback (most recent call last): File "/usr/local/bin/esphome", line 33, in sys.exit(load_entry_point('esphome', 'console_scripts', 'esphome')()) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/esphome/esphome/main.py", line 1041, in main return run_esphome(sys.argv) ^^^^^^^^^^^^^^^^^^^^^ File "/esphome/esphome/main.py", line 1028, in run_esphome rc = POST_CONFIG_ACTIONS[args.command](args, config) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/esphome/esphome/main.py", line 458, in command_run exit_code = write_cpp(config) ^^^^^^^^^^^^^^^^^ File "/esphome/esphome/main.py", line 192, in write_cpp generate_cpp_contents(config) File "/esphome/esphome/main.py", line 204, in generate_cpp_contents CORE.flush_tasks() File "/esphome/esphome/core/init.py", line 679, in flush_tasks self.event_loop.flush_tasks() File "/esphome/esphome/coroutine.py", line 246, in flush_tasks next(task.iterator) File "/esphome/esphome/main.py", line 184, in wrapped await coro(conf) File "/data/external_components/38f3f2fd/components/addressable_light_digital_display/display.py", line 86, in to_code await register_display(config, internal_light, digital_display) File "/data/external_components/38f3f2fd/components/addressable_light_digital_display/display.py", line 79, in register_display await cg.register_component(display_var, config) File "/esphome/esphome/cpp_helpers.py", line 56, in register_component raise ValueError( ValueError: Component ID digital_clock was not declared to inherit from Component, or was registered twice. Please create a bug report with your configuration.

bentouspam commented 7 months ago

Hello, I have a similar issue with ESPHome 2023.12.8 here is my configuration file:

esphome:
  name: daweizhangau
  friendly_name: daweizhangau

esp32:
  board: esp32dev
  framework:
    type: arduino

# Enable logging
logger:

# Enable Home Assistant API
api:
  encryption:
    key: "xXHUPmimDTtjB9E1TFeoPNEpgxiEkNlKsiWEREqQvro="

ota:
  password: "d3e65ff6fb98cd584888445a2e82c854"

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Daweizhangau Fallback Hotspot"
    password: "Z00nP4xIcCVh"

captive_portal:

# Enable Web server.
web_server:
  port: 80

external_components:
  - source:
      type: git
      url: https://github.com/daweizhangau/esphome_addressable_light_digital_display
      ref: main
    refresh: 0s

button:
  - platform: shutdown
    name: "$friendly_name Shutdown"
  - platform: restart
    name: "$friendly_name Reboot"

time:
  - platform: sntp
    id: sntp_time
    # Update this time zone string
    timezone: "CET-1CEST,M3.5.0/2,M10.5.0/3"

light:
  - platform: fastled_clockless
    internal: true
    id: internal_light_state
    chipset: WS2812B
    pin: GPIO33
    num_leds: 86
    rgb_order: GRB

display:
  - platform: addressable_light_digital_display
    id: digital_clock
    name: Digital Clock
    light_id: digital_display_light
    icon: "mdi:clock-digital"
    restore_mode: ALWAYS_ON
    default_transition_length: 0s
    addressable_light_id: internal_light_state
    #      A
    #     ---
    #  F |   | B
    #     -G-
    #  E |   | C
    #     ---
    #      D
    led_map:  "GGGEEEDDDCCCBBBAAAFFF GGGEEEDDDCCCBBBAAAFFF . . GGGEEEDDDCCCBBBAAAFFF GGGEEEDDDCCCBBBAAAFFF"
    update_interval: 500ms
    lambda: |-
      if (millis() % 1000 < 500)
        it.strftime("%H:%M", sntp_time->now());
      else
        it.strftime("%H %M", sntp_time->now());

quite standard code, just for starting. here is the error log I get:

INFO ESPHome 2023.12.8
INFO Reading configuration /config/esphome/daweizhangau.yaml...
INFO Updating https://github.com/daweizhangau/esphome_addressable_light_digital_display@main
INFO Generating C++ source...
Traceback (most recent call last):
  File "/usr/local/bin/esphome", line 33, in <module>
    sys.exit(load_entry_point('esphome', 'console_scripts', 'esphome')())
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/esphome/esphome/__main__.py", line 1041, in main
    return run_esphome(sys.argv)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/esphome/esphome/__main__.py", line 1028, in run_esphome
    rc = POST_CONFIG_ACTIONS[args.command](args, config)
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/esphome/esphome/__main__.py", line 458, in command_run
    exit_code = write_cpp(config)
                ^^^^^^^^^^^^^^^^^
  File "/esphome/esphome/__main__.py", line 192, in write_cpp
    generate_cpp_contents(config)
  File "/esphome/esphome/__main__.py", line 204, in generate_cpp_contents
    CORE.flush_tasks()
  File "/esphome/esphome/core/__init__.py", line 679, in flush_tasks
    self.event_loop.flush_tasks()
  File "/esphome/esphome/coroutine.py", line 246, in flush_tasks
    next(task.iterator)
  File "/esphome/esphome/__main__.py", line 184, in wrapped
    await coro(conf)
  File "/data/external_components/38f3f2fd/components/addressable_light_digital_display/display.py", line 86, in to_code
    await register_display(config, internal_light, digital_display)
  File "/data/external_components/38f3f2fd/components/addressable_light_digital_display/display.py", line 79, in register_display
    await cg.register_component(display_var, config)
  File "/esphome/esphome/cpp_helpers.py", line 56, in register_component
    raise ValueError(
ValueError: Component ID digital_clock was not declared to inherit from Component, or was registered twice. Please create a bug report with your configuration.

I really like your integration, I found many codes on the web for clocks using ledstrips, but none integrated in homeassistant. it could be nice to really integrate a clock and display also information from homeassistant. Best regards from Paris, Benoit.

daweizhangau commented 7 months ago

@DougKennaugh @bentouspam Thank you for bringing up this issue. But it's been a while since I created, and I totally forgot how I debugged it. I will definitely look into it when I am available, because do need to use it myself.

DougKennaugh commented 7 months ago

Thanks Dawei

Doug Kennaugh (PrEng) Director

Mobile: +27 83 325 0430

On 29 Jan 2024, at 15:03, Dawei Zhang @.***> wrote:

@DougKennaugh https://github.com/DougKennaugh @bentouspam https://github.com/bentouspam Thank you for bringing up this issue. But it's been a while since I created, and I totally forgot how I debugged it. I will definitely look into it when I am available, because do need to use it myself.

— Reply to this email directly, view it on GitHub https://github.com/daweizhangau/esphome_addressable_light_digital_display/issues/2#issuecomment-1914654094, or unsubscribe https://github.com/notifications/unsubscribe-auth/AI53NPLOV7D5QJXCUH5IE5LYQ6MZBAVCNFSM6AAAAABBMU5LGSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMJUGY2TIMBZGQ. You are receiving this because you were mentioned.

Hunter32R commented 1 month ago

If you delete line 78 "await display.register_display(display_var, config)" in file "display.py", It compiles and seems to work

bentouspam commented 1 month ago

Hello,

I made a little fork on the original github, and it seems to work fine.

I just deleted the line 78.

As I am not a programmer, this is not really meaningful for me 😉

I just can adjust the brightness on the webpage of the device, but I can adjust the color on the Digital Clock properties.

The github is https://github.com/bentouspam/esphome_addressable_light_digital_display/, but just use it for testing purposes, this not my work !!!

Regards,

Benoit.

De : Hunter32R @.> Envoyé : mardi 23 juillet 2024 19:09 À : daweizhangau/esphome_addressable_light_digital_display @.> Cc : Benoit T @.>; Mention @.> Objet : Re: [daweizhangau/esphome_addressable_light_digital_display] Digital Clock Stopped Compiling in ESP Home (Issue #2)

If you delete line 78 "await display.register_display(display_var, config)" in file "display.py", It compiles and seems to work

— Reply to this email directly, view it on GitHub https://github.com/daweizhangau/esphome_addressable_light_digital_display/issues/2#issuecomment-2245790130 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AYIFBGJ6OTQDNWKBKZSY3KLZN2E3PAVCNFSM6AAAAABBMU5LGSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENBVG44TAMJTGA . You are receiving this because you were mentioned. https://github.com/notifications/beacon/AYIFBGOVXRLI34XMUD4HQBTZN2E3PA5CNFSM6AAAAABBMU5LGSWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTUF3QE3E.gif Message ID: @. @.> >

Hunter32R commented 1 month ago

Hello, I made a little fork on the original github, and it seems to work fine. I just deleted the line 78. As I am not a programmer, this is not really meaningful for me 😉 I just can adjust the brightness on the webpage of the device, but I can adjust the color on the Digital Clock properties. The github is https://github.com/bentouspam/esphome_addressable_light_digital_display/, but just use it for testing purposes, this not my work !!! Regards, Benoit. De : Hunter32R @.> Envoyé : mardi 23 juillet 2024 19:09 À : daweizhangau/esphome_addressable_light_digital_display @.> Cc : Benoit T @.>; Mention @.> Objet : Re: [daweizhangau/esphome_addressable_light_digital_display] Digital Clock Stopped Compiling in ESP Home (Issue #2) If you delete line 78 "await display.register_display(display_var, config)" in file "display.py", It compiles and seems to work — Reply to this email directly, view it on GitHub <#2 (comment)> , or unsubscribe https://github.com/notifications/unsubscribe-auth/AYIFBGJ6OTQDNWKBKZSY3KLZN2E3PAVCNFSM6AAAAABBMU5LGSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENBVG44TAMJTGA . You are receiving this because you were mentioned. https://github.com/notifications/beacon/AYIFBGOVXRLI34XMUD4HQBTZN2E3PA5CNFSM6AAAAABBMU5LGSWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTUF3QE3E.gif Message ID: @. @.> >

I control both color and brightness from home assistant

daweizhangau commented 1 month ago

Hi @Hunter32R I have pushed a patch in main branch? I currently do not have a device to test. Could you help testing it? Sorry, for the delay.

Hunter32R commented 1 month ago

I have this code now with line 78 removed, it works fine on the device.

daweizhangau commented 1 month ago

@bentouspam could you try the new patch on 'main'?

Hunter32R commented 1 month ago

I checked it, it compiles, it works.

daweizhangau commented 1 month ago

@Hunter32R Thank you for testing!

bentouspam commented 1 month ago

Tested and validated with the latest version 2024.7.1 !!!

Regards,

Benoit.

De : Dawei Zhang @.> Envoyé : mercredi 24 juillet 2024 16:28 À : daweizhangau/esphome_addressable_light_digital_display @.> Cc : Benoit T @.>; Mention @.> Objet : Re: [daweizhangau/esphome_addressable_light_digital_display] Digital Clock Stopped Compiling in ESP Home (Issue #2)

@bentouspam https://github.com/bentouspam could you try the new patch on 'main'?

— Reply to this email directly, view it on GitHub https://github.com/daweizhangau/esphome_addressable_light_digital_display/issues/2#issuecomment-2248144816 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AYIFBGMNFR53A4PDS2WBNGDZN62YXAVCNFSM6AAAAABBMU5LGSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDENBYGE2DIOBRGY . You are receiving this because you were mentioned. https://github.com/notifications/beacon/AYIFBGINPZMTGRSHFFBH33LZN62YXA5CNFSM6AAAAABBMU5LGSWGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTUF7733A.gif Message ID: @. @.> >

daweizhangau commented 1 month ago

@Hunter32R @bentouspam Thank you for your support! This issue is closed.