Alexa + ESP32 project

What is important, in terms of utilising the opto-isolation facility, is that the current drawn by one part of the circuit, and specifically that drawn by the relays themselves - or indeed, what the relays are controlling - cannot affect the voltages on any other part of the circuit.

If both parts are powered by the same power supply, then that supply should be able to maintain a consistent voltage at its output terminals where there is a substantial reservoir capacitor, but the wiring from that point - which includes both supply and ground - must run separately from that point to each part.

It is also important that the supply and ground from the PSU to each individual section be kept closely together as a pair, using twin cable if over any significant distance. This is because we are dealing with digital logic operating at radio frequencies where even a relatively small loop formed by separating them will function as part of a transformer, potentially coupling to another such small loop formed in the control wiring so that switching impulses in the power circuits can generate undesirable interfering signals in that control circuit.