Like I commented above, I tried threshold 20,30,40 and then removed it to use -T:
-T, --iter-threshold
Use an iterative method (one-dimensional k-means clustering) to determine the threshold used to distinguish black from white. A THRESHOLD value given via -t THRESHOLD sets the starting value.
The hard question to dig in is which options have been mapped to yaml config?
There’s no documentation that I could find that explain how HA integrated this SSOCR.
Unable to detect value: ***** Imlib2 Developer Warning ***** : This program is calling the Imlib call: imlib_image_get_width(); With the parameter: image being NULL. Please fix your program
Ok then, thus the implementation of HA of ssocr is passing NULL values when we don’t specify width and possibly other parameters.
Again, where is this documented?
So I added back those parameters and restarted HA. No error in logs, but no detected value.
x_position: 0
y_position: 0
height: 73
width: 280
If I replicate those parameters on the command line, I get a good result.
Sure, I created 1st an automation that save a image of the camera (ESPHome esp-wrover-kit) also input numbers and other automation to avoid wrong values.
try this. It looks like you do not use the last standard for template/sensor in your conf yaml ( Template - Home Assistant) ). I think the issue comes from your template
-d, --number-digits RANGE
Specifies the number of digits shown in the image. Default value is 6. Use -1 to automatically detect the number of digits. Use a single positive number to specify an exact number of digits. Use two positive numbers separated with a hyphen (-) to specify an inclusive range of acceptable values for the number of digits.
Good news, I contacted the developer of ssocr. He suggested adding -f white to detect white chars. Works like a charm on a command line, but the way HA implement this, it’s not possible to pass the arguments properly.
extra_arguments: r_threshold -f white
This does not work, since r_threshold is a command not an option (argument)
====================
UPDATE: The order of parameters can be adjusted to work.
Here’s what works for me for the 2 digit display above: