glmnet / esphome-components

0 stars 2 forks source link

Why doesn't sensor: accept arduino_port_expander as the ape1 pin? #1

Closed macakzsolt closed 8 months ago

macakzsolt commented 8 months ago

Hello! Why doesn't sensor: accept arduino_port_expander as the ape1 pin?

sensor:
  - platform: dht
    pin:
      arduino_port_expander: ape1
      number: 8
    temperature:
      name: "Living Room Temperature"
    humidity:
      name: "Living Room Humidity"
    update_interval: 60s

The error message: [arduino_port_expander] is an invalid option for [pin]. Please check the indentation. Do you have any ideas?

For example, it works fine with switch .

switch:
  - platform: gpio  
    pin:
      arduino_port_expander: ape1
      number: 6
    name: "Sarga LED kapcsolo"
    id: sarga_led
    inverted: false
    #interlock: [internal_led]

I call things according to the readme at the beginning.

external_components:
  source: github://glmnet/esphome-components
  components: [arduino_port_expander]

# define i2c device
# for an ESP8266 SDA is D2 and goes to Arduino's A4
#                SCL is D1 and goes to Arduino's A5
i2c:

arduino_port_expander:
  id: ape1 # must identify somehow to later use
  address: 0x8
  analog_reference: DEFAULT

it works fine with switch

Thanks for the answer!

glmnet commented 8 months ago

This as every other port expander in ESPHome only supports basic uses of gpio pins, that is switch, binary sensor, buttons, generally speaking "low speed" io

Components like dht, dallas, i2c, spi, remote receiver and transmitter, fastled, etc. They all do precise timing of pulses sent over the wire to send and/or receive data and will not work with this component.

Try to wire your low speed io to the port expander and reserve esp pins for other complex peripherals.