Check for email from NVR

Hi all!

I have the following set up: NVR with three camera’s. NVR is setup with motion detection. With motion detected it will sent an email to a Gmail account. Problem here, when we are at home and motion is detected an email is also sent (So lots of email!).

I use Hassio also for security. Hassio knows when we are home and when we are not.

The following solution is on my mind: When we are NOT home, let Hassio check every X time for new email. When new email is detected (Dedicated email), retrieve the date from the email. When this time is within our “AWAY” time sent an alarm email.

Is this the way to go?

Already functioning is the alarm function; When we are not at home and door sensor is triggered we receive an email.

Kind regards,

Eltjo

First, it’s probably better to find a way to have HA talk directly to your NVR. E.g., I’ve enhanced the Amcrest component so that it can check the motion detected state of my Amcrest camera. Works great!

Having said that, what I would try is using IFTTT. You can set up an “Applet” in IFTTT that can trigger on a Gmail search. If the search finds a new e-mail that matches that search criteria the Applet will trigger. In the “THEN” part of the Applet you can use Webhooks to send an event to HA via the HTTP API. Kind of a round about way to accomplish notifying HA, but if nobody suggests something better, then you might want to give it a try.

Ok, I’ve got the following solution (I hope… with a little help from you guys!)

I’ve used the IMAP sensor (not IMAP content), so I now see how many unread emails there are.

Since this is a dedicated email, I will receive only emails from the NVR. So I want an automation to begin when the sensor value is changed. Problem, it can go from 1 to 2 or from 1000 to 1001.

How to trigger an automation with every change in the IMAP sensor?

(Automation will be to check if anybody is home, if not an alarm email will be sent)

I think you can just use a state trigger (as opposed to a numeric state trigger) and it will fire whenever the state (i.e., value) changes.

Yes, I think that could help. I was searching the forum and found that also.

Will check it tomorrow, let you know if it works.

But if it does, I’ve got myself a nice alarm system (Yeah!)

Improvements will be to check content of new email just to make sure no spam email triggers the alarm…

1 Like