I really get frustated with the automation in Hassbian. It’s been almost 30 years since I worked with automation (professionally, building factories).
Even 30 years ago, when there was not much computer power it was easier than with hassbian.
You start with the trigger, the trigger is not a data type, it is what you call in home-assistant an entity.
I choose SMHI as an example.
First you choose the entity.
When you chosen the entity, in my example [weather.smhi_xxx], you chose the parameter in the entity, for SMHI the following parameters should be available (in a dropdown menu)
Weather Sunny /state
Temperature 18 °C /integer
Air pressure 1013 hPa /integer
Relative humidity 53 % /integer
Wind speed 4 km/h (SSV) /first part integer second part state
Visability 18.7 km /float
The type data for example ”string” (state), integer or float is known by the system. No need to choose that.
In an old PLC system in a simplest, form, you logically use “and” “or”, “exclusive or”, “bigger than”, “less than”.
I guess in home assistant, multiple triggers are “or” and conditions are “and”, there is no “Xor” as I can see it.
When selecting the result, again you should be able to choose the entity first and then a dropdown menu should display what options there is to change the state of that entity
Logically as an example;
If Shelly_H&T.xxx.temperature is higher than 23
weather.smhi_xxx,temperature is lower than 21
Set Shelly.switch.xxx to state “on” !Fan
The logic is there already, but starting with the datatype rather than the entity and its parameters (with datatypes) is backwards.