Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Robo-Tank Web App - Development
#67
Time for a little update.

The custom rules are officially working, I was a little worried I over extended myself with the multiple conditions but it all went very well and the code is small and easy to read. The code went together so well I should be able to easily tweak it so more than 2 sensors can be used, technically there will be no limit, the tricky part might be mixing AND OR conditions but I think it's doable. Any parameter the controller produces will be available in the customs rules and any types can be used together.

Because each piece of equipment in the custom rule can have a delay saying when to switch the equipment, the custom rule is technically running until the last piece of equipment is switched so I came across a couple Y's in the flow and this is what I settled on for now.

Example: 

Rule 1: Sensor touching water turns on Outlet 1 immediately, Outlet 4 is on 10 seconds after the rule starts and Outlet 5 is on 30 minutes after rule starts.

Rule 2: Sensor not touching water turns off Outlet 1 immediately, Outlet 4 is off 10 seconds after the rule starts and Outlet 5 is off 30 minutes after rule starts.

1st Scenario - Normal

Sensor touching water triggers Rule 1, Outlet 1 turns on, 10 seconds later Outlet 4 turns on and nearly 30 minutes later Outlet 5 turns on. - Rule Completed

Sensor not touching water triggers Rule 2, Outlet 1 turns off, 10 seconds later Outlet 4 turns off and nearly 30 minutes later Outlet 5 turns off. - Rule Completed

2nd Scenario - Half Cycle

Sensor touching water triggers Rule 1, Outlet 1 turns on, 10 seconds later Outlet 4 turns, then 40 seconds later the sensor state changes triggering Rule 2. - Rule Didn't Complete

This means Outlet 5 will have never turned on as the sensor wasn't in the proper state for 30 minutes. At this point as the sensor state changed the rule is aborted and Rule 2 will run. This means if you expect Outlet 5 to turn on you need to ensure the sensor will remain in the proper state for 30 minutes. Just typing this out now I realize this might not be best, maybe I will change so rule follows through all steps no matter if sensor changes. This was a Y, what to do, I think I picked the wrong one.

3rd Scenario - Another action during custom rule

Sensor touching water triggers Rule 1, Outlet 1 turns on, 10 seconds later Outlet 4 turns on, 10 minutes later a schedule turns Outlet 4 off, finally 30 minutes into rule Outlet 5 turns on.



You can see I added an edit and delete button, the edit button doesn't work right now, I'm leaving it for another day as it's a lot of messing with the UI and time is ticking. If you need to change something just delete and add back for now.

[Image: rules20.PNG]


The custom rule allows you to set a delay so dosing pumps can't run again via any system after the custom rule for X number of minutes, I decided to extend that as a feature for each dosing pump, you can see the new setting on 2nd picture. Later I plan to redo this screen... This is just a safety feature so there's no accidental overdosing. The delay entered on the dosing pumps settings page is the program default, if you create a custom rule and leave that delay as a 0 it will use the default, if you put a number in the custom rule it'll over ride the default however only for that custom rule. A manual dose will bypass the delay and not reset it, it'll continue counting from the last system dose. Hope that makes sense.

Now I'm trying to decide the best for startup. Should the delay set be used at startup meaning a dosing pump won't run when controller starts until after that period expires. Problem with this is if interval is long, can be up to 7 days, that would be excessive. So I'm thinking maybe 1 hour needs to pass after controller starts before dosing is allowed, except for manual doses.

[Image: dosing2.PNG]
[-] The following 1 user Likes Rob F's post:
  • albinochicken89
Reply to top


