Lyr3x / Roode

A reliable smart home people counter based on VL53L1X and ESPHome
The Unlicense
149 stars 41 forks source link

Platform not found: 'text_sensor.roode' #120

Closed noxhirsch closed 2 years ago

noxhirsch commented 2 years ago

Describe the bug There seem to be some changes in the text sensor in ESPHome v2022.2.0 (and v2022.2.1), that the platform 'text_sensor.roode' isn't found anymore. If I remove my text sensors, I can update the device. I assume that it might have something to do with this PR: https://github.com/esphome/esphome/pull/3172

To Reproduce Steps to reproduce the behavior:

  1. Update ESPHome
  2. Click update on a Roode device with text sensors

Expected behavior A clear and concise description of what you expected to happen.

Screenshots If applicable, add screenshots to help explain your problem.

Additional context

INFO Reading configuration /config/esphome/az-people-counter.yaml...
INFO Updating https://github.com/Lyr3x/Roode@1.5.1
ERROR Unable to load component roode.text_sensor:
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/cb683fcf/components/roode/text_sensor.py", line 25, in <module>
    cv.Optional(CONF_ICON, default="mdi:git"): text_sensor.icon,
AttributeError: module 'esphome.components.text_sensor' has no attribute 'icon'
ERROR Unable to load component roode.text_sensor:
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/cb683fcf/components/roode/text_sensor.py", line 25, in <module>
    cv.Optional(CONF_ICON, default="mdi:git"): text_sensor.icon,
AttributeError: module 'esphome.components.text_sensor' has no attribute 'icon'
Failed config

text_sensor.roode: [source /config/esphome/az-people-counter.yaml:95]

  Platform not found: 'text_sensor.roode'.
  platform: roode
  version: 
    name: AZ PeopleCounter version
text_sensor.roode: [source /config/esphome/az-people-counter.yaml:98]

  Platform not found: 'text_sensor.roode'.
  platform: roode
  entry_exit_event: 
    name: AZ PeopleCounter last direction
Lyr3x commented 2 years ago

Thanks for the report. Currently very busy, but I try to get it fixed quickly. You are right it's about the changed Schema.

noxhirsch commented 2 years ago

Don't stress yourself out about it! Only the update is blocked - the sensors work wonderfully without it :)

nijez commented 2 years ago

Hi. I am using Roode for the first time, and now I have the same problem. My ESPHOME is 2022.2.3, and Roode is the latest version 1.5.1. May I ask if I use the old version or have to wait for the Roode update?

pepe59 commented 2 years ago

In the meantime, remove the text sensors and wait for the update. It will work without them.

nijez commented 2 years ago

How to remove the text sensors

pepe59 commented 2 years ago

Simply delete them in the node configuration

noxhirsch commented 2 years ago

@nijez Or just comment them out with # at the beginning of every line: image

nijez commented 2 years ago

text_sensor.

Thanks for your answer, now I have another error. what do i need to do?

Failed config

sensor.uptime: [source /config/esphome/peopleCounter32.yaml:147] platform: uptime name: Uptime Sensor id: uptime_sensor update_interval: 60s internal: True on_raw_value: [source /config/esphome/peopleCounter32.yaml:153] then: [source /config/esphome/peopleCounter32.yaml:154]

noxhirsch commented 2 years ago

@nijez You can either comment out / remove the "Uptime Sensor", or re-enable the "Uptime Human Readable" text sensor (since it uses the platform "template" instead of Roode).

nijez commented 2 years ago

image either comment out / remove the "Uptime Sensor",

Lyr3x commented 2 years ago

Remove those lambdas