Hass.io RPI and RTC ds3231

I apologize if this has already been discussed and I gave up on searching too soon.

So I have hass.io installed on an RPI3 with a zwave stick. So far it has been working well, but I’d like to address a scenario. Since hass is running on a RPI3, which does not have a battery backed realtime clock, if the power goes out then comes back on the RPI will not know what time it is. It will try to set the time via NTP, but if my internet is down then the RPI is pretty much useless and won’t fire off time based automation scripts at the correct times.

There are various RTC modules for RPI. I bought a DS3231 based module that plugs into the GPIO header and uses I2C. Has anyone successfully gotten hass to communicate with and use a RTC module? I have an old RPI1 that I’m tempted to fire up with raspbian and set it up as an NTP server with the RTC as an alternative, but I’d prefer that hass isn’t reliant on anything else to function.

1 Like

Not sure when I’ll get to it but I’ll try this when I get a chance.

For Hassio I think you need to activate I2C from either Dockerfile or package.json.

Resin documentation for enabling I2C:
https://docs.resin.io/hardware/i2c-and-spi/#i2c

I haven’t tried it out yet, but I also have a DS3231 I want to connect. Did you get it working?

I haven’t gotten it to work. I got distracted when I was last working on it and haven’t gotten back to it. I probably won’t work on it tonight but if I’m iced in tomorrow I might give it a shot again.

I know it’s almost 2 years back post. But any one figured a way to configure DS3231 on Pi 3/4? I have few issues with my internet and wanted to go around it’s down times. It’s better to have a hardware RTC to raspberry Pi so that we don’t miss time based automations.

1 Like

I’m also watching this thread hoping for a solution.

I was able to add a DS3231 RTC module to my Pi3B+ running Raspian very easily. It would be great to find a way and utilize the RTC module in hass.io as well.

1 Like

I have started using home assistant few days ago and for now I am a little bit disappointed how the problem with NTP is handled. It will be great if RTC can be used instead.

2 Likes

Any update on this?

Would like to get this working too.

I desperately need this for a smart home display board I am creating for a local college.
The board will not have internet access and, since home assistant has started being unreliable to boot without internet access, I need to find a way around it.

Surely an rtc would be the way to go.

Plus one on the RTC module. I tried doing a manual installation of Homeassistant on top of Raspberry Pi OS Lite, having setup the RTC first. Now I have to automate the startup of Hass within a virtual python environment. I’d rather just have the RTC work with the standard install.

As it turns out, it’s easier than I thought. Followed the instructions here:

How does this relate to setting up hwclock with ds3231 in HAOS?

1 Like

Several users report a working solution in this topic: