Looping start/stop not working

Hi there,

First and foremost: Reactor is a really neat plugin. I’ve been using PLEG for a 1½ year.

It took a few hours but I translated all my conditions and actions from PLEG to Reactor.
But one thing I can’t get going is the pool pump start/stop.

Reactor can get it to Start at a solar panel temperature.
Then Reactor can Stop the pool pump if any of the temperature difference between three sensors are fulfilled (expressions + condition).

But then it stops and never starts again.
I’ve tried to add some additional actions but cannot get it to start the pump again.

Is there any limitations to this with Reactor or am I thinking it wrong?

As an additional question: One of my Reactor Sensors got a big exclamation mark in triangle over it yesterday. It’s one Reactor Sensor than controls all of my lighting but I have’nt noticed something not working. What does the exclamation mark mean?

No limitations in Reactor that I know of, but you didn’t really explain (in human-readable form) what your stop and start logic is, so while the screen shot shows me what you currently have, I have no way to judge if that actually implements your hopes and dreams. Also, it would be helpful if you posted a Logic Summary (from the Tools tab–there’s a link there in the Troubleshooting section).

I will say that just from looking at the screen shot, the first condition in the Start group “AN179 Pool Pump Status equals 1” looks a little suspicious for starting a pump, because if the pump is off, Status is most likely 0, so that condition is then not met, and because it’s in an AND group, the group can never go true. If your pump-on action is on that group, the pump can never be started when the pump is off–as configured, it will only try to start the pump when it’s already on. Again, I may be wrong about what that is used for, but based on the very limited view the screen shot gives me (no activities, for example), that looks odd to me. Having both your explanation of your goals/rules and the Logic Summary would give me a much more complete picture from which to work.

A yellow triangle over your ReactorSensor’s icon means “trouble”. Perusing the status tab and configuration may be helpful here, as is, once again, the Logic Summary. The Logic Summary always contains a message in the “Events” section about what put the RS into trouble state.

Thanks for the swift reply.

What I would like to do:
_1. When “Solar panelt T” reach a set temperature (currently 18 degrees), it will trigger an activity to start “AN179 Pool Pump”. It will keep running until
_2. AN179 have been tunning for 600 seconds (circulation is needed for filling the pump system and stabalizing temperature readings).
AND
(_3a. When the inlet temperature is less than pool temperature (0 difference from expression diff_inletpool which is temperature readings from inlet temperature and pool temperature). Must be stable for at least one minute (60 seconds).
OR
_3b. When the inlet is lesser than 0.2 degrees of the outlet temperature. Could’ve been 0, but I keep a little margin because of uneven warmth. 0.2 is something I’ve come to discover by time. The difference is calculated with another expression similar to 3a, but measures inlet and outlet temperature. This also needs to be stable for at least one minute.)
OR
_4. Finally, the pump should always stop during late hours 23:00 to 05:00, when air cools down the solar panel. I don’t want to cool the pool.

How it behave:
Everything starts as it should be with the simple Start-condition.
It also stops nicely when the Stop-condition is fulfilled.
But then it won’t start again.

Analysis:
You’re right about the first condition have no place where it is, it is a remnant from how I ran it using PLEG. I’ve since deleted it with no effect.

I’ve also tried to force the expressions to 0 using SetVariable but with no obvious effect. It’s just stuck.
Also, I’ve tried to unlatch but since I have no latched conditions I guess it’s to no use. But then, I don’t know the logic and possible limitations of Reactor yet.

I’ll attach the logic summary.

logic_summary.zip (2.1 KB)


As for the yellow triangle in another Reactor Sensor, the logic summary showed a missing device. I corrected it.

Finally, after switching from PLEG my Vera UI have become incredably more responsive. You’re doing some really great work here.

This logic summary was my first approach. Very simple but not working.

logic_summary.zip (2.0 KB)

