Can anyone help with my Heating PLEG issue please?

Hi all

I have made a start on my heating PLEG, using the excellent information in the pleg basics and forum alongside what I already have. What is here is still very much in “test mode”, so ignore the funny temps etc, but the core of what I am trying to achieve is:

  • Using states to govern what happens when people are at home, away, sleeping, etc. I already have PLEG controlling a multiswitch based on motion and other factors, so no need to do much here around occupancy.
  • Using the “if/then/else” functionality of PLEG to determine setpoints for each rad
  • I was attempting to avoid needing one condition / action / resend combination for each radiator by comparing the total of targetsetpoint and currentsetpoint after a period and if they do not match, resending to all. I kind of felt that even though this might mean resending setpoints to some that may have successfully updated, it might be a reasonable compromise as battery life is more governed by wakeup interval, but I could be wrong there.

Its the last part that I am struggling with. For some reason with the current order the SendSetpoint action is firing multiple times as soon as one of the home state switches changes. This goes away if I remove the ResendSP from the SendSetPoint condition. I have a suspicion this is because each time one of the values of the target or current setpoints changes, because Repeats has to be checked on SendSetpoint, it causes it to reevaluate and fire true each time, therefore when SendSetpoint goes true, targetsetpoint is changing for each of those inputs (and therefore ResendSP would be true), so action fires at least 7 times (once per rad).

I added the timer action and condition to ResendSP try and stop it firing until after targetsetpoints have been updated, but timer clearly does not start in time with this order so it made no difference. I tried moving the ResentSP condition to after SendSetpoint, which solved the multiple trigger problem, but then when ResendSetPoint turns true, it does not refire SendSetpoint. I am not sure why this would be, as I thought that even though it was placed after SendSetpoint, it should still cause everything before it to reevaluate based on its state change? Am a little lost what to try now and before I change approach altogether I thought I would see if anyone can advise where I have gone wrong?

Many thanks.

Sorry just one follow up question - do timers retain their status and remaining time after a luup restart? I was going to use these to govern the time heating is on, but if they would not continue after a restart then I will create on and off schedules instead.

A few comments on your questions and current PLEG logic:

A change in a Condition does not cause previous Conditions to be re-evaluated. Re-evaluation will not happen until some Input (Trigger, Property or Schedule) changes. The order of Conditions that refer to each other needs to be planned carefully.

The action to start a timer, as with all device actions, is queued so will not happen immediately.

I think your plan to send setpoints to all your TRVs whenever one of them needs changing is likely to cause problems. Several people have reported that TRVs can exhibit random failures in accepting new setpoints. If you send all the setpoints whenever one fails, you could end-up with an interminable loop. I would implement the resend logic separately for each TRV.

PLEG checks all its timers during a restart. Timers are restarted if they have remaining time or the end-event is processed if they expired during the restart.

Aha… I did not know that about conditions. Unfortunately placement below causes the retriggering problem, but I think you are probably right about splitting out the actions. I think I have a new approach in mind so will see how I get on. Thank you as always for the advice.