Configure the NUT server on the RPi, add the NUT integration in HA, point the configuration to your server.
There’s plenty of documentation available on the internet on how to configure NUT on an RPi. The HA side of things is pretty simple and gives you the sensors once everything is configured correctly.