Multiple combine condition in node red

Set up automation to see if there are people at home. When the power goes out, which backup power supply will be paid? People who are not there do not order to pay for the load.

In node red
Anyone have idea?