I have a weather station with wind speed and rainfall detectors, these both use the
pulse_counter option in ESPHome. Because the weather station is out on the roof I’m trying to figure out a good way to run some CAT5 Ethernet most of the way and have the brains located in the attic.
I got really excited when I saw a bunch of articles on stack exchange about this and the idea is to run i²c via PCA9615.
However, this means that all the distant equipment needs to be communicating over i²c. I thought about this for a while and realized I could use an I/O expander module to get remote GPIO data without having to send it over the Ethernet. I have one of these PCF8574s so I tried to mock it up on a breadboard and see if I could get it to work:
pcf8574: - id: 'pcf8574_hub' address: 0x20 pcf8575: False as3935_i2c: # irq_pin: D7 irq_pin: pcf8574: pcf8574_hub number: 2 indoor: false sensor: - platform: pulse_counter # pin: # number: D6 # mode: INPUT_PULLUP pin: pcf8574: pcf8574_hub number: 0 mode: INPUT_PULLUP unit_of_measurement: 'in' name: 'Rain Pulses 1min' icon: 'mdi:weather-rainy' id: rain_pulses_1min count_mode: rising_edge: DISABLE falling_edge: INCREMENT internal_filter: 50us update_interval: 60s internal: True filters: - multiply: 0.011 accuracy_decimals: 3
When I try to validate this, it tells me that
[pcf8574] is an invalid option for [pin]. Please check the indentation. It only reports this for the pulse_counter and not for the as3935_i2c device. Reading about ESPHome’s support for the PCF8574, it says:
Any option accepting a Pin Schema can theoretically be used, but some more complicated components that do communication through this I/O expander will not work.
I’m guessing that I’m running into this “more complicated components” issue with the pulse counter but I thought I’d post it here just in case anyone from the community has any ideas.