I am planning to make our house a little more smarter.
My plan is at ther very beginning and I hope to be in the correct sub forum and for a lot of help.
I wanna DIY a door button which is switching a camera on and ringing the bell.
This is at the moment maybe the easiest part.
But the current video from outside should be streamed to my openhab server and be displayed in the UI.
It should only run for about 30 seconds.
In attachment I tried to draw what I am planning.
Do you know which (I called it WemosD1) chip can handle the camera openhab link?
Is it easy to bind the camera to openhab and is it possible to show video only when door button was pushed?
Any Hardware suggestions with wirering?
I think the answer is none. I think you need to attach the camera to something that will encode and make available the stream of video on the network. I don’t think there are any single camera boards like this that can do that.
There is an IP camera bindings, Zoneminder binding, and well documented Shinobi integration. To stream on your sitemap you just put the network address to the stream in the Video tag.
But in ALL of these cases, the video stream needs to be made available on the network somehow and that will require a computer like an RPi Zero w. Once you have that it is a matter of installing the desired software (Motion seems popular).
Do I understand it correctly? If I want to have a live stream I need a kind of motion or Xeoma. But if I am pleased with static pictures I can go for a cheaper/simpler solution like an Arduino board.
My onl concerns about a RPi is my experience with very low stability of this one even if I bought a real power supply instead of just using a charger.
The problem is the camera module doesn’t talk on the network. Without out that there is no way to get the data captured by the camera to OH.
If you have a way to attach the camera to an Arduino and a way to attach the Arduino to the network and provide a way for your OH server to pull the data from the Arduino from over the network or have the Arduino push the data to the OH server then yes you can use an Arduino.
The answers to all of those ifs will not be found on this forum though. Maybe you can find something useful on Instructables or and Arduino forum.
Given that the most common platform upon which OH runs is an RPi and in my personal experience I have RPis running things like these that stay running for 6+ months at a time without a reboot, and even when it reboots it is because of a general loss of power to the house, not instability with the RPi, I can’t say that the RPi is generally unstable. Perhaps you have a bad RPi or particularly noisy power or something. And if that is the case, an Arduino might have problems too.
I’ve also found raspberry pi’s extremely reliable provided that a decent quality power supply is used - the official pi ones work perfectly. When I’ve cheaped-out and used generic power supplies I’ve had constant reliability problems.
But to buy something is easy and at the door, combined with the door switch it is not really looking good.
My project is nearly at the end. I wanted to keep this threat a little updated with some pictures:
dry run and programming
Thanks for the pictures!
Did you install a FULL Pi into the door, or just a simple panel (Zero / Aruino)?
Did you succeed?
Is it working?
Could you test it under very cold / rain / frost / etc?
I wanted to give you a little update.
Due to big issues with my RPi I decided to replace SD-Card (was broken) the RPi (is still OK) and the PoE Splitter (not sure about this) with a PoE Module. Some new pictures for you.
Nachher:
Looks like it’s pretty straight forward. The only recommendation I would make is to add a sleep to the end of your while 1 for loop so the script doesn’t consume all the CPU resources when your if statement resolves to False.
That’s sometimes called a busy wait loop because it sits there running as fast as it can but doesn’t do any useful work. The sleep will cause the script to release the CPU so other programs can use it. Even a sleep of .1 (100 msecs) will greatly lower the heating and power consumption of the hardware with minimal noticeable impact to the responsiveness of the script.
Of course you need to experiment with the best sleep value to still get good responsiveness.
There are of course some things you can do to “clean up” the code (there always is) but you should be proud of this script. It’s simple and does what it’s supposed to. It’s easy to understand.