Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Platform not found: 'text_sensor.roode' #120

Closed
noxhirsch opened this issue Feb 17, 2022 · 11 comments · Fixed by #122
Closed

Platform not found: 'text_sensor.roode' #120

noxhirsch opened this issue Feb 17, 2022 · 11 comments · Fixed by #122
Labels
bug Something isn't working

Comments

@noxhirsch
Copy link

noxhirsch commented Feb 17, 2022

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: esphome/esphome#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
Copy link
Owner

Lyr3x commented Feb 17, 2022

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

@Lyr3x Lyr3x added the bug Something isn't working label Feb 17, 2022
@noxhirsch
Copy link
Author

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

@nijez
Copy link

nijez commented Feb 19, 2022

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
Copy link

pepe59 commented Feb 19, 2022

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

@nijez
Copy link

nijez commented Feb 20, 2022

How to remove the text sensors

@pepe59
Copy link

pepe59 commented Feb 20, 2022

Simply delete them in the node configuration

@noxhirsch
Copy link
Author

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

@nijez
Copy link

nijez commented Feb 21, 2022

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]
- [source /config/esphome/peopleCounter32.yaml:154]

    Unable to find action with the name 'text_sensor.template.publish'.
    text_sensor.template.publish:  [source /config/esphome/peopleCounter32.yaml:155]
      id: uptime_human
      state: !lambda |-
        int seconds = round(id(uptime_sensor).raw_state);
        int days = seconds / (24 * 3600);
        seconds = seconds % (24 * 3600);
        int hours = seconds / 3600;
        seconds = seconds % 3600;
        int minutes = seconds /  60;
        seconds = seconds % 60;
        return (
          (days ? String(days) + "d " : "") +
          (hours ? String(hours) + "h " : "") +
          (minutes ? String(minutes) + "m " : "") +
          (String(seconds) + "s")
        ).c_str();

@noxhirsch
Copy link
Author

@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
Copy link

nijez commented Feb 21, 2022

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

@Lyr3x
Copy link
Owner

Lyr3x commented Feb 21, 2022

Remove those lambdas

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants