Setting a timer value?

Suggestions, Problems, Availability, etc. Everything is up for discussion.
Post Reply
ddorsett
Posts: 20
Joined: Fri Apr 08, 2011 6:14 pm
Bot?: No

Setting a timer value?

Post by ddorsett »

Any way to set the value of a timer? I don't see anywhere in the UI, and the API reference says time object POST is only to change the name, other values controlled in the state endpoint, but there is no value for the current timer value in the state model...
brahn
Posts: 543
Joined: Thu Dec 13, 2012 11:01 am
Bot?: No

Re: Setting a timer value?

Post by brahn »

Timers are associated with a state/process and any enabled timers are always running when that state is active. You can set the value that the timer will be initialized to when the state is entered in the UI or via the API /process/x/state/y

Code: Select all

{
  timers: {{
    init: 1234
  }, {
    init: 4567
  }]
}
etc

The value is in 1/10s of a second. If you use my bcs-promise JS library it has some methods to help convert the time between it's integer value and a string representation like is shown in the BCS UI.
ddorsett
Posts: 20
Joined: Fri Apr 08, 2011 6:14 pm
Bot?: No

Re: Setting a timer value?

Post by ddorsett »

I don't think I was completely clear: I want to set the value of a running timer.
From what you said, that suggests that I would stop the process state, change the initial value of the timer and restart the process state? That'd also require that any other timers be set to continue so as not to interrupt them during the stop/start... and afterward I'd want to return all the timer initial values and continue settings to the way they were so the next time the process is run normally it'd be same... possible, but a bit complicated-
JonW
Site Admin
Posts: 1726
Joined: Sun Jul 18, 2010 7:51 am
Bot?: No
Location: Huntington Beach, CA
Contact:

Re: Setting a timer value?

Post by JonW »

(edited for more info)

You can't stop a state, you can only jump to a different state and a timer won't "continue" once you've gone to a state that doesn't use the timer you are wanting to continue. Additionally, a process will always start in state 0, but if your timer is flagged to "continue" there, it won't actually initialize and run.

Timers need to be initialized at a specific state and can continue in a later state, but I don't think there is any way to change the value without stopping the process and changing the initialized value.

Can you give some additional information on what type of situation is occurring that is making you to want to change the running value of a timer on the fly?
ddorsett
Posts: 20
Joined: Fri Apr 08, 2011 6:14 pm
Bot?: No

Re: Setting a timer value?

Post by ddorsett »

Sure- the example is a state entered manually when boiling is confirmed, activating a boil timer set to count down from 60 minutes and the timer is the exit condition to the next state. But as it nears 60 mins, there hasn't been enough boil-off so I want to extend the boil by adding 15 mins onto the timer.
I guess I could re-program to set an alarm after 60 but require a manual move to the next state... is this a more common approach?
JonW
Site Admin
Posts: 1726
Joined: Sun Jul 18, 2010 7:51 am
Bot?: No
Location: Huntington Beach, CA
Contact:

Re: Setting a timer value?

Post by JonW »

ddorsett wrote:I guess I could re-program to set an alarm after 60 but require a manual move to the next state... is this a more common approach?
This definitely is the more common approach and exactly how I do it. I get an alarm at the 60 minute point and I can look at the volume and even take a gravity reading, then decide if I want to continue to chilling at that point. Once I got my boil off rate dialed in though, I rarely add any additional boil time at the end any more.

However, I may add time up front. When I sparge, I collect my required volume and take a gravity reading. If I am short on gravity, I may let the sparge continue a while longer to collect more wort. I then add time up front by letting it boil for a bit before I actually jump the state from "Bring to Boil" to "Boil Timer Start". By doing it up front, it means I can boil down to the correct pre-boil volume before adding any hops, which in turn will make sure that my overall bittering and late hop additions are in for their correct times. If you add time in the end, you could boil off a lot of the volatile hop characters from your late additions.
brahn
Posts: 543
Joined: Thu Dec 13, 2012 11:01 am
Bot?: No

Re: Setting a timer value?

Post by brahn »

I do more or less the same as Jon. I have a manual step to start the boil timer and if I want to add time to the boil I'll do it before I start the boil step. Like Jon said the problem with adding time at the end is boiling the hops (or other additions) longer.
User avatar
oakbarn
Posts: 846
Joined: Thu Jan 05, 2012 2:28 pm
Bot?: No
Location: Texas
Contact:

Re: Setting a timer value?

Post by oakbarn »

I have a State Between my "Start of Boil" {Exit based on Temp of 211 in BK where I have a good boil at that Temp}. The in between State is named "CK VOL/SG". I take the SG and make any Volume and Hop amount adjsutments in that State. It exits back to itself every 5 minutes or to my "Boil" State using a DIN as a second Exit. That way, if the Volume and SG are good, I flick the DIN and sit back and watch the Boil. If I need to boil off some wort, it alarms me every 5 minutes to check again. We must either use the UI or the DIN to start the "Boil" State and it associated Boil and Hop timers.

We have been using the Process for several brews and had not needed to make a Volume adjustment. But....

We recently had good use of this as we had recieved some crushed grain that was not fine enough. The SG was way off and we had to adjsut our Volume down quite a bit (as well as the Hop amounts) so that we could produce a beer with the correct OG. We did several loops of the "CK VOL/SG" before we could proceed.
Post Reply