I have an operational OPENHAB system (running on Raspberry Pi 4), albeit a very young one(!). I am using a PS Eye as a camera as I wanted to test/learn with something very simple before moving on to more expensive solutions. I am able to stream video, so it is operational in that regard. There are multiple channels for motion alerts but none of them ever raise a condition.
I have similar situations with other devices where alerts/alarms never show up either in the log file or in rules that interrogate the channels. Since this symptom appears to be widespread, I am wondering if I have missed a step in getting set up. Any suggestions are greatly appreciated.
The only way I can get the channels (which are also items) to show a different state is to do it via a script. Neither device ever raises an alert state. Again, I can see the video image, it is the triggering that isn’t behaving as I expect it to.
I am unclear on how to show the details — I included the “code” on the Thing, but I do not see any way to pick up the code for the items/channels. Please advise (and apologies for being so early in the learning process)
I have channels, have added them to the Thing and added them to the model. The underlying problem is (IMHO) is that they always report NULL, even when there is motion. I don’t know what I have missed or how to dig deeper into it…
The channels created by default. I did find a posting that suggesting changing the type of the item to “contact” rather than “switch”, which I have tried. This did get rid of the NULL and changed it to “closed” which seems more correct to me. However, when I introduce motion (I have it in a controlled environment), it never changed to 'open" (which I would have expected)… The main steps I have done: 1) connected the camera, verified via lsusb it was there. Added Motion and ffmpeg per instructions 2) added it as a thing using the binding IPCAMERA, subtype ONVIF. I adjusted until it did come online and was then showing video. At this point, I am able to see streaming video and I am seeing recorded video as expected. However, the video isn’t really as important as being able to monitor and report activity and this is the part that I am not having any luck with. Perhaps I am monitoring the wrong channel or have the channel settings wrong (most of which were the defaults)
Look at the Thing, look at the channel to see what type it is. The docs say Switch (read-only) which is ambiguous. But the PDF screenshot says Switch. It’s rarely successful linking channels of one type to Items of another.
Some diagnostic aids here -
In particular you can find out if your camera sends anything to openHAB, so at least you know which end to work on.
I will go through the forwarded diagnostic aid link & I thank you very much. I have also tried the ffmeg alert but that does not fire as expected either. Again, as a newbie to the world of Linux (although I spent a career in IT on different systems), I may have missed something. I will go through the steps and see if I can’t find it. I thought of writing something to look for new files and report it, but that seems like it shouldn’t be necessary.
It is a PSEye, which is a 'toy" camera that I was using as a learning aide. The documentation says it is supposed to be an ONVIF camera, but I agree that it look suspiciously like it isn’t supporting it. I will try it as a generic IP camera. Any suggestions on a camera that is KNOWN to work? I may be driving myself nuts with the wrong hardware.
I can not see anywhere reliable that it is an ONVIF camera. Does it have RTSP or MJPEG stream URLS? Does it have snapshot URL? If it does not have these then it may not be worth the time trying to get it to work. You can get some pretty cheap ONVIF cameras these days you just have to be careful to get one that has decent ONVIF support programmed in.
These URLS seem to not match each other and may be your attempt at trying to get things online and working but just shoving junk into the binding? What does the camera actually support and what are the URLs?
moretrees.world does work and is correct.
I had been playing with the snapshot URL but hadn’t gotten that properly set.
I disabled the ONVIF thing and created a generic IP camera thing. It is now streaming. However, I have something not set right on the FFMPEG motion alarm It is always showing NULL so I need to dig into that one. Any pointers on that?
I did get the snapshotURL all lined up.
I will get a better camera, but I must say this one has given me a chance to learn a lot. I would like the alarm to work though. openHAB4.pdf (140.0 KB)
Does it have a usb plug or a rj45 network port on it? If usb, I would class it as a WEBCAM and not an IP Camera and this binding is not a good match, but it may be possible to still get it working if the http://moretrees.world:8085/0/stream url is giving you a real mjpeg stream. Have no idea how it is doing that unless you installed software that is creating the stream for you and serving it at that URL.
I truly appreciate your assistance.
It has a USB plug on it. The stream URL is working fine. Honestly, I didn’t keep the right kind of notes on what I installed to get it working but as I recall it was motion and ffmpeg. I don’t recall doing much additional on it. Originally, I had found people posting they were using the device (and since it was cheap and I’m so early in the learning curve, it seemed like a good place to start). At any rate, I have learned enough to disable the ONVIF thing, add a new one and get it to work so I will try your suggestion tomorrow and see how it goes.
Ah the joys of learning (said with embarrassment because I geeked around back in the days when COBOL was “the” language to know and the internet was only used by a few). Thanks again.