Temperature difference circuit between two thermocouples

Hello there,

I hope you can help me,
I will create a difference circuit between two thermocouples.

My requirement:
The solar collector must have a temperature of 12°C above the boiler.
If this is the case, the solar start should be carried out, command “ON” (a timer of 5 minutes is set on the Shelly and switches the relay to OFF) and then the main solar control should take over the pump.
It should also have a delay of 15-30 minutes so that it doesn’t switch constantly.
A mobile phone notification should also be sent.
The idea behind this is that if it is cloudy but the solar still has energy to fill the boiler, then this script should intervene.

Up to now it has always been triggered manually and I would like to automate this.

But I still have very little experience with Blockly.

How can I set up this script.

Here is my attempt, where unfortunately I don’t know what to do next

Start step by step and test at each step.

What events should cause the right to run? This are the rule triggers. Based on your description:

  • solar collector temp
  • boiler temp

When either of these two values change you need to assess where you need to take action. To test simply have an action that logs out something and manipulate these Items to see that the rule triggers when needed.

Under what conditions should the rule run? Based on your description:

  • solar collector + 12°C > boiler
  • it has been > 30 minutes since the rule last ran

This is what Conditions are for. Create a Script Condition that tests for these. You’ll have to decide how you want to keep track of the time, via a DateTime Item, timestamp in the shared cache, etc.

Update your script action to save a timestamp when it runs and manipulate the Items and see that the rule runs when it’s should and doesn’t when it shouldn’t.

Once you have the rule running when it should and only when it should, gradually build up the Script Action to do what you describe. You’ve already tested the conditions so you only have to focus on switching the relays, setting timers and sending the notification.

Now that you have the rule doing what it should and only when it should, start thinking about error cases, what to do if the collector temp drops after the repairs have been switched and stuff like that.