I have the official RTC-Battery for the Raspberry PI 5. On the Raspberry Pi OS you can config that the battery is charged while your pi is running, is this also possible on HA?
HASS runs as a virtual machine running on an isolated HAOS kernel. I’d doubt the supervisor exposes the underlying hardware status.
On the other hand, my RPi5 with a battery just works. Although RPiOS (what was Raspian) might have better support for power management, “it just works” via firmware.
The easiest test is to disconnect the network (so no NTP), shutdown, wait, and restart HAOS and see if the time is correct.
Isn’t that the problem, it won’t progress through a startup if it doesn’t get the time in this case from the rtc.
On Raspbian or HAOS? Never seen a boot stop due to bad time on a RPi.
The OS either takes the time from the last filesystem timestamp (which could be years ago, but better than marking files in the past, or NTP.
The RPi5 is the first Pi to have a RTC so it is integrated in the firmware (unlike add-on RTC you may know of like a rtc-ds1307
which need manual scripting).
So it looks like a charging like with RPiOS is not possible, sadly if I understand this right?
It should “just work” via the RPi5 firmware.
See my previous post for how to check.
You can check the voltage and charging voltage with these commands
cat /sys/devices/platform/soc/soc:rpi_rtc/rtc/rtc0/battery_voltage
cat /sys/devices/platform/soc/soc:rpi_rtc/rtc/rtc0/charging_voltage
FYI, these are the steps I took to enable the external RTC battery charging on the haos_rpi5-64-13.1 image
- Connected the SD card to my Linux laptop
mkdir boot
sudo mount /dev/sda1 boot
sudo vi boot/config.txt
(or use nano, notepad, whatever you want. Just make sure to have root permissions)- Added the following line to the file
dtparam=rtc_bbat_vchg=3000000
(that’s a total of six 0s) sync
sudo umount boot
- Make sure any other drives that were auto-mounted are unmounted, and safely remove the SD card from the laptop
- Put back into Pi, powered up, and verified charging voltage was set
[core-ssh ~]$ cat /sys/devices/platform/soc/soc\:rpi_rtc/rtc/rtc0/charging_voltage
3000000
[core-ssh ~]$ cat /sys/devices/platform/soc/soc\:rpi_rtc/rtc/rtc0/battery_voltage
2886321
In case things change on a future update, the instructions mostly came from here: https://www.raspberrypi.com/documentation/computers/raspberry-pi.html#enable-battery-charging
Maybe there is a simpler way to do this without needing to use a laptop? I’m not too familiar with HomeAssistant yet.