07.11.2022, 08:13
Hi, I need some guidance, I have 10 Event-based/Resident scripts that I need to be able to start from one button and stop from another button.
The scripts i have is as follows:
Event-based:
solenoid_address = '2/0/20'
value = event.getvalue()
script.set('solenoid_east', value)
grp.checkwrite(solenoid_address, value)
Resident:
solenoid_address = '2/0/20'
grp.checkwrite(solenoid_address, true)
os.sleep(60)
grp.checkwrite(solenoid_address, false)
os.sleep(300)
I have 10 similar scripts for different solenoids
If they press "start all" all the scripts should turn on, if one of the scripts was already started it just keeps running
If they press "stop all" all the scripts should stop no matter what.
And can i use the "start button" to indicate only if all solenoids is on?
And the "stop button" to indicate only if all solenoids is off.
Ohh and is it possible to add a delay so that I don't start all the scripts at the same time? (water pressure)
I don't know if my approach with individually scripts is the right way of doing it?
If not can you turn me in the right direction?
The scripts i have is as follows:
Event-based:
solenoid_address = '2/0/20'
value = event.getvalue()
script.set('solenoid_east', value)
grp.checkwrite(solenoid_address, value)
Resident:
solenoid_address = '2/0/20'
grp.checkwrite(solenoid_address, true)
os.sleep(60)
grp.checkwrite(solenoid_address, false)
os.sleep(300)
I have 10 similar scripts for different solenoids
If they press "start all" all the scripts should turn on, if one of the scripts was already started it just keeps running
If they press "stop all" all the scripts should stop no matter what.
And can i use the "start button" to indicate only if all solenoids is on?
And the "stop button" to indicate only if all solenoids is off.
Ohh and is it possible to add a delay so that I don't start all the scripts at the same time? (water pressure)
I don't know if my approach with individually scripts is the right way of doing it?
If not can you turn me in the right direction?