KaufHA/PLF10

Error with installing config to plug

Closed this issue · 7 comments

INFO Reading configuration /config/esphome/kauf-plug-ebda6e.yaml...
INFO Updating https://github.com/KaufHA/common@None
INFO Updating https://github.com/KaufHA/PLF10@None
ERROR Unable to import component switch:
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/73d8076b/components/switch/__init__.py", line 6, in <module>
    from esphome.const import (
ImportError: cannot import name 'DEVICE_CLASS_OUTLET' from 'esphome.const' (/esphome/esphome/const.py)
INFO Detected timezone 'America/Chicago'
Failed config

My config file:

esphome:
  name: kauf-plug

# Enable logging
logger:

# Enable Home Assistant API
api:

ota:
  password: "<random_string>"

wifi:
  ssid: xxxxxx
  password: xxxxxxx
  manual_ip:
    static_ip: 10.211.x.y
    gateway: 10.211.x.1
    subnet: 255.255.255.0
    
  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Kauf-Plug"
    password: "xxxxxxxx"

captive_portal:

packages:
  kauf.plf10: github://KaufHA/PLF10/kauf-plug.yaml

substitutions:
  name: kauf-plug
  friendly_name: Kauf Plug

Do you have ESPHome updated to 2022.2.1? Just came out today.

No, looks like I have 2022.2.0.

Does 2022.2.1 fix/address this?

It shouldn't matter between 2022.2.1 and 2022.2.0. Either should work. The other thing I can think of is to delete the packages and external_components subfolders from the .esphome folder in the esphome config directory. That will force a redownload, which might help if something isn't updating right. I'll have some time to look into this in more detail this afternoon if that doesn't fix it.

ok, let me try to find the esphome config directory (I am using hass IO version) and I will update here shortly.

Should be config/esphome/.esphome if you are accessing via samba. Make sure you are showing hidden directories. You can also delete the subfolders through the Visual Studio Code addon I think.

Thanks. I found it, removed the external_components subfolder and am building again now ... I will update here when (hopefully) done.

Also delete the packages folder if that doesn't work.