Esp32-cam - have Node Red take a picture every hour?

Hello
I have an esp32-cam, and it is added to ESPHome, and Home Assistant. I can see the feed in Home Assistant Dashboard.

What I want to do is to take an image every hour, that I can later review. I am trying to compare the energy reading from my whole-house power sensor (integrated into Home Assistant) against the actual meter images taken hourly.

I have scoured the internet in the hope to find what I need to do in Home Assistant to snap an image and place it somewhere in HA that I can later view.

Any links and help much appreciated. If this is the wrong way to go about this task, I would be interested in any other ideas.

Thanks

I just found this 7 segments OCR integration in HA. This might actually be what I am looking for. I will research this.

Seeing that there are only 3 Home Assistant installs using this does make me wonder if Seven Segments OCR is not the best idea. Will still try to get it working.

Still struggling with getting the image from the esp32-cam into a jpg for later processing.

In node red, I have an Inject node, and a Call-Service node. The Call-service node just calls the snapshot service on the camera. JSON is:

{"filename":"/config/image.jpg"}

Full node-red config:

[{"id":"14ca3abb6a3d4588","type":"api-call-service","z":"d5ad3b24d52309ef","name":"","server":"c97f930d.6fa18","version":5,"debugenabled":false,"domain":"camera","service":"snapshot","areaId":["downstairs"],"deviceId":["7cbfd58903f3f2ed8cca3f9ac1af20ba"],"entityId":["camera.esp_cam_1_esp_cam_powerbox"],"data":"{\"filename\":\"/config/image.jpg\"}","dataType":"json","mergeContext":"","mustacheAltTags":false,"outputProperties":[],"queue":"none","x":810,"y":340,"wires":[[]]},{"id":"76a113aa2f96e4ca","type":"inject","z":"d5ad3b24d52309ef","name":"","props":[{"p":"payload"},{"p":"topic","vt":"str"}],"repeat":"","crontab":"","once":false,"onceDelay":0.1,"topic":"","payload":"","payloadType":"date","x":620,"y":340,"wires":[["14ca3abb6a3d4588"]]},{"id":"c97f930d.6fa18","type":"server","name":"Home Assistant","addon":true}]

Initially, I had errors that I could not write to that folder so I added this to my configuration.yaml and restarted HA.

homeassistant:
  allowlist_external_dirs:
    - /config
  whitelist_external_dirs:
    - /config

I do not want the file in that folder, but HA does not like me putting anything but that folder in the allowlist and whitelist. One issue at a time.

With the above configuration, clicking the inject node results a few seconds of “Sending” under the call service node, and then the error:

Call-service error.

And I cannot find anything on this error. Any thoughts on what I should try next would be greatly appreciated.

OK, I created a Home Assistant automation, and called the camera.snapshot. Then looked at the logs in HA. That gave me some more info than Node Red, and stated that the camera snapshot had timed out. I went into the dashboard, and sure enough, the camera was non responsive. Not great, I guess I will have to workon making the camera more reliable.

So I unplugged it and plugged it back in again, and then triggered Node Red flow, and it succeeded. I then went into the file editor in Home Assistant to the “/config/www/” folder, and there were no files. So now it says it works, but it is either failing to write the file, or is writing it to somewhere other than where I specified to write it.

OK, turns out, writing to /config/www/snap.jpg actually writes to

/homeassistant/www/snap.jpg

But changing it to write to “/www/snap.jpg” states that I cannot write to that folder. I do not know why the /config part of the path is required, but then ignored when writing the file. Confusing.