SMTP Server Binding

Hi OpenHab community.

I have been struggling with how to get events from all my IP cameras into OpenHab. I’ve been through several threads here. Someone is developing an integration directly with IP cameras and might someday include OnVif. Openhab 1 had the ability to scan a remote SMTP server, but that binding seems to have been abandoned for openhab2.

I already run Mileston’s XProtect system for my cameras, and it has some great motion triggers built into it already. Unfortunately, in the free version you can only send emails on events. So I was thinking of resurrecting the idea of SMTP integration for triggering things in Openhab. But instead of having to wait on a third part and hope the third party was actually running and accessible, I thought I would try and turn openhab into an SMTP server itself so I had instant communication.

Would such a binding be useful to anyone else?


Since someone liked this post, maybe people have use for the binding. It is still in the cleanup process to get officially included, but for the moment, here is a link to it:

Maybe check out the ZoneMinder binding? You can run that separately and they view the camera’s in OH2 I believe?

@ptmuldoon I run Milestone, not ZoneMinder. Milestone is significantly better than BlueIris or iSpy. I’ve also tested a handful of other smaller NVR solutions.

However, I have not tried ZoneMinder before. Their website is lacking, from the screenshots on the Internet they do seem to have a decent product, but it does not seem to have a professional polish, not enough to make me want to test it out.

If you are just looking for alerts to openhab you could also run BlueIris and write some batch files to call the rest interface in OpenHab. So there are alternatives if you are not married to one particular software. I happen to really like Milestone, so what I have created is a generic solution that will help me with the software I am using.

I’m surprised this binding hasn’t gotten more attention! As far as using cheap IP cameras for motion detection, it seems to me like the most elegant and efficient way to do it is to let the camera send an email directly to openhab, that way you don’t have to poll anything for updates and you don’t have to spend network bandwith constantly streaming from the cameras to a central NVR if you don’t want to. Are you still working on the binding?

My Foscam cameras won’t let me modify the email they send so I need to figure out how to parse the standard text into something meaningful. I was hoping to just use the Received Count and set up a dedicated mailbox per camera since that is really all I need, but it doesn’t seem to update. The string looks like

Your IPCamera:Indoor_Up_FI9826W IP: detected motion alarm at 2018-2-25 11:14:50

Perhaps a nice feature addition would be the ability to forward the mail to another mail server after parsing, since then you could still have image attachments and so on delivered to your phone via email if the camera only supports a single destination.

[edit] I figured out eventually that the foscam webgui confuses the from and to address field, I’ve got the binding to work now but it turns out there’s anything from 10 to 30 seconds delay from when the foscam camera senses motion and to sending the email because it wants to attach a series of snapshots to the email and it doesn’t seem possible to disable that function. Looks like it ends up too slow to be reasonable for turning the lights on when you enter the room but I guess it’s good enough for turning them off again. :slight_smile:

That’s a bummer. I would really like to finish up this binding. My biggest problem is that git is a PITA to use, and Eclipse is not my native environment. Put together it takes me quite awhile to make any changes.

It would sure be nice if someone would make some sort of reasonable interface for us to work on the openhab code that does not involve git.

It is the third source control system I have worked with, and it is easily the worst. And yet everyone seems to be head over heals in love with it. Perhaps there is just a gross lack of tools available for working with it. Or a lack of documentation on it. Either way, it is a huge detriment to most projects that use it and want people to help with the project. I know one project that is all but dead now because no one wants to deal with git.

If anyone out there has a solution to this issue, be it documentation that actually works, or someone who is willing to interface with git to get these changes made, I would love to hear about it. I really want to help, java is easy, eclipse is reasonable. But git is a near show stopper for me.