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

External Component #219

Open
2 tasks done
jdrescher2006 opened this issue Oct 31, 2024 · 1 comment
Open
2 tasks done

External Component #219

jdrescher2006 opened this issue Oct 31, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@jdrescher2006
Copy link

!!! Before you start !!!

  • I have verified that there is not already an issue with the same problem
  • This is really a bug of current code, not an enhancement request (f.e. adding support for a new device type). There is a dedicated template for feature-requests.

Describe the bug
Local external component is not found during compilation

To Reproduce
Steps to reproduce the behavior:

  1. Create a new device with given yaml.
  2. Copy external components "dps" to folder /opt/iobroker/iobroker-data/esphome.1/components
  3. Compile yaml

Minimal! Yaml config to reproduce.

esphome:
  name: dps
  friendly_name: dps

esp8266:
  board: nodemcuv2

external_components:
   - source:
      type: local
      path: ./components

#external_components:
#  - source: github://syssi/esphome-dps@main
#    refresh: 0s

# Enable logging
logger:
  level: NONE  

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

ota:
  - platform: esphome
    password: "1ed511d992a960e0b38710a3696a93a2"

wifi:
  ssid: !secret wifi_ssid
  password: !secret wifi_password
  manual_ip:
    static_ip: 192.168.0.13
    gateway: 192.168.0.1
    subnet: 255.255.255.0    

web_server:
  local: false

uart:
  id: uart_0
  baud_rate: 9600
  tx_pin: GPIO14
  rx_pin: GPIO12

modbus:
  id: modbus0
  uart_id: uart_0
  send_wait_time: 0ms

dps:
  id: dps0
  modbus_id: modbus0
  update_interval: 5s
  current_resolution: AUTO 

Expected behavior
Local components should work. If the remote github component is used, compilation is successful.

Logs (as screenshot and in text-form)

INFO ESPHome 2024.10.2
INFO Reading configuration /opt/iobroker/iobroker-data/esphome.1/dps.yaml...
INFO Unable to import component dps: No module named 'esphome.components.dps'
Failed config

dps: [source /opt/iobroker/iobroker-data/esphome.1/dps.yaml:53]

Component not found: dps.
id: dps0
modbus_id: modbus0
update_interval: 5s
current_resolution: AUTO

image

Versions:
*** BASE SYSTEM ***
Static hostname: raspberrypi
Icon name: computer
Operating System: Debian GNU/Linux 12 (bookworm)
Kernel: Linux 6.6.51+rpt-rpi-v8
Architecture: arm64
OS is similar to:

Model : Raspberry Pi 4 Model B Rev 1.5
Docker : false
Virtualization : none
Kernel : aarch64
Userland : 64 bit
*** NodeJS-Installation ***
/usr/bin/nodejs v20.18.0
/usr/bin/node v20.18.0
/usr/bin/npm 10.8.2
/usr/bin/npx 10.8.2
/usr/bin/corepack 0.29.3
Core adapters versions
js-controller: 7.0.1
admin: 7.2.6
javascript: 7.8.0
Installed ioBroker-Instances
Used repository: beta
Adapter "admin" : 7.2.6 , installed 7.2.6
Adapter "backitup" : 3.0.26 , installed 3.0.26
Adapter "cul" : 2.2.0 , installed 2.2.0
Adapter "discovery" : 5.0.0 , installed 5.0.0
Adapter "esphome" : 0.5.0-beta.8, installed 0.5.0-beta.8
Adapter "go-e" : 1.0.41 , installed 1.0.40 [Updatable]
Adapter "history" : 3.0.1 , installed 3.0.1
Adapter "javascript" : 8.8.3 , installed 7.8.0 [Updatable]
Controller "js-controller": 7.0.2 , installed 7.0.1 [Updatable]
Adapter "lovelace" : 4.1.10 , installed 4.1.10
Adapter "mqtt" : 6.1.2 , installed 5.2.0 [Updatable]
Adapter "shelly" : 8.4.0 , installed 8.4.0

Additional context
Basically I need this ESPHome project: https://github.com/syssi/esphome-dps
But the problem is that I need to change some cpp files of the components. So I cannot use the remote components.

@jdrescher2006 jdrescher2006 added the bug Something isn't working label Oct 31, 2024
@SimonFischer04
Copy link
Contributor

external_components:

  • source:
    path:

points to the root directory, not the components folder. Think of it like esphome is just cloning the repo, when you specify a git repo. The path is still "github://syssi/esphome-dps@main" not something like "github://syssi/esphome-dps@main/components"

So tldr:
change:

external_components:
   - source:
      type: local
      path: ./components

to

external_components:
   - source:
      type: local
      path: .

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

No branches or pull requests

3 participants