• Please visit and share your knowledge at our sister communities:
  • If you have not, please join our official Homebrewing Facebook Group!

    Homebrewing Facebook Group

BruControl: Brewery control & automation software

Homebrew Talk

Help Support Homebrew Talk:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.
What specific model of the ESP-32 series are they? Were they working before yesterday?
Yeah they have been working and in use for a few months. Pics of them attached.
 

Attachments

  • 1000001921.jpg
    1000001921.jpg
    2.1 MB
  • 1000001922.jpg
    1000001922.jpg
    1.7 MB
Hi All, I should be grateful if you could help me please with guidance on how I can configure my two Fermenters (FV1 & FV2) each with a 12v 3 wire motorised valve activated via an individual 12v relay module so at the same time my single glycol pump (common to both FV’s) can be switched on at the same time a FV calls for cooling?
 
Hi All, I should be grateful if you could help me please with guidance on how I can configure my two Fermenters (FV1 & FV2) each with a 12v 3 wire motorised valve activated via an individual 12v relay module so at the same time my single glycol pump (common to both FV’s) can be switched on at the same time a FV calls for cooling?
Are you using Hysteresis for FV1 and FV2?
There is a Boolean script attribute of value associated with any Hysteresis element.
It is either true or false.
I do not know what this Boolean is representing but possibly if the Element has power or NOT?

If someone knows what the value attribute represents and it is if power is demanded by the element, then a simple if statement could work.

The only thing I could find in the Manual for scripts and is Hysteresis.


Hysteresis
o InputPortID (string)
o Target (number)
o OnOffset (number)
o OnDelay (number)
o Value (true/false)

if the value attribute is the POWER to the Hysteresis Element
then this script would work


You have two Hysteresis elements
FV1
FV2
You have a digital Output named SingleMainGylcol




new bool vBFV1
new bool vBFV2
[LooperFV]
sleep 100
vBFV1 = FV1 value
vBFV2 = FV2 value
if vBFV1 == true
SingleMainGylcol state = true
endif
// Or
if vBFV2 == true
SingleMainGylcol state = true
endif
//both FV1 and FV2 are False, turn off single valve
if vBFV1 == false
if vBFV2 == false
SingleMainGylcol state = false
endif
endif
goto LooperFV

The 3 wire valves may not work for Hysteresis, You would likely want a solenoid valve (16 awg wire to supply it with power)
or a two wire ball valve with auto close (not reverse polarity type)
 
Hi Oakbarn, Thanks for your help, which is much appreciated and I was planning to use Hysteresis elements for FV1 and FV2 and in a dry run scenario this works ok for the vales, but it is the glycol pump that I and struggling with, and thanks for the script and I’ll try this out.
 
Hi Oakbarn, Thanks for your help, which is much appreciated and I was planning to use Hysteresis elements for FV1 and FV2 and in a dry run scenario this works ok for the vales, but it is the glycol pump that I and struggling with, and thanks for the script and I’ll try this out.
As I said, I am not sure what the "value" is tied to, but hopefully, it is the state of the Hysteresis element. There is no state attribute of a Hysteresis element.

Let me know if that works. Unfortunately, I cannot test it here now.

If that does not work, I may have another idea that is clunky, but would likely work.
 
Alright...I've bench tested all of the valves and they're in good shape. Now I have a UniShield noobie question. I want to control these valves with the UniShield. Given that each valve has 3 wires (Open[Green], Close[Red], and PWR[Black]) what does the physical wiring look like? I know that the Unishield has the "Digital Out" capability that acts like a "switch"...but I'm not understanding what the wiring would look like.
Here's an example of the wiring scenario on the VA side of the base board for the UniShield:

1701929564845.png


Feel free to roast me on this, but it's late and I'm just scratching my head looking at it right now.
 
The wires should be
Black to Ground
Red to Close D Pin {Close Voltage)
Green to Open D Pin (Open Voltage)
You should never hook both a P Terminal and a D Terminal at the same time.

xx.png
 
here is a snippet of Script where I control the open and close of valves depending on the state of only On digital; output Element named "my_KD20_Valve_On"

