Welcome, Guest
You have to register before you can post on our site.

Username
  

Password
  





Search Forums

(Advanced Search)

Forum Statistics
» Members: 757
» Latest member: AndreSmith76
» Forum threads: 292
» Forum posts: 1,632

Full Statistics

Online Users
There are currently 8 online users.
» 1 Member(s) | 6 Guest(s)
Bing, snpeter

Latest Threads
problem after upgrade to ...
Forum: Installation and set up questions
Last Post: dan
Yesterday, 02:11 PM
» Replies: 1
» Views: 8
SIP Stopped Working After...
Forum: Report a problem
Last Post: dan
2024 May 16, 02:20 PM
» Replies: 1
» Views: 10
Monthly Adjust per Statio...
Forum: Writing plugins
Last Post: cdesouza
2024 Apr 18, 06:33 AM
» Replies: 17
» Views: 248
MQTT Plugin initialised b...
Forum: Report a problem
Last Post: cdesouza
2024 Mar 25, 03:56 PM
» Replies: 2
» Views: 60
Update to a new plugin ve...
Forum: Installation and set up questions
Last Post: cdesouza
2024 Mar 20, 09:12 PM
» Replies: 2
» Views: 78
Using moisture sensors to...
Forum: Writing plugins
Last Post: dan
2024 Mar 15, 02:55 PM
» Replies: 29
» Views: 508
OpenVPN / PiVPN setup ins...
Forum: Installation and set up questions
Last Post: Pieterke58
2024 Mar 12, 06:56 AM
» Replies: 3
» Views: 53
Moisture Sensor Chart
Forum: Writing plugins
Last Post: cdesouza
2024 Mar 08, 01:49 PM
» Replies: 4
» Views: 82
Problem whit Paho mqtt
Forum: Installation and set up questions
Last Post: DrLabel
2024 Feb 26, 07:12 PM
» Replies: 3
» Views: 91
Problem with Run Once and...
Forum: Report a problem
Last Post: cdesouza
2024 Jan 21, 07:07 PM
» Replies: 0
» Views: 49

 
  help clarify web / mobile API
Posted by: msambol - 2023 Jun 30, 01:33 PM - Forum: Report a problem - Replies (3)

Hi, I've been using SIP for years but recently having some problems with reliability. This is likely not SIP's fault, I have semi-regular power outs and network outages. I have some alerts set up to let me know if SIP is unavailable for a long time, but it turns out they're not enough. I'd like to add an alert if for whatever reason the sprinklers haven't been active in several days.

I thought of doing this by checking the sip log / history for latest run date. The documentation around the API and the fields it returns is ... not entirely clear to me.

I found info here: https://nosack.com/sipforum/showthread.php?tid=156
cross-referencing that with https://github.com/Dan-in-CA/SIP/blob/ma...erence.txt
I thought I could use the /jc command's lrun section. 
"last run, used to display log line on home page (list [station index, program number, duration, end time])"

While the first two numbers change, I'm always getting the same value for the last two:
  "lrun": [
    0,
    3,
    1200,
    0
  ]

this is the result shortly after one of the stations was open for 20 minutes in the middle of the afternoon.

The date and time are set correctly on the machine where SIP runs.

I also tried the /jl command. I'm getting an empty array, despite the fact that I enabled logs, see the latest run in the web UI and the /wl command downloads a CSV which includes the latest run.

Am I doing something wrong, or can you help me understand the right way to programmatically pull the latest run?

I'm running version: 4.1.53 (2022-12-04).

Print this item

  Home page Hourly Display
Posted by: tutqiunnh - 2023 Jun 13, 07:02 PM - Forum: Report a problem - Replies (4)

Dan,

      As I have been hacking away on my weewx plugin. I noticed something with hourly display on the homepage that I have not been able to chase down the cause. If I open the homepage during the time window when programs are scheduled and the system enable is off, the hourly window shows programs scheduled to run/or could have been in an ~1nr window around the current time indicator bar (they are hashed, I think indicating they are not being run). The color/name legend at the bottom shows up but the name portion is not the station name from the programData.json as it would be in for a program that has been or is being run. Instead the name is "PROGRAM #" where, # is the pid of the program. Is that intended?
I have the 24hr-clock option off.

Thanks,

Print this item

  enable/disable programs via a plugin
Posted by: tutqiunnh - 2023 Jun 11, 02:25 AM - Forum: Plugin questions - Replies (1)

Dan,

    Still hacking away on my weewx weather station plug in prototype.
    I've been scanning the code to understand how the enable/disable program works. The HTTP method is useful and SF for my shell script implementation. However, as I'm implementing the plugin I can't see a variable or list that handles program enables. I see that urls.py and webpages.py is the way the the HTTP method accesses the programData.json file to handle enable/disable.
    Also I see that gv.pd is the load of program data into sip.py for use executing programs.
    Here is my higher level reasoning, I have programs setup to handle my lawn sections, and programs for my veggy garden drip and another program for shrub drips. I use a monthly data json file to enable watering for the three program types. I use lawn as the system enable/disable and programs are always enabled since lawn has the largest window in months (system off in the cold/rainy months). Once system enabled for lawn, I  want to enable/disable veggy garden and shrubs programs based on the growing/hot dry months of the year (May,Jun,July,Aug...)

Any thoughts on the best way for a plugin to modify the programData.json?
   Should I use:  u"/ep" variable to "fake" a GET request via the plugin?
   or
   just use:
        gv.pd[pid]["enabled"] = int(["1/0"])
        jsave(gv.pd, "programData")
   in the plugin?

