How to create a complex binary switch?

Hello,

I have a problem and unfortunately I don’t know how to get there, I hope that I can get some help from you.

Although I want to operate a heating element in the boiler depending on the excess electricity.

heater
1st stage 1500W
2nd stage 3000W
3rd stage 4500W

I would like to use the following sensors and they are already provided:
battery level = sensor.battery-level
Power Generation Solar = sensor.pv
grid power = sensor.grid

I have three criteria that I want to read out and at the end a binary value yes/no should come out.

1st step - battery storage (sensor.batterie-level) more than 95% full
If yes
2nd step - power generation solar (sensor.pv) > 1600W
If yes
3rd step - grid power (sensor.grid) > 0W
If yes
4. Heat release 1 - yes

etc…

How can you realize something like that?

Best regards
Gerald

It should look something like this:

Binary switch?
A binary switch can only have two outputs, on or off.
Perhaps it’s an automation you want?

I thought that the control should happen with an ESP8266 with ESP-Home.

ie. switch relay1 if there is a corresponding release.
the second relay when the next release is available, etc

This kind of multi-state problem can usually be solved using a finite state machine. Take a look here for ideas.