Code Monkey home page Code Monkey logo

Comments (12)

ssieb avatar ssieb commented on July 21, 2024

Sorry, I thought I had tested it after the rename. The binary_sensor was still requiring keypad. I just pushed a fix.

from esphome_components.

r0667002 avatar r0667002 commented on July 21, 2024

It's still not working for me

from esphome_components.

ssieb avatar ssieb commented on July 21, 2024

What's happening?

from esphome_components.

r0667002 avatar r0667002 commented on July 21, 2024

ESPHome version: 2022.9.1

I'm using the following code:

esphome:
  name: alarm-control
  platform: ESP8266
  board: d1_mini

# Enable logging
logger:

# Enable Home Assistant API
api:

ota:
  password: !secret ap_password

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

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Fallback Hotspot"
    password: !secret ap_password

captive_portal:

external_components:
  - source: github://ssieb/custom_components

matrix_keypad:
  id: mykeypad
  rows:
    - pin: D0
    - pin: RX
    - pin: TX
    - pin: D3
  columns:
    - pin: D4
    - pin: D5
    - pin: D6
    - pin: D7
  keys: "123A456B789C*0#D"
  has_diodes: false

binary_sensor:
  - platform: matrix_keypad
    keypad_id: mykeypad
    name: keyA
    id: keyA
    row: 0
    col: 3
  - platform: matrix_keypad
    keypad_id: mykeypad
    name: keyB
    id: keyB
    row: 1
    col: 3
  - platform: matrix_keypad
    keypad_id: mykeypad
    name: keyC
    id: keyC
    row: 2
    col: 3
  - platform: matrix_keypad
    keypad_id: mykeypad
    name: keyD
    id: keyD
    row: 3
    col: 3

text_sensor:
  - platform: matrix_keypad
    id: reader
    name: insertedcode
    keypad_id: mykeypad
    max_length: 4
    end_keys: "#"
    back_keys: "*"
    allowed_keys: "0123456789"
    on_progress:
      - logger.log: 
          format: "input progress: '%s'"
          args: [ 'x.c_str()' ]
    on_value:
      - logger.log: 
          format: "input result: '%s'"
          args: [ 'x.c_str()' ]

But getting the error messages:

  • Component binary_sensor.matrix_keypad requires component keypad.
  • Platform not found: 'text_sensor.matrix_keypad'.

If I just try keypad as a component instead of matrix_keypad, I get the no CONFIG_SCHEMA error as listed above.

from esphome_components.

DrBanarne avatar DrBanarne commented on July 21, 2024

I tried it again now since it up til now still complained about that it could not find component keypad and matrix_keypad didn't work either.
Today matrix_keypad does not generate any errors in the editor but as r0667002 says I get error: "Component binary_sensor.matrix_keypad requires component keypad."
If I remove the binary_sensor section it validates, but when it compiles I get error:

In file included from src/esphome/components/matrix_keypad/keypad.cpp:1:
src/esphome/components/matrix_keypad/keypad.h:3:10: fatal error: esphome/components/key_provider/key_provider.h: No such file or directory
3 | #include "esphome/components/key_provider/key_provider.h"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.

from esphome_components.

ssieb avatar ssieb commented on July 21, 2024

Oops! I committed it locally, but forgot to push it! 🤦‍♂️
For the second error, did you include key_provider in the external component config?

from esphome_components.

DrBanarne avatar DrBanarne commented on July 21, 2024

Yes, it's included. Tried with "components: [ matrix_keypad, key_provider ]" and also without to be sure. I still get this when installing:

Processing light-controller-house (board: d1_mini; framework: arduino; platform: platformio/espressif8266 @ 3.2.0)

HARDWARE: ESP8266 80MHz, 80KB RAM, 4MB Flash
LDF: Library Dependency Finder -> https://bit.ly/configure-pio-ldf
Dependency Graph
|-- ESPAsyncTCP-esphome @ 1.2.3
|-- ESPAsyncWebServer-esphome @ 2.1.0
| |-- ESPAsyncTCP-esphome @ 1.2.3
| |-- Hash @ 1.0
| |-- ESP8266WiFi @ 1.0
|-- DNSServer @ 1.1.1
|-- ESP8266WiFi @ 1.0
|-- ESP8266mDNS @ 1.2
|-- Wire @ 1.0
Compiling /data/light-controller-house/.pioenvs/light-controller-house/src/esphome/components/matrix_keypad/keypad.cpp.o
In file included from src/esphome/components/matrix_keypad/keypad.cpp:1:
src/esphome/components/matrix_keypad/keypad.h:3:10: fatal error: esphome/components/key_provider/key_provider.h: No such file or directory
3 | #include "esphome/components/key_provider/key_provider.h"
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Compiling /data/light-controller-house/.pioenvs/light-controller-house/src/esphome/components/mdns/mdns_esp8266.cpp.o
Compiling /data/light-controller-house/.pioenvs/light-controller-house/src/esphome/components/mdns/mdns_esp_idf.cpp.o
*** [/data/light-controller-house/.pioenvs/light-controller-house/src/esphome/components/matrix_keypad/keypad.cpp.o] Error 1
Compiling /data/light-controller-house/.pioenvs/light-controller-house/src/esphome/components/network/util.cpp.o
========================= [FAILED] Took 12.21 seconds =========================

from esphome_components.

ssieb avatar ssieb commented on July 21, 2024

I see the problem. I was always testing with the input_builder which autoloads the provider. I pushed a fix.

from esphome_components.

r0667002 avatar r0667002 commented on July 21, 2024

Works for me! Except for the text sensor. Any reason you removed it?

Working code for others (downloaded the folders manually and put them in esphome/custom_components

esphome:
  name: alarm-control
  platform: ESP8266
  board: d1_mini

# Enable logging
logger:

# Enable Home Assistant API
api:

ota:
  password: !secret ap_password

wifi:
  ssid: !secret wifi_ssid_upstairs
  password: !secret wifi_password

  # Enable fallback hotspot (captive portal) in case wifi connection fails
  ap:
    ssid: "Fallback Hotspot"
    password: !secret ap_password

captive_portal:

external_components:
  - source:
      type: local
      path: custom_components

matrix_keypad:
  id: mykeypad
  rows:
    - pin: D0
    - pin: RX
    - pin: TX
    - pin: D3
  columns:
    - pin: D4
    - pin: D5
    - pin: D6
    - pin: D7
  keys: "123A456B789C*0#D"
  has_diodes: false

binary_sensor:
  - platform: matrix_keypad
    keypad_id: mykeypad
    name: keyA
    id: keyA
    row: 0
    col: 3
  - platform: matrix_keypad
    keypad_id: mykeypad
    name: keyB
    id: keyB
    row: 1
    col: 3
  - platform: matrix_keypad
    keypad_id: mykeypad
    name: keyC
    id: keyC
    row: 2
    col: 3
  - platform: matrix_keypad
    keypad_id: mykeypad
    name: keyD
    id: keyD
    row: 3
    col: 3

from esphome_components.

ssieb avatar ssieb commented on July 21, 2024

Works for me! Except for the text sensor. Any reason you removed it?

Yes. I added the input_builder instead which can handle keys from other components (specifically wiegand for now) as well.

from esphome_components.

ssieb avatar ssieb commented on July 21, 2024

Working code for others (downloaded the folders manually and put them in esphome/custom_components

That's not necessary and will stop you from getting any future updates.

from esphome_components.

DrBanarne avatar DrBanarne commented on July 21, 2024

Thanx for the fixes. Everything is now compiling correct and working as before. Keep up the good work! I will give the input_builder a go now.

from esphome_components.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.