Repeat Piston to react on a switch statement


#8

piston1:

I currently have 3 switches to control the three circuits. to your first question, yes there are several switches for the piston.

piston 2:
Currently I have 3 switches, each irrigate a circle.
I also have a simulated switch. if this is pushed, the piston should also be executed. in addition to the automated run.
To create a good / dynamic piston, I can create more simulated switch if necessary. this is no problem.
to your questions:
No, at the moment I have nothing to interrupt the irrigation. So I have to negate the other questions, too. But I would be open to any idea/solution from you :slight_smile:

The important thing is that only one switch can be “on” because the pump does not have enough pressure to supply 2 or more switches/irrigation.
It is important that I can edit all 3 circles, as easy as possible in terms of duration and frequency. something like a variable for each point oder something like that.

Do you know how I can incorporate the weather into the logic?
“if it rained a long time yesterday (f.e. more than 5h)” than it should be skipped an automated interval. "

soooooo many thanks :slight_smile:


#9

first draft for piston 1 :slight_smile:
what do you think about it?


#10

That should work! To clean it up a little and avoid any unintended behavior, you could make them all independent.

IF
switch 15 is on for 20 minutes
THEN turn off
Send notification
End IF

IF switch 14…

I’ll take a shot at the irrigation piston in a bit!


#11

Ok, here’s a first crack at your irrigation piston. Take a look through it and let me know if you have any questions. The variables at the top should make this piston pretty configurable for you.

Rather than cancelling an irrigation cycle based on how long it rained (or will rain), this piston looks at the amount of rain that will fall today, tomorrow, and the next day. You set a threshold (in mm) in the variable section and any automated cycles will be skipped if there is more rain predicted than you’ve set in your variable. Manual irrigation cycles are not affected by rain predictions.

I don’t have simulated switches so I just used ST routines in their place - swap those out to whatever you want to use to begin or cancel an irrigation cycle:


#12

Okay thanks :slight_smile:
what is a possible / good value for the variable “rainskip”?
Why do you have always 10 seconds waits?
where would be a good place to send push notifications?
perfect would be a way to check whether the irrigation was watered/finished, if so, then a notification with which circle, how long and when the next is planned.

here my piston at the moment:


#13

just a little question to this piston.
this actually works, but sometimes the color is not set to every device.
I wanted to create a piston that checks the currently set light of every HUE lamps. if the light is different than the MASTER light (it is saved in the variable “globalHUE and globalSaturation”, then it should be changed to the values in the global variables
but something is still not quite right with the piston


#14

My irrigation doesn’t run if there is more than 1/4", so that’d be right around 6mm.

To give one zone time to turn off and depressurize before the next one turns on. Otherwise you’ll be running two zones of load on your pump briefly (at least the way my system is built it would… you can remove them if you’d prefer).

Push notifications go to every device with the ST app installed. You can do it that way, or send an SMS to a specific device - whichever is better for you.

That can be added, just let me know if push message or SMS is preferred and I’ll try to put something together later tonight.


#15

please SMS :slight_smile:


#16

This should do it. Let me know if you see anything acting out of sorts when it runs (make sure full logging is turned on to help debug) and we’ll get it sorted out.

If you had any more zones, I’d re-write this all as a loop. This way should be easier for you to follow through it, though.


#17

Thank you so much
is the rainskip value correct?
i added the piston 1 in this piston at the end.

it looks perfect. thanks for your time and support

i will try it tomorrow :slight_smile:


#18

Rainskip value looks good, you should be ready to go!

Are your times in piston 1 longer than the durations in this piston? If the other commands shut zones off early it will screw up your messages, they weren’t written to take other commands shutting them down early.


#19

i have deleted piston 1.
this one is much better :slight_smile:


#20

next/last point :):grinning:
do you know how to fix the problem with the logic from the master piston?


#21

Not sure what you mean… What is the master piston?


#22

sorry


#23

