The issue is that pulse-counter pin definition does not allow the extra attribute of specifying mcp23017. The pulse-counter docs do not show how to specify that the pin to use is on the mcp23017 extender.
I get the feeling that how pulse_counter defines a pin is different to how a binary_sensor defines a pin.
If I run the pulse_counter off a D1 Mini pin it works fine but as soon as the mcp23xxx or mcp23017 additional info is added then the error occurs when validating.
Within ESPHome they emulate a real internal GPIO pin and can therefore be used with many of ESPHome’s components such as the GPIO binary sensor or GPIO switch.
Note the use of “many” not “all”. Might be that the counter is not one of the many.
I saw that and I read it as it applies directly to the MCU.
Maybe in esphome that everywhere where a pin is defined that the ability to specify where where the pin is be added similar as provided for on a binary_sensor.
Eventually IO extenders are going to be used more as they offer a cheap way to massively increase the number of pins a MCU has to offer.
Sacrifice 2 pins on the MCU and gain a potential 64 pins at a fraction of the cost.
I’m at a point now where only the I2C pins are used on the MCU everything else needs to run from the IO extenders
8266 - WeMos D1 Mini’s. Used to use sonoffs that they became very expensive.
I have tried a ESP32 but just could not get it programmed the first time. Have not been able to find away to rest\et it to factor.
Have a esp32 camera kit that I will try later.
Right now it’s all about getting 100’s of beds wet on the farm. So you can see why the IO extenders to control pumps, solenoid valves, PIRs, tank levels etc. Camera’s to monitor growth at a later stage. You have my email address we can chat there about it.
Actually I thought it would be more likely to work on an ESP8266. The ESP32 has hardware counters that I thought might be tied to the chip’s i/o. Where as the ESP8266 has software counters that would be less likely to have this requirement.
As for programming the ESP32 some of them require this procedure (part 2):
If you want to open an issue for the pulse counter and expander you can do it here:
I had a look and could not find anything relevant.
Alternatively the devs hang out here and may have some info for you
@fisher - you cannot run a pulse counter off the mcp23017. I used one of the pins on the mcu but move all the relays I drive on to the MCP io extender.
I only have a flowmeter (pulse counter) for each water pump so there are only a few.
I tried to do the same with the PFC8574 I/O Extender and got the same results. I made a post about it here: ESPHome + PCF8574 + Pulse Counter and quickly came to the realization that you cannot use pulse_counter through the I/O extenders.