I have managed to do what I wanted and everything seems to be fine.
I have setup a usb camera to the raspberry and it points to my UPS screen. I now know the remaining battery through seven_segments component and with the right automation, I have notifications in my phone, informing me of the remaining battery percentage.
One problem I have now, is that seven_segments require a specific number of digits to read.
My UPS has 3 digits when full charged (100%) but only two when discharging (99%).
If I setup 3 digits in my seven_segments setup, then when the number changes, I get a message saying that only two of three digits found and it doesnt return the number.
It works if I set it up with 2 digits, but then when the battery is fully charged and the screen shows 100% then I get this error: Unable to detect value: found too many digits (3)
Sooo… I am trying to come up with a solution here… Anyone?
I already have one. The thing is there is nothing read for the template sensor to work.
This comes straight from the component.
If you set it to read 2 digits and there are 3, then it just doesnt work. Same thing happens if you set it to read 3 digits and there are 2. The result is “unknown”
Here is what it looks like in my screen. I have set this view temporarily to be easier for me to debug.
Oh my… I never saw that. It was in front of my eyes, yet somehow i passed it!
It is now showing the correct number. But I will test if it reads the correct digits when I get home tonight. I suppose it will work now!
Thank you a lot!