Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lighting schedule doesn’t work properly #74

Open
curt2199 opened this issue Feb 22, 2020 · 3 comments
Open

Lighting schedule doesn’t work properly #74

curt2199 opened this issue Feb 22, 2020 · 3 comments

Comments

@curt2199
Copy link

curt2199 commented Feb 22, 2020

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.

@trabogano
Copy link

Same here, beta 4 also affected.

@trabogano
Copy link

trabogano commented Mar 23, 2020

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.

@epetti
Copy link

epetti commented Jun 12, 2020

Could the same be applied to fans?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants