meter reader logging improvenets
This commit is contained in:
@@ -8,6 +8,8 @@ RUN apk add --no-cache curl
|
||||
RUN apk add --no-cache python3
|
||||
RUN apk add --no-cache nano
|
||||
|
||||
RUN apk add cmd:pip3
|
||||
|
||||
# install .py script dependency
|
||||
RUN pip3 install boto3
|
||||
RUN pip3 install requests
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "Meter Reader",
|
||||
"version": "0.1.16",
|
||||
"version": "0.1.19",
|
||||
"slug": "meterreader",
|
||||
"homeassistant_api": "no",
|
||||
"description": "Put a webcam in front of your utility meter and let AWS Rekognition push the reading over mqtt",
|
||||
|
||||
@@ -48,7 +48,7 @@ def processor(base_low, baseline, base_up):
|
||||
found = (response['TextDetections'])
|
||||
reading = ""
|
||||
for item in found:
|
||||
print("Tekst:", item['DetectedText'])
|
||||
print("DetectedText:", item['DetectedText'])
|
||||
print("Type:", item['Type'])
|
||||
print("Confidence", item['Confidence'])
|
||||
print("Id", item['Id'])
|
||||
@@ -64,15 +64,16 @@ def processor(base_low, baseline, base_up):
|
||||
try:
|
||||
nw = int(temp)
|
||||
except Exception:
|
||||
print("Conversion failed")
|
||||
print("Conversion to int failed")
|
||||
pass
|
||||
print("Nw: ", nw)
|
||||
print("Converted int: ", nw)
|
||||
if (base_low <= nw and nw <= base_up):
|
||||
print("erg waarschijnlijk juist:")
|
||||
print("Value found in range:")
|
||||
reading = temp
|
||||
print(temp)
|
||||
print(base_low, nw, base_up)
|
||||
print("-----------")
|
||||
print("Returning reading: ", reading)
|
||||
return reading
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user