Dual strip dual button relay control

Hello,
I am using two stripes od LEDs divided into two segments, Segment0 and Segment1. I have 2 push buttons (Button1 and Button2) to toggle the state of each segment. I also have a relay to control my PSU. But I am struggling to get it working all together. Everything works when I manually (web interface or Home Assistant integration) turn “main switch” on - then my PSU is enabled and I can control strips using push buttons. But I don’t want my PSU to be constantly on, I want it to be enabled only when one or both segments are turned on.
How can I create a macro that controls both relay and segment state (and consider other’s segment state). Or is there any usermod that I shall use?
Regards
Damian

You will need to use Multi realy usermod. Search this forum for previous posts regarding this.

Then use API and edit JSON object directly in UI.
https://kno.wled.ge/interfaces/json-api/

Hi!
I figured out that I will need multirelay usermod and already compiled latest version. I could then attach two GPIOs of my ESP32 to two presets cotrolling state of stripes and then, by hardware (i.e. OR gate or diodes), control my PSU. But is there any purely software way of doing that?