KaufHA / kauf-rgbww-bulbs

Files for the KAUF RGBWW Smart Bulbs
40 stars 18 forks source link

Error upgrading #11

Closed Exit2Studios closed 1 year ago

Exit2Studios commented 2 years ago

I'm getting the following error when trying to update in esphome. Running esphome v2022.4.0. I have 3 bulbs running the same firmware and yaml and one of them is no longer showing up in Home Assistant.

INFO Reading configuration /config/esphome/office-desk-lamp-left.yaml... INFO Updating https://github.com/KaufHA/kauf-rgbww-bulbs@None Failed config

external_components: [source /config/esphome/office-desk-lamp-left.yaml:16]

bkaufx commented 2 years ago

It's weird that ESPHome would throw that error without first updating the 'common' github repo that that component comes from. Does your office-desk-lamp-left.yaml file refer to https://github.com/KaufHA/kauf-rgbww-bulbs/blob/main/kauf-bulb.yaml as a package? (would use yaml as follows)

packages:
  kauf.rgbww: github://KaufHA/kauf-rgbww-bulbs/kauf-bulb.yaml

What are the contents of the /config/esphome/.esphome/external_components/69101fc3/components/web_server/ folder?

Try deleting folders /config/esphome/.esphome/external_components/ and /config/esphome/.esphome/packages/ again. Restart ESPHome add-on as well.

Exit2Studios commented 2 years ago

image

I see no mention of packages in the yaml.

Exit2Studios commented 2 years ago

The problem now appears that my one light is offline and not showing up on my router.

bkaufx commented 2 years ago

Sorry, that image is of an older yaml version. I would recommend that you grab the newest yaml and more preferable would be to incorporate the github version as a package.

This is really all you need in office-desk-lamp-left.yaml:

substitutions:
  name: office-desk-lamp-left
  friendly_name: Office Desk Lamp Left

packages:
  kauf.rgbww: github://KaufHA/kauf-rgbww-bulbs/kauf-bulb.yaml

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

For the light that is offline and not showing up, does the light turn on at all or does it appear to be completely dead? Have you checked for its fallback wifi hotspot? Try powering down and back up the bulb a couple of times and then looking for the hotspot.

Exit2Studios commented 2 years ago

The bulb turns on, but doesn’t connect to my router and I don’t see the hotspot. Is my only other option to flash it physically?