it in a looping script

[Loop]

// HermsWort
if "my_KD20_Value_ON" state == true
"my_KD20_Value_OFF" state = false
else
"my_KD20_Value_OFF" state = true
endif
goto "Loop"
 
Hi, For my Fermenting Control ? Process, is there a way that I can create a single "Switch" via Device Elements that will be placed on the Workspace screen to give me an option to press "Start" / "Stop" which will then activate / control any elements (if disabled or not), as well as starting the corresponding scripts? Thanks.
 
I just upgraded to a professional license and am having trouble getting the data exchange service running. I am logged in as an administrator. When I click reserve URL an approval box appears. After clicking Yes, nothing happens. Is there anything else I can do? The base localhost is up and running on the computer. Any help is appreciated.
 
Have you clicked the Enable Service button to ON? You should then receive a green check mark which indicates service is running.
 
Hi, For my Fermenting Control ? Process, is there a way that I can create a single "Switch" via Device Elements that will be placed on the Workspace screen to give me an option to press "Start" / "Stop" which will then activate / control any elements (if disabled or not), as well as starting the corresponding scripts? Thanks.
I'm not sure if there is a more elegant way to do it; however, you can write some scripts that run on a loop to achieve what you're asking about I believe. Example:

[ACTIVATELOOP]
wait "Active Switch" State == on
"Device Element" enabled = true
start "Device Element Script"
goto "ACTIVATELOOP"

And in a separate script:
[DEACTIVATELOOP]
wait "Active Switch" State == off
"Device Element" enabled = false
stop "Device Element Script"
goto "DEACTIVATELOOP"
 
Can you "release" the URL for that assigned port then "reserve" again and see if you have the ability to enable service?
 
No, the release option is unavailable as well.
Solved it from this thread: netsh.exe: Error 87

Because my user name has a space in it, the built-in reservation button did not work. I had to go into the command prompt as an administrator and add double quotes around my user name.

C:\>netsh http add urlacl url=http://+:8000/ user="DOMAIN\my name"
 
I'm not sure if there is a more elegant way to do it; however, you can write some scripts that run on a loop to achieve what you're asking about I believe. Example:

[ACTIVATELOOP]
wait "Active Switch" State == on
"Device Element" enabled = true
start "Device Element Script"
goto "ACTIVATELOOP"

And in a separate script:
[DEACTIVATELOOP]
wait "Active Switch" State == off
"Device Element" enabled = false
stop "Device Element Script"
goto "DEACTIVATELOOP"

You need to turn the switch off, otherwise it will continue to restart the script or element.


[ACTIVATELOOP]
if "Active Switch" State == true
start "Device Element Script"
"Active Switch" State = false
goto "ACTIVATELOOP"

or to just turn on and element

But why a switch for that. You can just click on the Element to control it.

[ACTIVATELOOP]
if "Active Switch" State == true
"Device Element" state = true
"Active Switch" State = false
goto "ACTIVATELOOP"


You can use a "toogle" to control several elements

create a global value named something like
ACTIVATELOOPTOGGLE

It can be any unique name you want

set precision as 0

[ACTIVATELOOP]
if "Active Switch" State == true
if "ACTIVATELOOPTOGGLE" value == 0
"Device Element1" state = true
"Device Element2" state = true
"ACTIVATELOOPTOGGLE" value == 1
else
"Device Element1" state = false
"Device Element2" state = false
"ACTIVATELOOPTOGGLE" value == 0
endif
"Active Switch" State = false
goto "ACTIVATELOOP"
 
As a general comment on controlling some things automatically or with switches, I have a script I named 'scrAutoSwitch"

It is run constantly in the Brew and just loops the entire time.

It controls switches and some backgrounds of elements depending on the state they are in

As an example, a pump has a different background depending on the state of the digital out.

My red pump Off:
Pump_Red_Rip_Off.png


My red Pump on:

Pump_Red_Rip_On.png


it is easy to see the state of the pump and the looping script puts in the correct background.

I also use the visibility to display or not a global with a background for an element.

