FruxePi icon indicating copy to clipboard operation
FruxePi copied to clipboard

Lighting schedule doesn’t work properly

Open curt2199 opened this issue 5 years ago • 3 comments

Running 0.3-beta and have been fighting with it. It doesn’t seem to follow the schedule no matter what I try. Also the listed time until lights on or off always just reflects the current time.

BBC2AFD0-5127-4377-A328-7E7307D954C4

I’m pulling it today to try out some other automation software because having a proper light schedule is critical.

curt2199 avatar Feb 22 '20 13:02 curt2199

Same here, beta 4 also affected.

trabogano avatar Mar 21 '20 01:03 trabogano

I found a possible solution, it seems that relay has inverted logic in script. Turn off manual control edit fruxe script with sudo nano /var/www/html/actions/fruxepi.py Relevant section is here:

Lights

elif action == "lights":  

#I have edited this line original in this section are ON i have changed in OFF # Lights OFF if action_option == "-OFF" and action_GPIO is not None: lightsON(action_GPIO, action_interval)

#Same here i have switched OFF to ON # Lights ON elif action_option == "-ON" and action_GPIO is not None: lightsOFF(action_GPIO, action_interval) # Light Relay State
elif action_option == "-s" and action_GPIO is not None: print(getRelayGPIOState(action_GPIO, action_interval))

Same here i have inverted on to off and vice versa:

Lights OFF

def lightsON(gpioPIN, reverseRelay): print("Lights OFF") if reverseRelay: os.system("gpio -g mode " + str(gpioPIN) + " out") os.system("gpio -g write " + str(gpioPIN) + " 0") else: os.system("gpio -g mode " + str(gpioPIN) + " out") os.system("gpio -g write " + str(gpioPIN) + " 1")

Lights ON

def lightsOFF(gpioPIN, reverseRelay): print("Lights ON") if reverseRelay: os.system("gpio -g mode " + str(gpioPIN) + " out")

Now my cron job work perfectly but i dont think cron is the best way to do this if you switch to manual and you try to back in automatic light remain off until cron call the program to say lights ON

It need more code for better automation.

trabogano avatar Mar 23 '20 15:03 trabogano

Could the same be applied to fans?

epetti avatar Jun 12 '20 18:06 epetti