Integrating Blue Iris, Pushover, Node-RED, and Amazon Rekognition

Hmm, looking at the latest version of post #1, it seems @TaperCrimp removed the Call Service node that calls camera.snapshot.
I kept that Call Service node in my flow, but I don’t see it mentioned in post #1 anymore.

That would be correct. The older versions of the custom plugin required it if I remember correctly. No need for it in the current versions.

Ah ha. I see. I kept camera.snapshot around because sometimes i still want a notification + pic when Person(s) are outside the ROI.

Yes, for 99% of use-cases, you don’t need to call camera.snapshot because the rekognition component saves an image after processing

@TaperCrimp, i think there’s a bug in post #1
The notification is using the old snapshot dir:

msg.image = "/config/www/camera_snapshot/

The screenshot seems to use the new dir.

You are correct. Do you have it running by any chance? I switched over the Deepstack and I’m drawing a blank on the default file name that the Rekognition component uses.

EDIT: ignore that, found it. Thanks much.

Do you use NodeRed with Deepstack ? if so, how do you send images to it?
Tried to find a Deepstack node, but no luck so far.

I’ve actually switched all of this over to your Deepstack integration . Local, fast, and works extremely well. Great job!

Oh man…I just came across this thread today, was reading it through, got all excited and ready to start setting this up, and then I see your post about Deepstack. Gahh…now I want that instead :smiley: Especially if the Rekognition plugin isn’t being maintained.

How much we gotta bribe you to create an excellent guide like this but for using Deepstack integration instead?

1 Like

I think there are enough folks using the Rekognition integration that the community will keep it working (at a minimum). I rely on it daily so I’m willing to fix bugs if it breaks.
I’m interested in trying Deepstack, however my list of HA to-do’s for the house is long, and Rekognition “just works” so Deepstack is lower on my list.

Ha, it’s exactly the same. You just need to enable the Deepwatch integration and change image_processing.rekognition_ to image_processing.deepstack_object_ in the Convert node.

At this point I’ve tried Deepwatch, Rekognition, and Sitehound. I had a ton of false-postives with Sitehound. Deepwatch and Rekognition seem to be equally good at detecting people, but Deepwatch runs locally. They’re both fast though.

1 Like

Ha awesome! Glad to hear. Thanks for that clarification and thanks for putting all the work in this to help the community! Much appreciated and really helps keeping the entire ecosystem progressing.

I think there are enough folks using the Rekognition integration that the community will keep it working (at a minimum). I rely on it daily so I’m willing to fix bugs if it breaks.

Good to hear! Still considering both rekognition and deepstack. There is something nice about not needing to worry about crashes on a local server and whether the host is beefy enough to handle the task, but at the same time, having it all local is really nice and why I left SmartThings in favor of H.A. to begin with.

One nice thing about AWS though is that I imagine I should be able to write a lambda to intercept all calls to rekognition and store the images that result in a positive result for a person right in S3. I can also easily send out an MQTT message right then and/or do other fun stuff.

Been using this for a long time and it’s wonderful. Is there any way to mask out a certain area of the picture? I want to detect people on my property, but not on sidewalk or in the street. (Blue iris motion areas are set for my property, but if shadows/bugs set it off, it’ll detect people in the street, Neighbors,etc)

So I added 2 new views of cameras that I wanted to analyze (I made 2 “new” cameras with different areas of interest, to basically narrow the view/picture I want to send to Amazon). However, this is the error I’m getting in Node Red when it runs through the process. Thoughts?

Go into Developer Tools -> States and check what image_processing.XXXYYY devices exist. Might be a name mismatch. I also had to rewrite the instructions a while back since the Rekognition add-on used a new naming scheme for the devices.

Hey, tried to get it working with deepstack… installed that and believe that’s up and running. In HA states my first camera i’m testing it on shows unknown for image_processing.deepstack_object_fsc and all the counts as 0.
In node red I see it get all the way to the person check where it shows NAN with an error message "entity could not be found in cached for entity_id: image_processing.deepstack_object_fdc

You want to configure the ROI (Region of Interest) feature:

Thanks - I actually just read into that, but it’s confusing to figure out the x/y min/max for the picture I want to analyze. Is there a generator tool somewhere that lets me draw a box on a snapshot and have it give me the x/y? or is it all trial & error?

to find the x/y for ROI, i did this:
Download an image from the camera.
Load it in Gimp (or similar graphics app).
In addition to the image’s x & y size, it will also tell you the pixel coordinate of your mouse pointer that’s hovering over the image. So hover your mouse over the ROI corner locations you want, then convert the number of pixels in the x/y direction to %

