The Vera Community forums have moved!

Advanced => Programming => Scene Scripting => Topic started by: invenire1 on August 04, 2018, 12:19:30 pm

Title: long running scene
Post by: invenire1 on August 04, 2018, 12:19:30 pm

- on closing and re-opening a water-tap (Popp), the next hose/sector in the garden is chosen to be watered (Gardena)
- the configuration is non-proven, so extra checks are sensible
- when a check fails, a STOP-flag can be set which is checked on each action

I'm considering how to program the following on Vera, in "mini specification" format:
for sector = 1 to 6
   open water-tap
   after 3 minutes: check whether water-tap really is opened
   after 30 minutes: close water-tap
   after 33 minutes: check whether water-tap really is closed
   after 40 minutes (10 minutes no watering): ready

What is to best way to program this?
or1) UI7
It will get distributed over various scenes and delayed actions, in one way or another
or2) PLEG
Using re-trigger with right condition might simply somewhat.
There is also the automatic logging and restart when Vera goes down.
In the ideal situation of Vera not going down, is this the way to program most similarly to the "mini specification", in just 1 scene?
Or is it not possible to have 1 scene running in Vera for hours ??

Thanks in advance for the advice,
Title: Re: long running scene
Post by: akbooer on August 04, 2018, 01:15:19 pm
If you understand PLEG, then go ahead with that.

You might also look at some other solutions like the Reactor plugin, which may be more comfortable for you to use.

Vera scenes would be a last, and ineffective, resort.  The chance of a reload ruining the timing is just too great.  Never, ever, rely on scenes with long delays.