Forum Replies Created

Viewing 25 posts - 1 through 25 (of 25 total)
  • Author
    Posts
  • in reply to: Controller lockups / crashes with wired Ethernet module #80054

    hplato
    Participant

    I have a new v3.3 with the hardware ethernet module running the latest version of firmware 2.2.1. This is to replace an older v1 with 2.1.9. I poll the opensprinkler every 10 seconds, and the old one worked like a champ since 2017. No network issues, very reliable.

    After about 2 weeks, I found the v3.3 dropped off the network. It could still be controlled with the local buttons, but didn’t respond to any network requests. A power cycle and the device is back. Has anyone else seen this with the latest hardware and software, or have any suggestions or advice? There was one comment about network switches. I plug the OSP into a managed TP link switch: SG3428X. Don’t know if that is an issue or not, it wasn’t for the older device.

    in reply to: Error Code: 0x2D #79378

    hplato
    Participant

    Sorry to resurrect an old thread, but I’ve also recently started to experience 0x2d crashes, after 9 solid years of operation.

    I recently upgraded from 2.1.5 to 2.2.0 (2). About a week later I got the 0x2d crash. I saw that it’s SDCard related, and since it’s the original SD card, and it’s 9 years old, I replaced the 128MB card with a 4GB card that I had around yesterday. This morning the Opensprinkler crashed again with the 0x2d error.

    It seems odd that I’d get this on a new-ish card, so looking for any other suggestions or advice.

    in reply to: Any Home Assistant Users uploading programs? #79376

    hplato
    Participant

    Thanks. So you set each of the start_time_offsets, start_time_offset_type, and station_duration entities without issue? Hitting the webapi will all these calls at once sometimes a few entities don’t change (I have 11 stations).

    I also found a partial answer to my question, some of the start_time_offset_type entities have a ‘disabled’ select option, so that’s what’s used for -1


    hplato
    Participant

    Thanks Shawn,

    Forgot about minimum. I can’t quite see how you disabled start time, nor do I see the actual mininum being factored in (this is your older code, the the logic is the same):

    minRunmm = (min(minmax) if len(minmax) > 0 and min(minmax) >= 0 else 5)
    maxRunmm = (max(minmax) if len(minmax) > 1 and max(minmax) >= minRunmm else 15)
    times = 0

    [snip]

    for x in range(len(data[‘mmTime’])):
    aET = safe_float(ET[data[‘crop’][x]] – todayRain – ymm[x] – tadjust) # tadjust is global ?
    pretimes = times
    times = int(max(min(aET / maxRunmm, 4), times)) # int(.999999) = 0

    So thinking this through logically you’d want times > 0 _if_ the aET /minRunmm > 0 so maybe:

    if (aET / minRumm > 0) times = 1;
    times = int(max(min(aET / maxRunmm, 4), times)) # int(.999999) = 0

    Make sense?


    hplato
    Participant

    OK, I’m trying to get my head around this. So the logic is, if any station runtimes have been calculated to address the water balance, then times should always equal at least 1.

    Looking at the original python, the times calculation is:

    for each mmTime entry: times = int(max(min(aET / maxRunmm, 4), times)) # int(.999999) = 0
    -so for each station, take the minimum of aET / maxRunmn or 4 (since we only have 4 time slots), or if times has been previously set, then take its value.

    So should this be,

    for each mmTime entry:
    if (aET) times = 1 #run once if there is any water to distribute
    times = int(max(min(aET / maxRunmm, 4), times)) # int(.999999) = 0


    hplato
    Participant

    Thanks Shawn. I appreciate the answer!

    It sounds like if there are no calculated watering times for the day, then there shouldn’t be data pushed for the stations. I just wanted to make sure of that, or if there was another calculation or reasoning behind it.

    Thanks for the code, I’ll look through it to see if there are any logic changes. So far the script is working well — grass is green and I have shorter, but more frequent watering.


    hplato
    Participant

    Shawn, there is one use case that I can’t quite figure out. It seems like there are cases where station run times are calculated, but the number of times to water is actually 0, so the stations don’t activate. However, the logs are written as if water has been distributed. Here’s the output from your python script (with a bunch of debugging that’s been thrown in to help understand the logging):

    Don’t know if this is expected behavior, or if either ‘times’ or station runtimes are wrong. crop values are set to 0,1,0,1,1,0,1,0,0,1,1, so only grass has numbers.

    DIR: /vol/git/EvapoTranspiration
    Calculating values. Logging to /vol/git/EvapoTranspiration/logs/WeatherCustom.log
    E: json load /vol/git/EvapoTranspiration/logs/16953 ([])
    E: json load /vol/git/EvapoTranspiration/ET/16953 ([2.1595999999999997, -1.8694000000000006])
    E: for loop logs = ([])
    E: for loop l (11)
    E: yET = ([2.1595999999999997, -1.8694000000000006])
    E: ydur = ([-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1])
    E: -2.1781 = round(( 2.1596 ) – ( -1 / 54 ), 4) * -1
    E: _1mmProg[‘crop’][0] = 0
    E: tET[int(_1mmProg[‘crop’][0])] = -2.1781
    E: 1.8194 = round(( -1.8694 ) – ( -1 / 20 ), 4) * -1
    E: _1mmProg[‘crop’][1] = 1
    E: tET[int(_1mmProg[‘crop’][1])] = 1.8194
    E: -2.1899 = round(( 2.1596 ) – ( -1 / 33 ), 4) * -1
    E: _1mmProg[‘crop’][2] = 0
    E: tET[int(_1mmProg[‘crop’][2])] = -2.1899
    E: 1.8106 = round(( -1.8694 ) – ( -1 / 17 ), 4) * -1
    E: _1mmProg[‘crop’][3] = 1
    E: tET[int(_1mmProg[‘crop’][3])] = 1.8106
    E: 1.8424 = round(( -1.8694 ) – ( -1 / 37 ), 4) * -1
    E: _1mmProg[‘crop’][4] = 1
    E: tET[int(_1mmProg[‘crop’][4])] = 1.8424
    E: -2.2152 = round(( 2.1596 ) – ( -1 / 18 ), 4) * -1
    E: _1mmProg[‘crop’][5] = 0
    E: tET[int(_1mmProg[‘crop’][5])] = -2.2152
    E: 1.8324 = round(( -1.8694 ) – ( -1 / 27 ), 4) * -1
    E: _1mmProg[‘crop’][6] = 1
    E: tET[int(_1mmProg[‘crop’][6])] = 1.8324
    E: -2.2096 = round(( 2.1596 ) – ( -1 / 20 ), 4) * -1
    E: _1mmProg[‘crop’][7] = 0
    E: tET[int(_1mmProg[‘crop’][7])] = -2.2096
    E: -2.1929 = round(( 2.1596 ) – ( -1 / 30 ), 4) * -1
    E: _1mmProg[‘crop’][8] = 0
    E: tET[int(_1mmProg[‘crop’][8])] = -2.1929
    E: 1.8424 = round(( -1.8694 ) – ( -1 / 37 ), 4) * -1
    E: _1mmProg[‘crop’][9] = 1
    E: tET[int(_1mmProg[‘crop’][9])] = 1.8424
    E: 1.8069 = round(( -1.8694 ) – ( -1 / 16 ), 4) * -1
    E: _1mmProg[‘crop’][10] = 1
    E: tET[int(_1mmProg[‘crop’][10])] = 1.8069
    E: Done – mmFromLogs
    E: ymm = ([-2.1781, 1.8194, -2.1899, 1.8106, 1.8424, -2.2152, 1.8324, -2.2096, -2.1929, 1.8424, 1.8069])
    E: yET = ([-2.1929, 1.8069])
    E: ET[0] = 4.13, yET[0] = -2.1929
    E: ET[1] = 4.8255, yET[1] = 1.8069
    E: aET[0] = 8.101 (0.540066666667) // mm/Day
    E: times = 0 (max 0.540066666667/min 0.540066666667 max(min(0.540066666667, 4), 0))
    E: aET[1] = 0.7992 (0.05328) // mm/Day
    E: times = 0 (max 0.05328/min 0.05328 max(min(0.05328, 4), 0))
    E: aET[2] = 8.1128 (0.540853333333) // mm/Day
    E: times = 0 (max 0.540853333333/min 0.540853333333 max(min(0.540853333333, 4), 0))
    E: aET[3] = 0.808 (0.0538666666667) // mm/Day
    E: times = 0 (max 0.0538666666667/min 0.0538666666667 max(min(0.0538666666667, 4), 0))
    E: aET[4] = 0.7762 (0.0517466666667) // mm/Day
    E: times = 0 (max 0.0517466666667/min 0.0517466666667 max(min(0.0517466666667, 4), 0))
    E: aET[5] = 8.1381 (0.54254) // mm/Day
    E: times = 0 (max 0.54254/min 0.54254 max(min(0.54254, 4), 0))
    E: aET[6] = 0.7862 (0.0524133333333) // mm/Day
    E: times = 0 (max 0.0524133333333/min 0.0524133333333 max(min(0.0524133333333, 4), 0))
    E: aET[7] = 8.1325 (0.542166666667) // mm/Day
    E: times = 0 (max 0.542166666667/min 0.542166666667 max(min(0.542166666667, 4), 0))
    E: aET[8] = 8.1158 (0.541053333333) // mm/Day
    E: times = 0 (max 0.541053333333/min 0.541053333333 max(min(0.541053333333, 4), 0))
    E: aET[9] = 0.7762 (0.0517466666667) // mm/Day
    E: times = 0 (max 0.0517466666667/min 0.0517466666667 max(min(0.0517466666667, 4), 0))
    E: aET[10] = 0.8117 (0.0541133333333) // mm/Day
    E: times = 0 (max 0.0541133333333/min 0.0541133333333 max(min(0.0541133333333, 4), 0))
    E: open(/vol/git/EvapoTranspiration/logs/16954, ‘w’)
    E: open(/vol/git/EvapoTranspiration/ET/16954, ‘w’)
    E: File: /vol/git/EvapoTranspiration/wuData/16954
    Content-Type: text/html

    Resolved your lat:xx.xxxx, lon:-xx.xxxx, they will be stored
    0.0 mm precipitation forecast for next 3 days
    0.4 mm precipitation fallen and forecast for today
    P-M ETo
    4.13 mm lost by grass
    4.8255 mm lost by shrubs
    sunrise & sunset in minutes from midnight local time
    326 1303
    Weather Station ID: xxxxxxxx
    Current logged ET [6.3229, 3.0186]
    [54, 20, 33, 17, 37, 18, 27, 20, 30, 37, 16]
    [[-1, -1, -1, -1], [437, 0, 267, 0, 0, 146, 0, 162, 243, 0, 0]]


    hplato
    Participant

    Thanks again Shawn for all your help. I’ve uploaded my perl file to github, and I think I’ve covered off all the attribution. The only slight difference I see so far with this code and the python code is that sometimes WU have multiple forecasts per hour. The python grabs the cloud cover for the first forecast, and the perl grabs the last one. This is really minor, and doesn’t really change the outputs.

    https://github.com/hplato/misterhouse/blob/eto/code/common/calc_eto.pl


    hplato
    Participant

    Thanks for the reply Shawn! That was a typo, glad I got the logic right. I really appreciate the help and answers!

    Did you make any logic changes with your revised code?


    hplato
    Participant

    Hello,

    Well, I’ve successfully replicated this logic in perl, and track exactly the same results given the same input set. Shawn thanks again for your help!

    I think I understand the logic, but just wanted to double check a few things if that’s OK.

    – Today’s ET is the amount of moisture change by plants.
    – A positive ET means moisture has been lost, and a negative means that there is a net increase of moisture.
    – This is where I’m not that clear: After calculating today’s ET value, the previous days ET is subtracted from today’s ET to calculate the current ET. If we can’t run today for whatever reason (too cold, precipation in forecast), then we write 0’s to today’s run time. We take the current ET – todays_rain – yesterdays irrigation – a forecast adjustment. This gives us our mm target.

    – Based on the target, we then look to how many seconds are required per zone to net the ‘water balance’ to 0. So if we have an target of 8mm for grass, and it takes 60 seconds to distribute 1mm of water, then we need to run for 4 minutes.

    Did I get it right?


    hplato
    Participant

    Hi Shawn, did you manage to upload the new code that you were working on?

    Also, would it be OK to use this code as a reference and refactor it in another language? I’m not familiar with python, but if it was in perl I could use it in my home automation setup to push the correct watering times.


    hplato
    Participant

    Sorry to bump this, just wondering if you might be able to post your code in whatever form it is in. I’m hoping to get this into place in the spring, and have time over the winter to get it all into place.


    hplato
    Participant

    Hi Shawn, any update? Even though watering season’s over up here in the North, I’m happy to test and provide some feedback.


    hplato
    Participant

    Just a quick bump to Check Shawn if you have any more updates?


    hplato
    Participant

    Hi Shawn, Any update? For some reason after Aug 17th the script stopped working for me, can’t find the right log file. Before I start troubleshooting, just thought it might a better use of time to test a newer version.


    hplato
    Participant

    I’ve updated the Misterhouse interface module to be able to upload program data, so that’s what I’m playing around with. Right now I’m just logging the changes and reviewing manually to make sure I’m not messing anything up. I like how Shawn’s script identifies things like the loss and gain of precipitation to get a sense of how the changes are being made.

    Shawn the only issue I’ve found with the script is that it ‘oops’ if there isn’t a yesterday log and ET file. Not a big deal if it runs daily, however during my tests I had a few day gap and it wouldn’t launch until I manually copied the last day with data to the yesterday file.


    hplato
    Participant

    That makes sense. Thanks again for your help Shawn.

    So do I need to do something special with the time? Right now, the script wants to upload [-1,-1,-1,-1],[0,129,0,110,238,0,174,0,0,238,103] to my program. However this causes the time to be sunset -2047 minutes or Sunrise -1d-10h-7m. Do I need to set up the program differently, or is this just the normal way the OS deals with a -1 value for the first time?


    hplato
    Participant

    Got it. So I’ve updated my interface to Misterhouse to allow for running an external script and then uploading the data to a specific program. So far it’s working. Thanks again for your help with this.

    Two quick things to confirm my understanding.
    – So for this to work, the script needs to run at least once a day to upload the new start and runtimes to a program. I think you mentioned running it every 15 minutes, however I don’t know how that helps, since really it just needs the data before midnight to calculate the morning schedule?
    – Since this dynamically adjusts a program, the program needs to be set to run every day, correct?

    Also, since I call this as an external program I needed to make a few slight changes so that the site libs are found, as well as a path to the output. Here’s my updated file as well as a bash script I use to call the program.

    Attachments:

    hplato
    Participant

    Hi Shawn,

    So I’ve updated the 1mm file to specify the number of seconds that each station needs to run to distribute 1mm of water. I’m not sure what ‘crop’ does:
    {“mmTime”:[54,20,33,17,37,18,27,20,30,37,16],”crop”:[0,0,0,0,0,0,0,0,0,0,0]}

    Running python weatherCustom.py I get the following output:
    Content-Type: text/html

    Resolved your lat:XX.XXXX, lon:XX.XXXX, they will be stored
    0.0556 mm precipitation forecast for next 3 days
    2.0 mm precipitation fallen and forecast for today
    P-M ETo
    5.8051 mm lost by grass
    6.6252 mm lost by shrubs
    sunrise & sunset in minutes from midnight local time
    348 1297
    Weather Station ID: XXXXXXXX
    Current logged ET [5.8676, 6.6252]
    [54, 20, 33, 17, 37, 18, 27, 20, 30, 37, 16]
    [[-1, -1, -1, -1], [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]]

    So since it’s rained today, all stations should be 0, so I get that. If the numbers change, then I should push the new values to the current program. However, I’m not sure what the [-1,-1,-1,-1] is telling me?


    hplato
    Participant

    Hi,

    So I’ve gathered all the data from my stations to calculation seconds/mm. I’m at a loss to figure out how to calculate runoff and how to determine the actual water needed. Is there any reference for those data points?


    hplato
    Participant

    No problem on the delay — I haven’t measured my rain rate yet since it’s been thunder storming for the past two weeks. I’ll give this a try and let you know if there are any issues. Again, I really appreciate the help!


    hplato
    Participant

    Don’t mind at all, really appreciate the help and suggestions!


    hplato
    Participant

    Awesome. Thanks Shawn! Really appreciate the guidance and advice.

    I have a .2 acre property and 11 stations, with 47 sprinkler heads, so it will take a while to get all the measurements. However, I really like the idea of the science-based watering.

    What I’m thinking now is using that interface I built to run the calculates and push the data to the OS. I’ll run it every 15 minutes, and also use the data from the calls to populate the weather details in my system.

    I’m not strong in python, so I’m wondering if I can ask for two enhancements. If not no problem, I can probably hack it together, just be nice that I don’t have too much of a custom piece:

    – take a command line argument as the path to the logs and ET data.

    – print out current conditions, and save them to a file. Maybe tab delimited to make parsing easier:
    – wuData[‘current_observation’][‘observation_epoch’]
    – wuData[‘current_observation’][‘weather’]
    – wuData[‘current_observation’][‘temp_f’]
    – wuData[‘current_observation’][‘temp_c’]
    – wuData[‘current_observation’][‘relative_humidity’]
    – wuData[‘current_observation’][‘wind_string’]
    – wuData[‘current_observation’][‘wind_dir”‘]
    – wuData[‘current_observation’][‘wind_degrees’]
    – wuData[‘current_observation’][‘wind_mph’]
    – wuData[‘current_observation’][‘wind_kph’]
    – wuData[‘current_observation’][‘solar radiation’]
    – wuData[‘current_observation’][‘precip_1hr_in’]
    – wuData[‘current_observation’][‘precip_1hr_metric’]
    – wuData[‘current_observation’][‘precip_today_string’]
    – wuData[‘current_observation’][‘precip_today_in’]
    – wuData[‘current_observation’][‘precip_today_metric’]
    – wuData[‘current_observation’][‘icon’]
    – wuData[‘current_observation’][‘icon_url’]
    – Is_Raining. I think this is calculated somewhere else, just a 1 or 0 if actually raining…


    hplato
    Participant

    Hi Shawn,

    Thank you so much for the response. I just got the OS a month ago, and new to overall irrigation.

    That makes sense, I’ll zero out the ET parameters once I start this. I think I understand your comments, but just to confirm;

    – so the 1mm file, I don’t have a water meter so I thought I’d get a few buckets around the area, run the sprinkler for 10 minutes, and then measure the average water and do the math?
    – my stations right now just start once in the schedule. why would there be multiple start times?
    – that makes perfect sense about disabling watering during the rain. That’s what I’m trying to figure out on my home automation interface, since we are getting a lot of rain, but want one station to run all non-rainy evenings as we have some new plants.

    Do you run this script once a day? That would definitely save on WU calls. I see right now that the OS calls ~40 times a day, so there is headroom. I was thinking about either running this every 10 minutes to also populate weather details in my home automation system, or run it once a day at sunset, since all my watering is at night.


    hplato
    Participant

    Thanks Shawn,

    I tried this tonight, and two things;

    – Without data for yesterday. the mmFromLogs subroutine ‘oops’ when trying to open the data. I copied your data to yesterday’s date, and the script ran. However, what should an actual starting point be for ET/<date> and logs/<date>?
    – From what I gather, I need to figure out the number of seconds for each station to distribute 1mm of water, and then edit the 1mm file. OK got it.
    Using your script, I’m a little confused by the first set of values in the weatherprogram/run file. When I run the script, I get:

    Resolved your lat:xx.xxxx, lon:-xxx.xxx, they will be stored
    0.633333333333 mm adjustment for weighted 3 day rain forcast
    1.0 mm adjusment for rain occuring today
    P-M ETo
    6.4366 mm on grass
    7.4292 mm on shrubs
    sunrise & sunset in minutes from midnight local time
    327 1301
    Current filename we are using: 16587
    Looking for log file: 16586
    Weather Station ID: xxxxxxxx
    [75, 150, 75, 60, 75, 75, 60, 0]
    [[-1, -1, -1, -1], [0, 0, 0, 349, 0, 0, 349, 0]]

    From my understanding, this it to turn on stations 4 and 8 for 349 seconds, however the -1 means that the station is actually disabled?

Viewing 25 posts - 1 through 25 (of 25 total)