Trying to make an auto-adjusting light timer
Moderators: grovkillen, Stuntteam, TD-er
Re: Trying to make an auto-adjusting light timer
Is %sunset% something that is set and usable any time after sunset (until sunrise), or is it a one-time event (specific to a hour:minute)?
I'm just trying to think of a power outage situation - would I be able to check %sunset% say, 3 hours after sunset, and know to turn the light on? Here in Florida, it's more common to have little power blips due to lightning storms than I'd prefer.
I'll try the 22 hour timer idea. That should work until the %sunset% - 2h is implemented. I guess if there was a power outage, the light would turn-on at sunset that first night and then the following nights, the 22 hour timer would take-over.
I'm just trying to think of a power outage situation - would I be able to check %sunset% say, 3 hours after sunset, and know to turn the light on? Here in Florida, it's more common to have little power blips due to lightning storms than I'd prefer.
I'll try the 22 hour timer idea. That should work until the %sunset% - 2h is implemented. I guess if there was a power outage, the light would turn-on at sunset that first night and then the following nights, the 22 hour timer would take-over.
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: Trying to make an auto-adjusting light timer
Yes your suspicion is probably right. If you set up the rule that way. You can do a check every night at 01:00 (as an example) that set the timer for that next sunset (or rise).
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you
Re: Trying to make an auto-adjusting light timer
To test, I just ran:
It's before sunset, so if the sunrise variable was continuously available, I'd expect to see my light turn on. However, it did not, so I'm guessing that %sunrise%/%sunset% are "hour:minute" specific and not something that's queryable at any time. That makes recovering from power outages (in a self-contained EasyESP device) more difficult.
Code: Select all
On Clock#Time=All,%sunrise% do
gpio,12,1
endon
Re: Trying to make an auto-adjusting light timer
- just add another rule to turn the light on at a certain time
- a reboot also resets the internal clock - so after a power outage the esp needs an ntp server, which means you could turn on the light with a script running on your router or somewhere else in your network
- use a light sensor with an adjustable digital output for 60 cents (https://www.aliexpress.com/item/2PCS-Ph ... 32805.html)
- a reboot also resets the internal clock - so after a power outage the esp needs an ntp server, which means you could turn on the light with a script running on your router or somewhere else in your network
- use a light sensor with an adjustable digital output for 60 cents (https://www.aliexpress.com/item/2PCS-Ph ... 32805.html)
Re: Trying to make an auto-adjusting light timer
I just ordered a handful of those light sensors and will try them out.
However, my overall goal was a *standalone* timer that didn't need a server (router, Pi, etc.) and would be suitable for tech-incompetent in-laws, for example. Having to ensure that both the 'server' and the various 'outlets' are communicating is something I'd rather not deal with over the phone. If the outlets can simply join the wifi when available and begin working, that's the goal.
However, my overall goal was a *standalone* timer that didn't need a server (router, Pi, etc.) and would be suitable for tech-incompetent in-laws, for example. Having to ensure that both the 'server' and the various 'outlets' are communicating is something I'd rather not deal with over the phone. If the outlets can simply join the wifi when available and begin working, that's the goal.
Re: Trying to make an auto-adjusting light timer
Providing the correct time to the outlets for any time based operation is some sort of communicationHaving to ensure that both the 'server' and the various 'outlets' are communicating is something I'd rather not deal with
And how would you do that with the sonoff?was a *standalone* timer
This functionality requires some rtc module (or dcf77,...) which is not part of sonoff devices.
Which would require some kind of wifi router, where you possibly could run the ntp server, scripts, etcsimply join the wifi
If you dont want / need communication between the devices, it is easier to buy a light with a brightness sensor.
Cause communication is the feature, a normal hardware device cant provide (eg you could publish the value from the light sensor to other devices, so that you would only need one sensor for n actors)
Re: Trying to make an auto-adjusting light timer
Sorry - by 'server' I meant another device running some kind of software that I have to install/maintain. I can use the in-law's router for wifi, but I don't want to be trying to run something on it (I'm sure it's the cheapest PoS router anyway). So far, using NTP on the Sonoff seems to work well enough and other than power outages, I think this auto-setting outlet is probably 'good enough' for their needs. For my own home system, where I'm hands-on, I plan to run HassIO or something and with that, I'll get more advanced in data retrieval/etc.
Thanks for the ideas everyone.
Mike
Thanks for the ideas everyone.
Mike
- grovkillen
- Core team member
- Posts: 3621
- Joined: 19 Jan 2017, 12:56
- Location: Hudiksvall, Sweden
- Contact:
Re: Trying to make an auto-adjusting light timer
As of the nightly released today we now support offset of the sunset and sunrise. It's explained here: https://www.letscontrolit.com/wiki/inde ... _Variables
ESP Easy Flasher [flash tool and wifi setup at flash time]
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you
ESP Easy Webdumper [easy screendumping of your units]
ESP Easy Netscan [find units]
Official shop: https://firstbyte.shop/
Sponsor ESP Easy, we need you
Who is online
Users browsing this forum: No registered users and 74 guests