Stationeers

Stationeers

Adjustable Grow Lights automation
17 Comments
ждун  [author] 28 Aug, 2024 @ 3:43pm 
and by the way the controller can also be used as simple clock. If you hover mouse over it it will show what is the current daytime hour. 0 being midnight, 6 sunrise etc...
ждун  [author] 28 Aug, 2024 @ 3:39pm 
the amount of light and darkness are just for display so you can check if your set light plan is matching the plants demands. But these numbers are not used to control the lights actually.
Golden Dragon 28 Aug, 2024 @ 3:36pm 
Got it, thx for info :)
ждун  [author] 28 Aug, 2024 @ 3:35pm 
My solution provides much more flixibility. For example you can use natural daylight as light source and for example enable your lights only during night hours. And you must not wait for the running wait times to run out if you want to make changes. Changes will not screw up your light plan. Power outage or shuting down the controller will not screw up your light plan etc..
ждун  [author] 28 Aug, 2024 @ 3:32pm 
but I get your point, the obvious approach is to set balance between light and darkness time with just one dial and then use these proportions for waiting to turn lighs on and off. There are plenty of scripts like that available, but I was unhappy with this approach. Once you start a wait timer, you cannot do anything about it and must wait until it runs out. So you can make changes only once per day. Also if you shut down the controller it will reset the timers and hence the plants may suffer from too much or not enough light for that day.
Golden Dragon 28 Aug, 2024 @ 3:12pm 
Ok, so I just misunderstand how this script work)
ждун  [author] 28 Aug, 2024 @ 2:31pm 
it will read daylight sensor and calculate current day hour (0-24)
then check if the current time is between the start and end time.
If so it will turn the lights on, otherwise off.
ждун  [author] 28 Aug, 2024 @ 2:27pm 
uhm no, this script works differently.
first dial sets the hour (0-24) when the lights are supposed to be turned on
second dial sets the hour when the lights are supposed to be turned off.
amount of light per day is calculated and only displayed to console
The special feature of this script is that it does not use timers. Its not working like turns the lights on and then waits certain time then turns them off. This would have a number of issues, you cannot change already running wait timer. This script applies changes instantly. There is no waiting. You can change dials at any times and the changes will take effect instantly.
HyratelWyvern 28 Aug, 2024 @ 2:23pm 
not SBN, s d0 mode 24
Golden Dragon 28 Aug, 2024 @ 12:58pm 
Either way you're balancing the amount of light per day, right? And essentially changing either of the two controls changes the proportion between the values that add up to 20, right?
ждун  [author] 28 Aug, 2024 @ 12:44pm 
how that?
We are setting an interval with lights on and lights off time here.
Golden Dragon 28 Aug, 2024 @ 12:41pm 
Maybe 1 dial is better than 2?
ждун  [author] 20 Aug, 2024 @ 12:34am 
I know, but there are good reasons to address the devices not by the name and device hash but use the standard technique with the screw driver. I don't want to dictate everyone how they must name their devices and it also only causing confusion for new players.
HyratelWyvern 19 Aug, 2024 @ 7:37pm 
by adding a couple of lines to set the Dials Mode, you can autoset the maximum, no screwdriver needed
jcl25 30 Dec, 2023 @ 3:32am 
Thank you, your script works perfectly :steamthumbsup:
ждун  [author] 31 Dec, 2022 @ 4:51pm 
@Ghola hm, in my tests it worked, i will look into that again. Thanks.
Ghola 31 Dec, 2022 @ 8:12am 
Nice script but it seems to fail when end time is next day, ie start=18 end=6. It works fine for same day. The logic when next day always ensures that register is set to 0 so the AND will always be 0. I'm using default orbital period of 1 and on Vulcan. I confirmed sensor is correct as it reads hours correctly.