Hi all, first up I am not very experienced in coding, so please be kind!
I have a pi zerowh running a security camera via motioneye running on raspian buster lite. To give it a bit more of a security function I have a UPS hat (this one) which has a python script on their github page to measure the battery. This works fine, and the battery lasts about 10 minutes with a camera attached, but I thought it would be nice to add to my HA instance to think about an automatic shutdown.
So my question is how? I figure that a cron job to run the script is (with googling) easy, but then how do I import that data into HA? MQTT might be a way to go but I have no clue how to add this to a code. I was also interested in how glances works and if this battery info could be piggy backed? So any help gratefully received!
I am running hassOS on a Pi4B 8gb.
Many thanks
Bob