Next steps in testing are positive. Connected PIR sensor which should turn on the lights in the hall. The challenge was that from sensing presence by PIR sensor, light should be turned on instantly. With previous integration, taking sometimes more than 1 second delay it did not work as person would be half way in the hall (or more) when the lights turned on.
With this integration the lights goes on practically instantly! So I am happy !
(Small note, that internal pull-up resistor either does not seem to work or is too small for my PIR sensor or maybe is not enabled ? Anyhow connecting external pull-up resistor does the work and all work fine.)
For interrupt and several chips I understand open drain. So the logic is that in case of interrupt RPi goes to all defined chips and all defined binary sensor to check the state and reflect in HA, correct ?
Based on MCP23017 documentation there is âINTF register, which reflects the interrupt condition on the port pins of any pin that is enabled for interrupts via the GPINTEN register. A âsetâ bit indicates that the associated pin caused the interrupt.â But using this logic the software should first know which chip is it (than each chip should have it own interrupt connected to RPi) and then would read only the indicated input - this would be super optimal and fastest.
I am trying (with my limited programming knowledge) understand this logic in binary_sensor.py but need some time to do it. The challenge is probably also that some (or most) of the communication between chip and RPi is done in those Adafruit/Arduino components - and this is another step in my education/investigation.