So, I have this working properly now, I believe. However, I have 3 different cameras under my image_processing yaml file - each one as their own separate setup, because of ROI - but only one of the cameras actually generates pictures and gets analyzed by amazon. BI mqtt alerts look fine - I can see the image_processing entities. One of them has a status of “unknown”. Not sure why this one isn’t working fine.

Need some help with my flow. I would like it so that Google Say is only for my front door camera and no other one. I am not sure you to split it out.

[{"id":"1606d5dd.d5fe2a","type":"tab","label":"Doors and Windows","disabled":false,"info":""},{"id":"237c0294.05532e","type":"api-call-service","z":"1606d5dd.d5fe2a","name":"","server":"9c348138.e8443","version":1,"debugenabled":false,"service_domain":"tts","service":"google_say","entityId":"media_player.basement_mini, media_player.kitchen_mini, media_player.upstairs_mini,media_player.computermini","data":"","dataType":"json","mergecontext":"","output_location":"payload","output_location_type":"msg","mustacheAltTags":false,"x":750,"y":260,"wires":[[]]},{"id":"997320b9.cdd52","type":"api-call-service","z":"1606d5dd.d5fe2a","name":"Close Pop-up","server":"9c348138.e8443","version":1,"debugenabled":false,"service_domain":"browser_mod","service":"close_popup","entityId":"","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":680,"y":520,"wires":[[]]},{"id":"9fc35a4b.f88728","type":"delay","z":"1606d5dd.d5fe2a","name":"","pauseType":"delay","timeout":"20","timeoutUnits":"seconds","rate":"1","nbRateUnits":"1","rateUnits":"second","randomFirst":"1","randomLast":"5","randomUnits":"seconds","drop":false,"x":680,"y":440,"wires":[["997320b9.cdd52"]]},{"id":"728d70e9.07855","type":"api-call-service","z":"1606d5dd.d5fe2a","name":"Enable Pop-up Fire","server":"9c348138.e8443","version":1,"debugenabled":false,"service_domain":"browser_mod","service":"popup","entityId":"camera.front_door","data":"{\"title\":\"Front Door\",\"card\":{\"type\":\"picture-entity\",\"entity\":\"msg.data.camera\"},\"large\":\"true\",\"deviceID\":\"b33a1135-e9b7d9e9\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":670,"y":380,"wires":[["9fc35a4b.f88728"]]},{"id":"f0a1983b.eee6a8","type":"pushover api","z":"1606d5dd.d5fe2a","keys":"82a58f58.58875","title":"","name":"","x":440,"y":460,"wires":[]},{"id":"652129ce.b5df38","type":"time-range-switch","z":"1606d5dd.d5fe2a","name":"After Sunset","lat":"43.9174013","lon":"-78.8269378","startTime":"sunsetStart","endTime":"sunrise","startOffset":"","endOffset":"","x":170,"y":380,"wires":[["b0a113e.0aca0f"],[]]},{"id":"b0a113e.0aca0f","type":"api-current-state","z":"1606d5dd.d5fe2a","name":"Already On?","server":"9c348138.e8443","version":"1","outputs":2,"halt_if":"on","halt_if_type":"str","halt_if_compare":"is_not","override_topic":true,"entity_id":"switch.outside_light","state_type":"str","state_location":"payload","override_payload":"msg","entity_location":"data","override_data":"msg","blockInputOverrides":false,"x":170,"y":440,"wires":[["63b1b51c.bd6fdc"],[]]},{"id":"15b89ef8.116981","type":"stoptimer","z":"1606d5dd.d5fe2a","duration":"1","units":"Minute","payloadtype":"num","payloadval":"0","name":"1min","x":150,"y":560,"wires":[["f819cdcd.5e80e"],[]]},{"id":"f819cdcd.5e80e","type":"api-call-service","z":"1606d5dd.d5fe2a","name":"Turn Off Outside Light","server":"9c348138.e8443","version":1,"debugenabled":false,"service_domain":"switch","service":"turn_off","entityId":"switch.outside_light","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":200,"y":620,"wires":[[]]},{"id":"63b1b51c.bd6fdc","type":"api-call-service","z":"1606d5dd.d5fe2a","name":"Turn On Outside Light","server":"9c348138.e8443","version":1,"debugenabled":false,"service_domain":"switch","service":"turn_on","entityId":"switch.outside_light","data":"","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":200,"y":500,"wires":[["15b89ef8.116981"]]},{"id":"3d46994e.a01206","type":"server-state-changed","z":"1606d5dd.d5fe2a","name":"Camera Motion","server":"9c348138.e8443","version":1,"exposeToHomeAssistant":false,"haConfig":[{"property":"name","value":""},{"property":"icon","value":""}],"entityidfilter":"binary_sensor.\\w{3}_motion","entityidfiltertype":"regex","outputinitially":true,"state_type":"str","haltifstate":"on","halt_if_type":"str","halt_if_compare":"is","outputs":2,"output_only_on_state_change":false,"for":"","forType":"num","forUnits":"minutes","ignorePrevStateNull":false,"ignorePrevStateUnknown":false,"ignorePrevStateUnavailable":false,"ignoreCurrentStateUnknown":false,"ignoreCurrentStateUnavailable":false,"x":120,"y":80,"wires":[["e0ba4357.1040d"],[]]},{"id":"b17965df.6b5488","type":"api-current-state","z":"1606d5dd.d5fe2a","name":"Person Check","server":"9c348138.e8443","version":1,"outputs":2,"halt_if":"0","halt_if_type":"num","halt_if_compare":"gt","override_topic":false,"entity_id":"","state_type":"num","state_location":"","override_payload":"none","entity_location":"","override_data":"none","blockInputOverrides":false,"x":140,"y":280,"wires":[["b7c8eff5.bee7a","652129ce.b5df38","4a54a036.adac4","728d70e9.07855"],[]]},{"id":"fc0af4e0.6e9188","type":"api-call-service","z":"1606d5dd.d5fe2a","name":"Deepstack","server":"9c348138.e8443","version":1,"debugenabled":false,"service_domain":"image_processing","service":"scan","entityId":"","data":"{\"entity_id\":\"{{data.image_processing}}\"}","dataType":"json","mergecontext":"","output_location":"","output_location_type":"none","mustacheAltTags":false,"x":130,"y":200,"wires":[["b17965df.6b5488"]]},{"id":"b7c8eff5.bee7a","type":"function","z":"1606d5dd.d5fe2a","name":"Payload","func":"msg.payload = \"Sensor: \"\nmsg.topic =  msg.data.new_state.attributes.friendly_name;\nmsg.device = \"pixel2xl\";\nmsg.priority = 1;\nmsg.image = \"/config/www/Images/FromCam/deepstack_object_\" + msg.data.base_id + \"_latest.jpg\"\nreturn msg;\n","outputs":1,"noerr":0,"initialize":"","finalize":"","x":440,"y":380,"wires":[["f0a1983b.eee6a8"]]},{"id":"e0ba4357.1040d","type":"change","z":"1606d5dd.d5fe2a","name":"Convert","rules":[{"t":"delete","p":"payload","pt":"msg"},{"t":"set","p":"data.base_id","pt":"msg","to":"$match(topic, /binary_sensor.(\\w{3})_motion/).groups[0].$string()","tot":"jsonata"},{"t":"set","p":"data.camera","pt":"msg","to":"\"camera.\" & $.data.base_id","tot":"jsonata"},{"t":"set","p":"data.image_processing","pt":"msg","to":"\"image_processing.deepstack_object_\" & $.data.base_id","tot":"jsonata"},{"t":"set","p":"data.camera_snapshot","pt":"msg","to":"\"/config/www/Images/FromCam/snapshot_\" & $.data.base_id & \".jpg\"\t","tot":"jsonata"},{"t":"set","p":"payload.entity_id","pt":"msg","to":"\"image_processing.deepstack_object_\" & $.data.base_id","tot":"jsonata"}],"action":"","property":"","from":"","to":"","reg":false,"x":140,"y":140,"wires":[["fc0af4e0.6e9188"]]},{"id":"4a54a036.adac4","type":"function","z":"1606d5dd.d5fe2a","name":"FriendlyName","func":"const friendlyName = msg.data.new_state.attributes.friendly_name;\nnode.status({text: friendlyName});\nreturn {\n        \"payload\": {\n           \"data\": {\n               \"message\": friendlyName \n           } \n    }\n};","outputs":1,"noerr":0,"initialize":"","finalize":"","x":380,"y":260,"wires":[["237c0294.05532e"]]},{"id":"9c348138.e8443","type":"server","z":"","name":"Home Assistant","legacy":false,"addon":true,"rejectUnauthorizedCerts":true,"ha_boolean":"y|yes|true|on|home|open","connectionDelay":false,"cacheJson":true},{"id":"82a58f58.58875","type":"pushover-keys","z":"","name":"Pixel XL2"}]