I have messed around a bit and programData seems to be a dict, which I have not handled yet in python. Seems that a for loop can find the index of an item in the dict and then I can change then enabled entry in that item.

Thanks,
Bryan

Print this item

  GV SD definitions
Posted by: RandyBryant - 2023 Jun 08, 10:38 PM - Forum: Installation and set up questions - Replies (3)

I thought I found this info once, but cannot find it again. Are there any docs for the abbreviations used for the global variables in gv.sd?

Print this item

  understanding programs
Posted by: OldSurferDude - 2023 Apr 06, 12:33 AM - Forum: Installation and set up questions - No Replies

I think I'm not getting something

I have a number of stations (19) and a whole lot of different days and times to turn them on and off.  This is because I have 5 microclimates confounded by nine elevations of my gravity fed system (different pressures so different on times for the same water). My thinking was one giant program, but my thinking does not match reality.

It appears that I'll have to have one program for each valve.  Is this correct?  I suppose that's not so bad, but I was hoping for something a little more elegant.

Print this item

  Turning off log messages
Posted by: RandyBryant - 2023 Mar 12, 02:11 AM - Forum: Plugin questions - Replies (1)

/var/log/syslog gets lots of these messages:

Mar 11 14:59:02 SprinklerSystem sip[1140]: ::ffff:192.168.254.106:65234 - - [11/Mar/2023 14:59:02] "HTTP/1.1 GET /api/log" - 200 OK
Mar 11 14:59:03 SprinklerSystem sip[1140]: ::ffff:192.168.254.106:60633 - - [11/Mar/2023 14:59:03] "HTTP/1.1 GET /api/systemStatus" - 200 OK
Mar 11 14:59:03 SprinklerSystem sip[1140]: ::ffff:192.168.254.106:60636 - - [11/Mar/2023 14:59:03] "HTTP/1.1 GET /api/programStatus" - 200 OK
Mar 11 14:59:03 SprinklerSystem sip[1140]: ::ffff:192.168.254.106:60633 - - [11/Mar/2023 14:59:03] "HTTP/1.1 GET /api/log" - 200 OK
Mar 11 14:59:08 SprinklerSystem sip[1140]: ::ffff:192.168.254.106:65232 - - [11/Mar/2023 14:59:08] "HTTP/1.1 GET /api/systemStatus" - 200 OK
Mar 11 14:59:08 SprinklerSystem sip[1140]: ::ffff:192.168.254.106:65233 - - [11/Mar/2023 14:59:08] "HTTP/1.1 GET /api/programStatus" - 200 OK
Mar 11 14:59:08 SprinklerSystem sip[1140]: ::ffff:192.168.254.106:65232 - - [11/Mar/2023 14:59:08] "HTTP/1.1 GET /api/log" - 200 OK
Mar 11 14:59:09 SprinklerSystem sip[1140]: ::ffff:192.168.254.106:60633 - - [11/Mar/2023 14:59:09] "HTTP/1.1 GET /api/systemStatus" - 200 OK
Mar 11 14:59:09 SprinklerSystem sip[1140]: ::ffff:192.168.254.106:60636 - - [11/Mar/2023 14:59:09] "HTTP/1.1 GET /api/programStatus" - 200 OK

Is there a way to turn them off?

Print this item

  Pi GPIO Documentation
Posted by: dunkyboy - 2023 Jan 16, 04:50 AM - Forum: Installation and set up questions - No Replies

I'm doing a new setup on a Pi3 using a basic 8 channel relay.

There doesn't seem to be anything in the wiki about the GPIO pins.

Can someone please please point me towards any documentation on which pins connect to a relay board?

I looked at the file gpio_pins.py, but it doesn't have enough coding comments to be easily understood.

Thanks in advance.


In answer to my own question. I have discovered the relay_board addon. https://github.com/KanyonKris/relay_board/wiki



Quote:Relay - P1
1 - 11
2 - 12
3 - 13
4 - 15
5 - 16
6 - 18
7 - 22
8 - 7
9 - 3
10 - 5
11 - 24
12 - 26
Step 2 Connect GND of the relay board(s) to Ground of the Raspberry Pi (pins 6, 9, 14, 20 or 25).

Step 3 Connect VCC (power in) of the relay board(s) to the 5 Volt output (pins 2 and 3) of the Raspberry Pi.

Print this item

  Submitting a new plugin
Posted by: RandyBryant - 2023 Jan 09, 11:24 PM - Forum: Plugin questions - Replies (14)

I want to submit a new plugin (ssd1305) based on ssd1306 but it handles the adafruit SD1305 4567 132x64 (4 row oled display).
I also want to submit some changes/fixes to the SSD1306 plugin and a few changes to sip.py and a few other modules.

I haven't used git in a while but I think I know how to submit a request for a pull.
But there appears to be a different sequence for submitting plugins.

Print this item

  ssd1306 maybe out of date
Posted by: RandyBryant - 2023 Jan 07, 12:45 AM - Forum: Plugin questions - Replies (1)

I just discovered that ssd1306.py plugin uses gv.pon to determine if a run once or manual program is running.  It expects pon to be 98 for run_once_program, and 99 for manual_program.  Is it possible that those program numbers are no longed used for that purpose.  If so, what is the accepted method for determining if a run once or manual program is running.

Print this item

  Mobil App Plugin
Posted by: RandyBryant - 2022 Dec 29, 10:44 PM - Forum: Plugin questions - Replies (2)

What does the Mobile App Plugin do?

Print this item