Arduino controlling sensors and switches problem on initialization

Hi. Sorry for any double post.

I’m on a project to control switches and sensors, all controlled by a Arduino nano board connect to HA via USB (arduino: component). I’m using 7 analog sensors (connected on analog pins) and a 8 way relay board (connected on digital pins).

I’ve observed an weird issue: when the Arduino-based sensor component starts, some digital pins stop working (as expected, at least). I thought that I have a faulty board: changing for another Nano controller occurs the same behavior.

My quick and dirty hack to keep things working was a small delay (with python time.sleep(2)) at the first line of “setup_platform” function inside components/switch/ So the sensors starts first, “mess” with digital pins and then switch finished its setup procedure, putting the digital pins back to normal. Then the digital and analog pins (the switches and the seven sensors) works as expected.

Any thoughts?