Messages In This Thread
Robo-Tank Web App - Development - by Rob F - 04-18-2021, 12:41 AM
RE: Robo-Tank Web App - by tutuss21 - 04-18-2021, 01:26 AM
RE: Robo-Tank Web App - by JFReyes - 04-18-2021, 04:31 AM
RE: Robo-Tank Web App - by Jerry W - 04-18-2021, 11:00 AM
RE: Robo-Tank Web App - by Dom59 - 04-18-2021, 03:07 PM
RE: Robo-Tank Web App - by Rob F - 04-18-2021, 03:07 PM
RE: Robo-Tank Web App - by fred73 - 04-19-2021, 05:16 PM
RE: Robo-Tank Web App - by rott - 04-23-2021, 07:51 AM
RE: Robo-Tank Web App - by Dom59 - 04-23-2021, 10:31 AM
RE: Robo-Tank Web App - by Rob F - 04-23-2021, 11:11 AM
RE: Robo-Tank Web App - by loksik.lubos - 04-25-2021, 02:03 PM
RE: Robo-Tank Web App - by Rob F - 04-25-2021, 08:47 PM
RE: Robo-Tank Web App - by Rob F - 05-23-2021, 12:50 AM
RE: Robo-Tank Web App - by albinochicken89 - 06-13-2021, 12:30 PM
RE: Robo-Tank Web App - by Rob F - 06-13-2021, 06:54 PM
RE: Robo-Tank Web App - by rott - 06-19-2021, 07:38 PM
RE: Robo-Tank Web App - by Rob F - 06-19-2021, 07:41 PM
RE: Robo-Tank Web App - by rott - 06-20-2021, 03:05 PM
RE: Robo-Tank Web App - by Weasel1960 - 06-23-2021, 04:13 AM
RE: Robo-Tank Web App - by Rob F - 06-23-2021, 04:46 PM
RE: Robo-Tank Web App - by Rob F - 07-08-2021, 11:40 PM
RE: Robo-Tank Web App - by Weasel1960 - 07-11-2021, 04:59 PM
RE: Robo-Tank Web App - by Dom59 - 07-09-2021, 09:34 AM
RE: Robo-Tank Web App - by Rob F - 07-09-2021, 05:48 PM
RE: Robo-Tank Web App - by Rob F - 07-11-2021, 08:54 PM
RE: Robo-Tank Web App - by Rob F - 07-16-2021, 10:10 PM
RE: Robo-Tank Web App - by Weasel1960 - 07-22-2021, 09:07 PM
RE: Robo-Tank Web App - by Rob F - 07-22-2021, 09:58 PM
RE: Robo-Tank Web App - by Rob F - 07-29-2021, 12:37 AM
RE: Robo-Tank Web App - by Brooks - 07-29-2021, 12:56 PM
RE: Robo-Tank Web App - by albinochicken89 - 07-29-2021, 01:02 PM
RE: Robo-Tank Web App - by Rob F - 07-29-2021, 01:38 PM
RE: Robo-Tank Web App - by Rob F - 08-10-2021, 09:35 PM
RE: Robo-Tank Web App - by Rob F - 08-11-2021, 12:13 AM
RE: Robo-Tank Web App - by Brooks - 08-11-2021, 10:21 AM
RE: Robo-Tank Web App - by albinochicken89 - 08-11-2021, 02:24 PM
RE: Robo-Tank Web App - by Rob F - 08-11-2021, 04:36 PM
RE: Robo-Tank Web App - by deeproot - 08-11-2021, 09:24 PM
RE: Robo-Tank Web App - by Rob F - 08-11-2021, 10:30 PM
RE: Robo-Tank Web App - by deeproot - 08-11-2021, 10:41 PM
RE: Robo-Tank Web App - by Rob F - 08-11-2021, 11:11 PM
RE: Robo-Tank Web App - by zee_zout - 08-12-2021, 08:16 AM
RE: Robo-Tank Web App - by Rob F - 08-12-2021, 03:36 PM
RE: Robo-Tank Web App - by Rob F - 08-12-2021, 04:49 PM
RE: Robo-Tank Web App - by Weasel1960 - 08-13-2021, 07:25 AM
RE: Robo-Tank Web App - by Rob F - 08-13-2021, 01:55 PM
RE: Robo-Tank Web App - by Rob F - 08-17-2021, 12:15 AM
RE: Robo-Tank Web App - by Brooks - 08-25-2021, 04:01 AM
RE: Robo-Tank Web App - by Rob F - 08-25-2021, 08:19 PM
RE: Robo-Tank Web App - by deeproot - 08-25-2021, 11:05 PM
RE: Robo-Tank Web App - by Rob F - 08-26-2021, 01:05 AM
RE: Robo-Tank Web App - by Brooks - 08-26-2021, 10:53 AM
RE: Robo-Tank Web App - by Rob F - 08-29-2021, 12:20 AM
RE: Robo-Tank Web App - by Rob F - 08-30-2021, 10:47 PM
RE: Robo-Tank Web App - by deeproot - 08-30-2021, 11:08 PM
RE: Robo-Tank Web App - by Rob F - 08-30-2021, 11:16 PM
RE: Robo-Tank Web App - by deeproot - 08-30-2021, 11:32 PM
RE: Robo-Tank Web App - by Rob F - 08-30-2021, 11:58 PM
RE: Robo-Tank Web App - by Weasel1960 - 09-04-2021, 11:40 PM
RE: Robo-Tank Web App - by JFReyes - 08-31-2021, 06:00 AM
RE: Robo-Tank Web App - by Rob F - 08-31-2021, 09:48 AM
RE: Robo-Tank Web App - by coaxman - 08-31-2021, 01:25 PM
RE: Robo-Tank Web App - by Rob F - 08-31-2021, 03:48 PM
RE: Robo-Tank Web App - by deeproot - 08-31-2021, 11:42 PM
RE: Robo-Tank Web App - by Rob F - 09-01-2021, 06:58 AM
RE: Robo-Tank Web App - by Rob F - 09-05-2021, 09:06 AM
RE: Robo-Tank Web App - by Rob F - 09-09-2021, 09:20 PM
RE: Robo-Tank Web App - by Rob F - 09-09-2021, 10:06 PM
RE: Robo-Tank Web App - by coaxman - 09-10-2021, 06:07 PM
RE: Robo-Tank Web App - by Rob F - 09-10-2021, 07:54 PM
RE: Robo-Tank Web App - by Rob F - 09-10-2021, 08:13 PM
RE: Robo-Tank Web App - by Rob F - 09-11-2021, 07:41 PM
RE: Robo-Tank Web App - by Weasel1960 - 09-11-2021, 08:30 PM
RE: Robo-Tank Web App - by Rob F - 09-11-2021, 09:05 PM
RE: Robo-Tank Web App - by Rob F - 09-13-2021, 03:21 PM
RE: Robo-Tank Web App - by albinochicken89 - 09-13-2021, 04:17 PM
RE: Robo-Tank Web App - by Rob F - 09-13-2021, 04:51 PM
RE: Robo-Tank Web App - by pwest - 09-18-2021, 03:10 PM
RE: Robo-Tank Web App - by Rob F - 09-18-2021, 03:35 PM
RE: Robo-Tank Web App - by Rob F - 09-19-2021, 11:40 PM
RE: Robo-Tank Web App - by Brooks - 09-20-2021, 05:15 AM
RE: Robo-Tank Web App - by Dom59 - 09-20-2021, 10:59 AM
RE: Robo-Tank Web App - by Rob F - 09-20-2021, 03:13 PM
RE: Robo-Tank Web App - by Rob F - 09-27-2021, 01:23 AM
RE: Robo-Tank Web App - by Rob F - 09-29-2021, 09:14 PM
RE: Robo-Tank Web App - by fietsenrex - 10-01-2021, 07:18 AM
RE: Robo-Tank Web App - by Brooks - 10-01-2021, 07:22 AM
RE: Robo-Tank Web App - by Rob F - 10-01-2021, 09:40 AM
RE: Robo-Tank Web App - by Rob F - 10-01-2021, 10:29 AM
RE: Robo-Tank Web App - by fietsenrex - 10-01-2021, 10:49 AM
RE: Robo-Tank Web App - by Rob F - 10-01-2021, 11:49 AM
RE: Robo-Tank Web App - by fietsenrex - 10-01-2021, 01:03 PM
RE: Robo-Tank Web App - by Rob F - 10-01-2021, 07:27 PM
RE: Robo-Tank Web App - by Rob F - 10-08-2021, 10:48 AM
RE: Robo-Tank Web App - by albinochicken89 - 10-08-2021, 10:56 AM
RE: Robo-Tank Web App - by Rob F - 10-08-2021, 11:04 AM
RE: Robo-Tank Web App - by Dom59 - 10-08-2021, 12:01 PM
RE: Robo-Tank Web App - Development - by Rob F - 10-09-2021, 12:42 PM
RE: Robo-Tank Web App - Development - by Dom59 - 10-15-2021, 12:26 PM
RE: Robo-Tank Web App - Development - by Rob F - 10-15-2021, 12:33 PM
RE: Robo-Tank Web App - Development - by Dom59 - 10-15-2021, 12:39 PM
RE: Robo-Tank Web App - Development - by Rob F - 10-15-2021, 01:34 PM
RE: Robo-Tank Web App - Development - by Rob F - 12-18-2021, 02:32 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How to Install Robo-Tank App Rob F 8 2,644 02-04-2024, 06:44 PM
Last Post: Rob F

Forum Jump:

Current time: 04-28-2024, 08:39 AM