The piston didn´t run this night.
Log:
Logs
16.5.2018, 08:35:59 +78ms
+1ms ╔Received event [Home].time = 1526452560000 with a delay of -922ms
+187ms ║RunTime Analysis CS > 14ms > PS > 76ms > PE > 97ms > CE
+191ms ║Runtime (76917 bytes) successfully initialized in 76ms (v0.3.104.20180323) (190ms)
+192ms ║╔Execution stage started
+201ms ║║Comparison (integer) 18 is_equal_to (integer) 0 = false (1ms)
+202ms ║║Condition #31 evaluated false (4ms)
+203ms ║║Condition group #26 evaluated false (state did not change) (5ms)
+209ms ║║Comparison (time) 30959283 happens_daily_at (time) 30960000 = true (0ms)
+209ms ║║Time restriction check passed
+211ms ║║Cancelling condition #24’s schedules…
+211ms ║║Condition #24 evaluated true (6ms)
+212ms ║║Cancelling statement #24’s schedules…
+216ms ║║Requesting time schedule wake up at Thu, May 17 2018 @ 8:36:00 AM CEST
+668ms ║║Calculating (integer) 1 + (integer) 1 >> (integer) 2
+670ms ║║Calculating (integer) 2 + (integer) 0 >> (integer) 2
+675ms ║║Comparison (integer) 2 is_less_than (decimal) 6.0 = true (2ms)
+676ms ║║Condition #25 evaluated true (458ms)
+677ms ║║Cancelling condition #23’s schedules…
+678ms ║║Condition group #23 evaluated true (state changed) (472ms)
+680ms ║║Cancelling statement #2’s schedules…
+685ms ║║Skipped execution of physical command [Garten Pflanzenbewässerung].off([]) because it would make no change to the device. (3ms)
+685ms ║║Executed [Garten Pflanzenbewässerung].off (3ms)
+689ms ║║Skipped execution of physical command [Garten Rasenbewässerung Haupt].off([]) because it would make no change to the device. (2ms)
+690ms ║║Executed [Garten Rasenbewässerung Haupt].off (3ms)
+693ms ║║Skipped execution of physical command [Garten Rasenbewässerung Seite].off([]) because it would make no change to the device. (2ms)
+694ms ║║Executed [Garten Rasenbewässerung Seite].off (4ms)
+700ms ║║Comparison (integer) 18 is_equal_to (integer) 16 = false (2ms)
+701ms ║║Condition #35 evaluated false (5ms)
+702ms ║║Condition group #32 evaluated false (state did not change) (5ms)
+707ms ║║Comparison (integer) 18 is_equal_to (integer) 16 = false (1ms)
+708ms ║║Condition #38 evaluated false (4ms)
+709ms ║║Condition group #36 evaluated false (state did not change) (5ms)
+715ms ║║Comparison (integer) 18 is_equal_to (integer) 16 = false (2ms)
+716ms ║║Condition #41 evaluated false (4ms)
+717ms ║║Condition group #39 evaluated false (state did not change) (5ms)
+723ms ║║Comparison (string) null executes (string) :bf896d3930a24ec51640ca0710681504: = false (2ms)
+724ms ║║Condition #18 evaluated false (4ms)
+729ms ║║Condition #83 evaluated false (4ms)
+730ms ║║Condition group #1 evaluated false (state did not change) (11ms)
+736ms ║║Condition #22 evaluated false (3ms)
+737ms ║║Condition group #19 evaluated false (state did not change) (5ms)
+745ms ║║Condition #91 evaluated false (4ms)
+745ms ║║Condition group #84 evaluated false (state did not change) (6ms)
+752ms ║║Condition #99 evaluated false (4ms)
+753ms ║║Condition group #92 evaluated false (state did not change) (6ms)
+760ms ║║Condition #107 evaluated false (5ms)
+761ms ║║Condition group #100 evaluated false (state did not change) (5ms)
+763ms ║╚Execution stage complete. (571ms)
+764ms ║Setting up scheduled job for Thu, May 17 2018 @ 8:36:00 AM CEST (in 86400.158s)
+771ms ╚Event processed successfully (771ms)


#24

The next date it’s scheduled to automatically water is the 18th. On that date it will run (and at whatever frequency you set up beyond that.


#25

first run was 2 hours ago :slight_smile:
but i got these messages:
zone1 and 3 has a small bug :slight_smile:


#26

I’ll take a look at it. Do you have the logs from that run? Would be. Much easier to troubleshoot with those! Looks like your zones might be sending multiple on/off reports to ST but sounded to verify before changing the piston to accommodate.


#27

I see it now. Delete the last 3 IF condition from your piston. I’m not sure how/why they are there, but they’re evaluating TRUE when your automated cycle is running and creating duplicate messages, I think.

The three I’d delete (or at least disable temporarily using the settings cog) to see if it corrects the issue are lines 165, 179, and 193.