How to switch on light

this is the beginning of the components. below there are more modules like this

Thanks this is all very new to me. Do you have a working code using the GPS and DS1307 time source so that i can learn from the code?

There is a sample code in the documentation. I don’t use modules like that, but setting them up is easy.

Thanks again. Is it possible at all to run esphome without the need to first synchronize with an RTC source (as mentioned in that section of documentation you referred to)?

Of course!

Could you please tell me what should I do in this instance - my ESP8266 has no access to wifi/internet at all and i would like it to still turn on and off the GPIO pins at nominated time.

If you want to turn stuff on and off at a certain time you need a real time clock source. The esp8266 does not have a real time clock source. You need to add one.

There are four options:

Home Assistant - not for you, it requires a network

SNTP - not for you, it requires a network

GPS - has it’s own time source from satellite, will work for you but you need to buy a gps module and be able to see the sky. They are cheap as. Aliexpress has them for $4 approx.

DS1307 I am not very familiar with this but there is a data sheet here https://datasheets.maximintegrated.com/en/ds/DS1307.pdf. It also needs another time source

In a typical setup, you will have at least one additional time source to synchronize the RTC with. Such an external time source might not always be available e.g. due to a limited network connection. In order to have a valid, reliable system time, the system should read the RTC once at start and then try to synchronize with an external reliable time source. When a synchronization to another time source was successful, the RTC can be resynchronized.

which really only leaves you with gps.

Many thanks Nick.

That is a concise answer. Basically what I am having now will not work in its current state. I will need to at least get the GPS module. I will investigate further.

Thanks again.

2 Likes