My Quadzilla Control Switch does several things.

It sets the valves correctly by setting a a valve control number (a global) and calling and script to set the valves according to the valve control number.

The valve backgrounds are set within the Auto Script to the correct background (different part of the script).

it sets the visibility for the elements to be visible when the Heating elements are enabled (on)

it may do other things but you have good control of the visual of the workspace

x.png
.
 
@BrunDog
It would be nice to have the Script Edit Mode independent of the Lock feature. I regularly move or resize elements when editing scripts. This is almost certain to happen if I increase the script window to 300 or above, If I could lock the screen, and then be able to edit the Scripts, it would prevent that issue.
 
Global Timers

Tried searching and could not find the answer. (still very new to scripting) My goal is to have a cluster of hop addition countdowns that all start when I start the boil process.

I'm able to create a timer and set the time and display name via a script no prob but while reading about it, it sounded like the experts are using globals as timers when creating multiple timers. I got as far as setting the time value for the global but got stuck.

In addition to setting the time, is it possible to set the display name and whether it counts up or down as well as start it via a script?
 
Global Timers

Tried searching and could not find the answer. (still very new to scripting) My goal is to have a cluster of hop addition countdowns that all start when I start the boil process.

I'm able to create a timer and set the time and display name via a script no prob but while reading about it, it sounded like the experts are using globals as timers when creating multiple timers. I got as far as setting the time value for the global but got stuck.

In addition to setting the time, is it possible to set the display name and whether it counts up or down as well as start it via a script?
Global variables don’t count up or down. You can change the display name though.

I use one timer element for boil/mash step time. One timer element is the easiest way in my opinion. I set the value of the timer element using a global variable in a script. The same script watches the timer element’s value (wait or if statement) for the end condition. This is either <= O (end of step) or the hop addition time (also a global variable). One can use global variables or script variables. I use a combination of both depending on what I am trying to do. Start with one type and play with it till you get it to function the way you want. Then refine/over complicate it later.
 
Global variables don’t count up or down. You can change the display name though.

I use one timer element for boil/mash step time. One timer element is the easiest way in my opinion. I set the value of the timer element using a global variable in a script. The same script watches the timer element’s value (wait or if statement) for the end condition. This is either <= O (end of step) or the hop addition time (also a global variable). One can use global variables or script variables. I use a combination of both depending on what I am trying to do. Start with one type and play with it till you get it to function the way you want. Then refine/over complicate it later.
Thanks! I think I will revise my screen to do just that. Use that same timer and repurpose it for each step....especially now that I know I can change the display name if I want to.
 
ok one more :)

Trying to set up a PWM PID for controlling my HLT. When updating the target in the device box, the Output (have converted to %) updates correctly.

When I have a global in a script setting the target, the target updates correctly as well as temp if I hold the probe but the output does not update until I stop the script. What am I missing in the script or is it not possible?
 
The output of the PID element is independent of scripts. The output will scale between 0-100% based on the actual temp and target temp. I don’t think you are missing anything. Try water testing…Does the pid element behave as expected when not using a script to set the target?
 
Global variables don’t count up or down. You can change the display name though.

I use one timer element for boil/mash step time. One timer element is the easiest way in my opinion. I set the value of the timer element using a global variable in a script. The same script watches the timer element’s value (wait or if statement) for the end condition. This is either <= O (end of step) or the hop addition time (also a global variable). One can use global variables or script variables. I use a combination of both depending on what I am trying to do. Start with one type and play with it till you get it to function the way you want. Then refine/over complicate it later.
I use one timer for almost every thing. I have been working on a complex hop script that add hops in groups (at the same time). It is a work in progress.

But basically I have a hop script that triggers an alarm at Hop Group1, Hop Group 2 ...... based upon the "boil mash whirlpool settle" timer. We use addition timers for
"fill transfer".

We do use a incremental Global value to control our Brew Script ( and therefore able to jump steps like adding distilled water or not).

You can also use a global value or a timer to control one script from another script based upon the value of the global or the timer value which can be set in the second script for different conditions to affect the first script.
 
Last edited:
Back
Top