OpenSprinkler › Forums › Third-Party Software › Questions about Program Data format
- This topic has 2 replies, 2 voices, and was last updated 2 years ago by AndreasSprink.
-
AuthorPosts
-
January 9, 2023 at 9:22 pm #74678
AndreasSprinkParticipantHello,
I am trying to understand the “Program Data [Keyword /jp]” structure but are not entirely sure when reading the API. I have many questions at the same time to get a whole understanding of how the format is made.
My goal is to add a program where I can choose exactly what days of week it should run. I don’t think about even/odd days, intervals, weather adjustment etc.
I think I can take the exact program I am trying to create and I could perheps understand from this example.1. The program should start 1:00 AM
2. I have a main controller(8 stations/zones) and one extender(16 stations/zones)
3. I will use 10 zones. 1-8 on the main controller and 1-2 on the Zone Expansion Board.
4. I will water all 10 zones one after the other 20 minutes each in a sequence (total time: 10 * 20 minutes = 200 minutes)
5. Example is to water: Monday,Tuesday,Thursday,Friday,Sunday. (My goal is to understand how to specify exact days like this)Below string is not entirely correct for my program, but I could ask from this string:
http://os-ip/cp?pw=xxx&pid=-1&v=%5B3,127,0,%5B60,0,0,0%5D,%5B1200,1200,1200,1200,1200,1200,1200,1200%5D%5D&name=Summer%20Prog– I have understood that: “pid=-1” means adding a new program
– I have understood that: days1=0 means no interval
– Argument 127 means everyday of the week. But I don’t understand how to arrive at 127.Now this for example, I am not sure at all how it works, looking at the API documents. For the flag below info is written. I don’t understand about those “bit 0-7” here.
In above string “3” is written. For example, perheps if I ask some questions below to see if it clears for me:flag: a bit field storing program flags
o bit 0: program enable ‘en’ bit (1: enabled; 0: disabled)
o bit 1: use weather adjustment ‘uwt’ bit (1: yes; 0: no)
o bit 2-3: odd/even restriction (0: none; 1: odd-day restriction; 2: even-day restriction; 3: undefined)
o bit 4-5: program schedule type (0: weekday; 1: undefined; 2: undefined; 3: interval day)
o bit 6: start time type (0: repeating type; 1: fixed time type)
o bit 7: enable date range (0: do not use date range; 1: use date range)Question 1: If only want “bit 6 with a 1: fixed time type”. How to write this flag argument?
Question 2: If want “bit 6 with a 1: fixed time type” AND “bit 7 with 1: use date range”. How to write this flag argument?
Question 3: If want “bit 4-5 with 3: interval day AND “bit 7 with 1: use date range”. How to write this flag argument?Question 4: [60,0,0,0] as I written it in the string as I understand starts 60 minutes after midnight as I will use “fixed time type”
Next argument: repeat count will be 0 as I will run it only once?
Next argument: interval time in minutes will be 0 as there is no interval?
Next argument: start 3, I have written 0 but are not sure what it stands for?Question 5: [1200,1200,1200,1200,1200,1200,1200,1200] corresponds to zones 1-8 on the main controller if I understand correctly.
I will also use zones 1-2 on the Zone Expansion Board. Is it just correct to add 2 arguments like this?
[1200,1200,1200,1200,1200,1200,1200,1200,1200,1200]Question 6: Monday,Tuesday,Thursday,Friday,Sunday. (My goal is to understand how to specify those exact days like this?)
If I understand it should be specified in argument: “days0=” ?Question 7: When I call: “Get Station Status [Keyword /js]” —> http://15.1.0.6:80/js?pw=a6d82bced638de3def1e9bbb4983225c
JSON returned is then: {“sn”:[0,0,0,0,0,0,0,0],”nstations”:8}
I wonder if that is correct. I have connected the “Zone Expansion Board” to the main controller with the cable. Shouldn’t it return: 8 + 16
zones in the argument there?Many thanks!
January 9, 2023 at 9:24 pm #74684
RayKeymasterI suggest you to use the OpenSprinkler web UI in a browser, open a developer tools window, then create a program, and take a look at the ‘Networks’ tab of the developer tools window. It shows the exact command /cp that’s sent to the controller. That way you can see exactly how each variable is set.
About expander: you need to enable all 24 zones in Edit Options -> Station Handling, set the number of zones/stations.
January 10, 2023 at 11:27 am #74696
AndreasSprinkParticipantHi Ray,
Yes, that was perfect! I am able to follow all logic using that method. I see the logic with the bits there now. 1,2,4,8,16,32,64 and adding them
for the weekdays etc.I was able to enable all 24 zones also so I can now see the whole array there.
Thank you!
-
AuthorPosts
- You must be logged in to reply to this topic.
OpenSprinkler › Forums › Third-Party Software › Questions about Program Data format