From: Brian Kaufman @.> Sent: Wednesday, April 27, 2022 11:57:04 AM To: KaufHA/kauf-rgbww-bulbs @.> Cc: Exit2Studios @.>; Author @.> Subject: Re: [KaufHA/kauf-rgbww-bulbs] Error upgrading (Issue #11)

Sorry, that image is of an older yaml version. I would recommend that you grab the newest yaml https://github.com/KaufHA/kauf-rgbww-bulbs/blob/main/kauf-bulb.yaml and more preferable would be to incorporate the github version as a package.

This is really all you need in office-desk-lamp-left.yaml:

substitutions: name: office-desk-lamp-left friendly_name: Office Desk Lamp Left

packages: kauf.rgbww: github://KaufHA/kauf-rgbww-bulbs/kauf-bulb.yaml

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

For the light that is offline and not showing up, does the light turn on at all or does it appear to be completely dead? Have you checked for its fallback wifi hotspot? Try powering down and back up the bulb a couple of times and then looking for the hotspot.

— Reply to this email directly, view it on GitHubhttps://github.com/KaufHA/kauf-rgbww-bulbs/issues/11#issuecomment-1111243364, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AEBAESZDXN3RUKWMN6LS7LLVHFWWBANCNFSM5UMLYJ4A. You are receiving this because you authored the thread.Message ID: @.***>

KaufHA commented 2 years ago

Yea, that's probably what you're going to have to do. If you can't get it, send your address to me at brian@kaufha.com and I can send a replacement.

Another thing would be to just double check your router / dhcp server to make sure it's not to blame by either being full or blocking new connections for whatever reason.

aznnomness commented 2 years ago

I had similar issues. I manually installed ESPHome v1.84 via OTA and my bulb was on but offline. I had to turn the bulb off, back on for 10-15 seconds, back off, and then back on. After doing that, my laptop was able to see the AP and I reconnected the bulb to my home network.

I am using ESPHome Add-on in Home Assistant and when validating my YAML I get the following (nothing changed on my end):

INFO Reading configuration /config/esphome/office-desk-left-kaufha-esp.yaml...
INFO Updating https://github.com/KaufHA/common@None
INFO Updating https://github.com/KaufHA/kauf-rgbww-bulbs@None
ERROR Unable to import component select:
Traceback (most recent call last):
  File "/esphome/esphome/loader.py", line 162, in _lookup_module
    module = importlib.import_module(f"esphome.components.{domain}")
  File "/usr/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 790, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/config/esphome/.esphome/external_components/4d68583c/components/select/__init__.py", line 6, in <module>
    from esphome.const import (
ImportError: cannot import name 'CONF_CYCLE' from 'esphome.const' (/esphome/esphome/const.py)
ERROR Unable to import component number:
Traceback (most recent call last):
  File "/esphome/esphome/loader.py", line 162, in _lookup_module
    module = importlib.import_module(f"esphome.components.{domain}")
  File "/usr/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 790, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/config/esphome/.esphome/external_components/4d68583c/components/number/__init__.py", line 6, in <module>
    from esphome.const import (
ImportError: cannot import name 'CONF_OPERATION' from 'esphome.const' (/esphome/esphome/const.py)
Failed config

select: [source /config/esphome/.esphome/packages/0cf47246/kauf-bulb.yaml:221]

  Component not found: select.
  - platform: template
    name: OfficeDeskLeft Effect
    id: effect
    optimistic: True
    options: 
      - None
      - WLED / DDP
    initial_option: None
    restore_value: True
    icon: mdi:string-lights
    set_action: 
      - delay: 1ms
      - script.execute: script_set_wled
      - script.execute: script_save_changes
    entity_category: config
    forced_hash: 5841966
    forced_addr: 66
    global_addr: global_forced_addr
  - platform: template
    name: OfficeDeskLeft DDP Debug
    id: select_ddp_debug
    optimistic: True
    options: 
      - Print no packets
      - Print imperfect packets
      - Print all packets
    initial_option: Print no packets
    restore_value: False
    icon: mdi:play-network
    entity_category: diagnostic
    disabled_by_default: true
    set_action: 
      - lambda: |-
          if      ( x == "Print no packets" )        { id(kauf_light)->set_ddp_debug(0); }
          else if ( x == "Print imperfect packets" ) { id(kauf_light)->set_ddp_debug(1); }
          else if ( x == "Print all packets" )       { id(kauf_light)->set_ddp_debug(2); }
  - platform: template
    name: OfficeDeskLeft Power On State
    id: select_boot_state
    optimistic: True
    options: 
      - Restore Power Off State
      - Always On - Last Value
      - Always On - Bright White
      - Always Off
      - YAML Configured (RESTORE_INVERTED_DEFAULT_OFF)
    initial_option: Restore Power Off State
    restore_value: True
    icon: mdi:restart-alert
    set_action: 
      - delay: 1ms
      - script.execute: script_save_changes
      - script.execute: script_set_boot_mode
      - lambda: kauf_light->save_remote_values_();
    entity_category: config
    forced_hash: 3524332562
    forced_addr: 64
    global_addr: global_forced_addr
number: [source /config/esphome/.esphome/packages/0cf47246/kauf-bulb.yaml:289]

  Component not found: number.
  - platform: template
    name: OfficeDeskLeft Max Power
    min_value: 1
    max_value: 100
    step: 1
    initial_value: 80
    id: number_max_power
    entity_category: config
    disabled_by_default: true
    icon: mdi:brightness-percent
    optimistic: True
    restore_value: True
    unit_of_measurement: %
    mode: box
    forced_hash: 4189052763
    forced_addr: 74
    global_addr: global_forced_addr
    on_value: 
      - delay: 1ms
      - script.execute: script_max_power
      - script.execute: script_save_changes
  - platform: template
    name: OfficeDeskLeft Default Fade
    min_value: 0
    max_value: 5000
    step: 50
    initial_value: 250
    id: number_default_fade
    entity_category: config
    icon: mdi:timer-outline
    optimistic: True
    restore_value: True
    unit_of_measurement: ms
    mode: box
    forced_hash: 3133748577
    forced_addr: 72
    global_addr: global_forced_addr
    on_value: 
      - delay: 1ms
      - script.execute: script_default_fade
      - script.execute: script_save_changes

Here is my config:

substitutions:

  # **** CHANGE FRIENDLY NAME TO SOMETHING UNIQUE PER DEVICE ****
  name: office-desk-left-kaufha-esp
  friendly_name: OfficeDeskLeft

packages:
  kauf.rgbww: github://KaufHA/kauf-rgbww-bulbs/kauf-bulb.yaml

wifi:

  # **** ENTER WI-FI CREDENTIALS HERE, USING SECRETS.YAML RECOMMENDED ****
  ssid: IoT24           # !secret wifi_ssid
  password: !secret iot_24_password # !secret wifi_password

  # Uncomment below to set a static IP
  # manual_ip:
  #   static_ip: !secret kauf_bulb_rgb_ip_address
  #   gateway: !secret wifi_gateway
  #   subnet: !secret wifi_subnet
  #   dns1: !secret wifi_dns1

  # use_address allows wireless programming through dashboard.
  # Set to the bulb's IP Address.  Remove after programming.
  use_address: 192.168.20.100

  # default is 20, 17 is recommended.
  output_power: 17

  # using fast_connect as default since it is required for hidden networks.
  # feel free to change or override.
  fast_connect: true

I also found that if your friendly_name is too long you'll get an error validating your config in ESPHome. I had to trim mine down to get around that.

bkaufx commented 2 years ago

Make sure you are on the latest ESPHome version (2022.5.0 or 2022.5.1). Also try deleting the .esphome/packages folder from within your ESPHome config directory. Restart ESPHome addon.

aznnomness commented 2 years ago

Home Assistant is reporting I am running the most recent version of ESPHome Add-on at version 2022.3.1. I will try deleting the .esphome/package directory.

bkaufx commented 2 years ago

Actually, I believe what you need to do is uninstall the ESPHome add on and re-install using their new repo. This link gives directions for the official Repo: https://esphome.io/guides/getting_started_hassio.html. The old repo is no longer updated. If you go to the add-ons settings page of your home assistant I believe you will see this:

image

bkaufx commented 2 years ago

Make sure you backup all your esphome device yaml files first.

bkaufx commented 2 years ago

This is the repo you need to add in the add-ons settings menu: https://github.com/esphome/home-assistant-addon

aznnomness commented 2 years ago

Am I going to need to back up the kauf-bulb-aux.h and kauf-bulb-main..h files?

bkaufx commented 2 years ago

No those files are not used anymore. You don't need them anymore at all. You only need these lines in your device yaml file and everything else is taken care of:

packages:
  kauf.rgbww: github://KaufHA/kauf-rgbww-bulbs/kauf-bulb.yaml
aznnomness commented 2 years ago

Looks like that resolved my issues, thank you!