I have been reading multiple sources in the forum and decided it was probably best to put together a concise description of what I am trying to achieve in the hope that someone can give me guidance. I am totally new to the Rules concept, so struggling to learn the syntax and values. Once I have a few pointers I suspect I will be fine.
The project... I have a modest man cave / home data center in my back yard. The building has a wall mounted Daikin air conditioner. I run a number of servers and obviously need to keep them cool on hot days, or when the room temperature reaches an upper limit.
So, what do I have... My ESP8266 device is a NodeMCU, using two DS18b20 temperature sensors on GPIO-14, and an Infrared LED on GPIO-12 using the Heatpump IR transmitter code created by ToniA (found here): viewtopic.php?f=2&t=1915&hilit=heatpumpir
Here is a look on the devices page...
The heatpumpir command is used to send the Daikin infrared codes via the IR LED on GPIO-12. Here's an example code to turn the Daikin Air Conditioner ON: heatpumpir,daikin,1,3,0,24,4,2
There will also be a separate heatpumpir command that would send the IR codes to turn the Daikin Air Conditioner OFF.
So here is my early thinking on differential logic (note this is not in rules programmatic syntax - which is where I need help)...
if Temp2 > Temp1 and Temp1 > 25 send IR codes to turn ON AC
if Temp2 < Temp1 and Temp1 , 25 send IR codes to turn OFF AC
if Temp1 > 27 send IR codes to turn ON AC (this is like an emergency AC start if the room starts to get too hot, even if the outside temperature Temp2 is lower than inside Temp1)
if Temp1 < 25 and Temp2 < Temp1 send IR codes to turn OFF AC (part of the emergency start/stop process)
Key to above: Temp1 = inside, and Temp2 = outside
What am I trying to achieve... I am trying to ensure the man cave / home DC room stays below 25 degrees (the AC temperature is set to 24.5). I dont want the Rules logic to only use a single DS18b20 in the room itself, because the Rules would most likely flip flop the air conditioner on and off. So instead I want the Rules logic to monitor the outside and inside temperature, assuming if the outside temperature is higher than the inside temperature then the Rule should keep the air conditioner running. Obviously when it cools down outside then the rules logic should turn the AC unit OFF.
I have never done this before, so am open to suggestions. Especially on writing the rule, including how the heatpumpir,daikin,1,3,0,24,4,2 is executed based on the logic I have written above.
Over to you... your help is very much appreciated

Thanks, Mark