OK. Looking at your logic summary (from post #3, the first summary you replied with)…

In the Start group, your temperature is 20 rather than 18 as you described, but that’s just a detail.

What seems to be happening is that the temperature is met and starts the pump, and then the Stop group later stops it, but because the Start group never goes false unless the temperature is not met, the Start activity is not re-run. Activities only run once per state transition. I would change the group to an AND operator and add another condition to test that the pump is OFF. In this way, when the pump if off and the temp > 18 (or 20 as given), the group will go true (both conditions met) and run the start activity, which will immediately make the new condition false and reset the group to false–but the pump stays running. This is the reset you need. It will happen so quickly that you probably won’t be able to see it on the UI, but you’ll know it’s working because the pump is then running.

Stop condition looks OK.

However, with the time condition, you’re probably going to end up in a competition where the time condition in the Stop group wants to stop the pump, and the Start wants to start it. So, also add to your Start group a date/time condition for between 5am and 11pm (match your Stop condition). This will keep the Start group from starting the pump during that time if it’s not running but the temperature condition is met.

You can’t set values on variables with expressions–the expression evaluation always overrides any value you attempt to set. Also, you need to specify the variable name without {}. You don’t need those actions anyway, so just remove those actions. Also get rid of the ClearLatched action–you don’t have any latched conditions, so that’s not doing anything for you.

EDIT: For safety on your pump motor control, I would also add a “sustained for” on the pump switch off condition in Start, to prevent the pump motor from being cycled rapidly–5 minutes? 10?

EDIT #2: I don’t see any significant difference between the first and second logic summaries. They both would not restart for the same reason, as explained above.

1 Like

To be clear:

Pump Logic

  • Group “Start” AND operator
    • Solar Panel T >= 18
    • Pump switch OFF - sustained for 300-600 seconds
    • Date/time between 5am and 11pm
  • Group “Stop” OR operator
    • Group “Timer + diff_temp” AND
      • Pump motor ON - sustained for 600 seconds
      • Group “inlet_pool & inlet_outlet” OR
        • diff_inletpool <= 0 sustained for 60 seconds
        • diff_inletoutlet <= 0.2 sustained for 60 seconds
    • Date/Time between 11pm and 5am

Start group is true activity starts the pump (and nothing else); Stop group is true activity switches it off (and nothing else).

1 Like

Yup, it works. I guess it was the above reset I needed.
This is not what I am used with using PLEG, which I guess continously evaluate the state of things.
This might be the reason for Reactor being much more easier on the system, but a tradeoff I’m more than willing to accept :slight_smile:

1 Like

A little bit more practical and not as sofware-oriented this post…

I really appritiate the ease of use with Reactor. One thing I dug into just half an hour ago were something I’ve been wanting to do for a long time but haven’t been able to with PLEG.
It is to create an expression for heating effect.

With some very few steps I now present heating effect of the solar panels in real time!
I thought I’d share it as my way of contributing with a good example if anyone else feels like it (since I’m a mechanical engineer and not software engineer :slight_smile:).
I don’t know if I’m able to log it in dataMine2 yet, but I would assume Reactor expressions are just as loggable as any other status.

This was my formula (easy way):
P = PumpStatus*(InletT-OutletT)4181.3((995*10)/60/60)*0,001

The physics are as shown:
<Flow on or off=1 or 0> * (ΔT * ρ * cᵥ ((ρ * Q)/60/60)*10^-3

The flow is assumed to be constant which it rarely is, but a flow meter is a little bit over the edge for this application.
PumpStatus is used for presenting a 1 or 0 and multiplied with the formula. Because if there are no controlled flow, the heating effect should be zero.
*-10³ converts SI-unit watts to kilowatts, which is more applicable.
/60/60 converts kilograms per squaremeter to kilograms per second which is the SI-unit.

Explanations:
P = Heating effect in kW
ΔT = Temperature difference (t₂-t₁), [°C]
ρ = Density [kg/m³]
cᵥ = Specific heat coefficient, water [kg/m³]
t₁ = Inlet temperature [°C]
t₂ = Outlet temperature [°C]
Q = Flow [m³/h]

Yes, it’s all in SI-units (metrics). Just as NASA, US Military and the rest of the world :wink:

1 Like

2 posts were split to a new topic: Expressions don’t export values to dataMine2