esphome / feature-requests

ESPHome Feature Request Tracker
https://esphome.io/
420 stars 26 forks source link

[Feature Request] Support MCP23017 port expander #36

Closed definitio closed 5 years ago

definitio commented 6 years ago

Hello, It would be nice to have support for that expander.

lobradov commented 6 years ago

I gave it a shot in series of PRs.

esphomelib works fine and my example compiles and works good.

esphomeyaml and esphomedoc are a bit of a different beast - I'm not so good with python and I use docker to "compile" .yamls, so I can't tell if my monkey-around is successful. @OttoWinter , counting on you to double-check the code and see if I missed anything.

Docs are updated to resemble PCF docs, but again, have no clue if I missed anything.

@OttoWinter - would be good to write a short "how to test if esphome{yaml/docs} pass quality criteria"...

papperone commented 5 years ago

any news on this PR? I would relly love to have MCP23017 (and 23008 as same chip with just 8 GPIO) supported as I will be able to move so many of my project to ESPHome while today I'm stuck with other firmware or even custom written ones... :(

OttoWinter commented 5 years ago

This has already been implemented here https://github.com/esphome/esphome/pull/466

Ausonius commented 5 years ago

Hi I am trying to control through a wemos d1 esphome mcp23017 trying to enable 8 8-button relays by following the code I can only make 8 buttons work but unfortunately the relays or LEDs do not light up when the code is in place I wanted to know where I am wrong the problem arises on the OUTPUT do not enable LED or relay you can see where it is wrong

esphome: name: esp_realy_8ch platform: ESP8266 board: d1_mini

wifi: ssid: "my SSID" password: "my password" manual_ip: static_ip: my ip subnet: 255.255.255.0 gateway: my gateway

Enable logging

logger:

Enable Home Assistant API

api: password: 'my_password'

ota: password: 'my_password'

i2c: sda: 4 scl: 5 scan: True

Example configuration entry

mcp23017:

binary_sensor:

switch:

Ausonius commented 5 years ago

on the MCP when using the OUTPUT mode it does not work nn there is no output from the voltage pins I suppose there is an error in the code made thousands of tests putting an LED on one of the pins in output but nn does not want to turn on in any way