Open ghost opened 4 years ago
Hope to get support
This could go very nice along with a ntp server component https://github.com/esphome/feature-requests/issues/296 :tada:
hopefully there will be support for ds1307 too
Sometimes electricity breaks in our location and then restores, but internet connection restoring in a long time after usually, so our ESP modules cannot understand the time for light controlling logic
Just been looking for ways to have backup programming for my boiler and an RTC was a requirement - would love to see it!
Me too. If there is no wi fi, I would like to show the correct time on the display.
hopefully there will be support for ds1307 too
I have finally started working on that again: https://github.com/esphome/esphome/pull/1441
The DS3231 register set is so similar to the one of the DS1307, that the DS1307 component (esphome/esphome#1441) should already work with a DS3231. I could not test this, however, because I don't have such a device at hand; and additional features such as temperature readings and alarms are obviously not supported.
I could definitely also provide a dedicated driver component for the DS3231 if I had one to test with. :-) https://www.amazon.de/hz/wishlist/ls/IKJQ9RPIUL6J
https://github.com/esphome/esphome/pull/1441 is merged in 1.16.0b2.
@badbadc0ffee I need to find my DS3231 somewhere in the drawer so I can test it with your component! Thank's already for your work :+1:
Any update on DS3231 support for ESP32? Or if someone can show us how ti write our own code porting from conventional Arduino IDE based approach to get DS3231 integrated into ESPHOME.
I would like if I can wake ESP by external clock to do its job and then turn it off completely. It is not conceptually correct to have ESP sleeping and all supporting circuitry powered up if no job is needed. Everything should be powered down until its time comes.
@jbrepogmailcom I think you misunderstand. It is perfectly reasonable to leave the rest of the external support circuitry powered up when calling a routine that is documented to put the processor to sleep. Switching off power to the entire board is beyond the scope of the the deep sleep routine. You could probably build a basic switch from a couple of transistors, or use a dedicated power management IC (eg. AXP192)
Hello, we are probably talking about different things. I meant to switch off both circuitry and ESP32 by DS3231 during the deep sleep, not before. And after wakeup, to reprogram DS3231 for nex sleep. However, I learned in the meanwhile that DS3231 takes about 100µA during sleep, while ESP32 with RTC on takes 10µA in deep sleep and 5µA in hibernation mode. So it is better to use ESP32 itself to manage sleep time and turn on/off supporting electronics.
A bit late to the discussion, but the DS1307 component in ESPHome seems to work just fine with the DS3231 module. I have it attached to a NodeMCU 32s board and it's ticking along nicely.
Edit: I'm getting two devices at the i2c scan. I'm, ofc, using 0x68. I have no idea what the other is tbh.
[22:17:45][C][i2c:028]: I2C Bus:
[22:17:45][C][i2c:029]: SDA Pin: GPIO21
[22:17:45][C][i2c:030]: SCL Pin: GPIO22
[22:17:45][C][i2c:031]: Frequency: 50000 Hz
[22:17:45][I][i2c:033]: Scanning i2c bus for active devices...
[22:17:45][I][i2c:040]: Found i2c device at address 0x57
[22:17:45][I][i2c:040]: Found i2c device at address 0x68
[22:17:45][C][ds1307:022]: DS1307:
[22:17:45][C][ds1307:023]: Address: 0x68
Edit: I'm getting two devices at the i2c scan. I'm, ofc, using 0x68. I have no idea what the other is tbh.
The other is likely 32K of eeprom (AT24C32X), which I know can have an address of 0x57 and appears on modules like this:
Writing to and reading from it is not currently supported by esphome.
That seems very likely, as that's the exact module I have :-)
I currently have no use for the eeprom on the module, so it's not really something I would wish esphome to focus on anyhow.
Thanks for the information!
Just to throw my two cents in. For my ESPHome sensors, I'm hoping to replicate the work found https://www.raspberrypi.com/news/build-low-power-clock-controlled-devices/ to greatly prolong the battery life on my sensors. It seems like this "sleep" method allows for zero current to the DS321 (via VCC) or ESP32 and very, very low current for the P-Channel Mosfet switch (< 1mA). The DS3231 runs from the coin cell while waiting for the next alarm. When that alarm happens, the DS3231 switches the mosfet, the ESP32 circuit is powered on. The ESP32 can then do it's business, set a next alarm, and when it clears the current DS3231 alarm the ESP32 circuit is shutdown (completely), along with the VCC input on the DS3231 (so it is only running from the coin-cell until it triggers the next alarm, turning the ESP32 circuit back on).
It seems like several others have more or less the same goal. Has anyone made any progress?
I first will probably just do it as an Arduino or MicroPython app and publish to Home Assistant via MQTT (via node-red probably). I'd love to then transfer what I've learned to be able to do this with ESPHome, but we'll see how far I get on that front. It's currently not clear to me how I'd want to implement this in ESPHome. Maybe as an alternative to deep sleep or via lambda scripts?
The unit I ordered for testing is https://www.amazon.com/gp/product/B07WJZ7NKM - I've read you specifically should prefer the DS3231SN versions of the chip.
That's an interesting device for reading/writing time. The ds3231 could enable doing a lot more. See my description above.
My goal is to be able to use the ds3231 to be able to be able to power down circuit including the esp32 for stretches of time and it can trigger turning the circuit back on to do work - and the cycle repeats.
I have a Norvi NORVI-ENET-AE06-R DIN mount ESP32 that uses a DS3231, I found that the built-in ds1307 component seems to works fine for RTC only purposes.
Describe the problem you have/What new integration you would like
I understand supporting this should not be a priority over other useful sensors, but having support for some kind of reliable I2C RTC chip would be nice in certain situations, especially if the ESPHome node is placed at a location where the wifi signal strength is poor. Please describe your use case for this integration and alternatives you've tried:
Without a bulky external antenna, GPS modules don't work that well in some buildings, sometimes it won't even get a fix at all. Additional context