Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Using moisture sensors to control programs
#8
OK.
I fixed gv.pon to show the program number for run once and manual started programs.
It is available in SIP version 5.1.19.

You can determine if a program was started by run now if the start time in gv.rs is different from the program's scheduled start time in gv.pd.

Here is some example code for doing that (not tested):
Code:
from datetime import datetime
for stn in gv.rs:
    if stn[0] != 0:
    timestamp = stn[0] #First station with a start time
    break
dt_obj = datetime.fromtimestamp(timestamp)
start_min = (dt_obj.hour * 60) + dt_obj.minute
print("start minute", start_min)
# compare start_min to start time of program in gv.pd
manual_start = gv.pd[gv.pon - 1]["start_min"] != start_min
<p><br></p>
Reply


Messages In This Thread
RE: Using moisture sensors to control programs - by dan - 2024 Jan 18, 06:07 PM

Forum Jump:


Users browsing this thread: 7 Guest(s)