PS Eye camera displaying video but no motion alert

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.

Let’s work on one of those to begin with, probably simpler than a camera. You’ll have to give up some details, though.

Two Things that should raise alerts: PS Eye


From HAB


UID: ipcamera:onvif:b8978d3802
label: PS Eye

thingTypeUID: ipcamera:onvif
configuration:
mjpegOptions: -q:v 5 -r 2 -vf scale=640:-2 -update 1
ipAddress: 192.168.0.235
mjpegUrl: http://moretrees.world:8085/0/stream
updateImageWhen: “23”
gifPreroll: 0
onvifPort: 8085
ffmpegLocation: /usr/bin/ffmpeg
ipWhitelist: DISABLE
mp4OutOptions: -c:v copy -c:a copy
pollTime: 1000
password: xxxxxx
port: 8085
snapshotUrl: http://192.168.0.235/var/lib/motion
snapshotOptions: -an -vsync vfr -q:v 2 -update 1
ptzContinuous: false
onvifMediaProfile: 0
gifOutOptions: -r 2 -filter_complex
scale=-2:360:flags=lanczos,setpts=0.5*PTS,split[o1][o2];[o1]palettegen[p];[o2]fifo[o3];[o3][p]paletteuse
hlsOutOptions: -strict -2 -f lavfi -i aevalsrc=0 -acodec aac -vcodec copy
-hls_flags delete_segments -hls_time 2 -hls_list_size 4
username: xxxxxx

AND z-combo smoke detector


from HAB


UID: zwave:device:8fac58dd03:node3
label: Z-Wave smoke detector
thingTypeUID: zwave:brk_zcombog_00_000
configuration:
action_heal: true
config_1_2: 1500
wakeup_node: 0
wakeup_interval: 0
config_2_2: 1
config_3_1: 5
binding_pollperiod: 86400
node_id: 3
bridgeUID: zwave:serial_zstick:8fac58dd03

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.

Thank you in advance for any assistance.

No, channels are one thing (small t) and Items are another. You would usually link a channel to an appropriate Item. But - not all channels are state channels.

So, we haven’t seen the details of either of these yet. The Things (big T) you show should have channels - no channels, no go.

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)

Example screenshot view here -

Perhaps you have no channels, which would be a problem; but you have talked about these already.

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…

Neither do we. Maybe if you shared the detail of the channels that you set up.


openHAB2.pdf (141.3 KB)

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)

Any assistance is greatly appreciated.

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.

Here is the thing:
openHAB3.pdf (170.9 KB)

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.

Again, thank you for assistance.

Regarding the other device ( z-wave smoke detector), have look into this Thread

I got the binding to log and got this collection of errors, which I am unsure of the meaning.

org.ops4j.pax.logging.pax-logging-api [log4j2] ERROR : Unable to delete 1, /var/log/openhab/openhab.log.1.gz: Read-only file system
org.ops4j.pax.logging.pax-logging-api [log4j2] ERROR : Unable to copy file /var/log/openhab/openhab.log.1.gz to /var/log/openhab/openhab.log.0.gz: java.nio.file.FileSystemException /var/log/openhab/openhab.log.0.gz: Read-only file system
org.ops4j.pax.logging.pax-logging-api [log4j2] ERROR : Unable to delete 1, /var/log/openhab/openhab.log.1.gz: Read-only file system
org.ops4j.pax.logging.pax-logging-api [log4j2] ERROR : Unable to copy file /var/log/openhab/openhab.log.1.gz to /var/log/openhab/openhab.log.0.gz: java.nio.file.FileSystemException /var/log/openhab/openhab.log.0.gz: Read-only file system
org.ops4j.pax.logging.pax-logging-api [log4j2] ERROR : Unable to delete 1, /var/log/openhab/openhab.log.1.gz: Read-only file system
org.ops4j.pax.logging.pax-logging-api [log4j2] ERROR : Unable to copy file /var/log/openhab/openhab.log.1.gz to /var/log/openhab/openhab.log.0.gz: java.nio.file.FileSystemException /var/log/openhab/openhab.log.0.gz: Read-only file system
org.ops4j.pax.logging.pax-logging-api [log4j2] ERROR : Unable to delete 1, /var/log/openhab/openhab.log.1.gz: Read-only file system
org.ops4j.pax.logging.pax-logging-api [log4j2] ERROR : Unable to copy file /var/log/openhab/openhab.log.1.gz to /var/log/openhab/openhab.log.0.gz: java.nio.file.FileSystemException /var/log/openhab/openhab.log.0.gz: Read-only file system
org.ops4j.pax.logging.pax-logging-api [log4j2] ERROR : Unable to delete 1, /var/log/openhab/openhab.log.1.gz: Read-only file system
org.ops4j.pax.logging.pax-logging-api [log4j2] ERROR : Unable to copy file /var/log/openhab/openhab.log.1.gz to /var/log/openhab/openhab.log.0.gz: java.nio.file.FileSystemException /var/log/openhab/openhab.log.0.gz: Read-only file system
org.ops4j.pax.logging.pax-logging-api [log4j2] ERROR : Unable to delete 1, /var/log/openhab/openhab.log.1.gz: Read-only file system
org.ops4j.pax.logging.pax-logging-api [log4j2] ERROR : Unable to copy file /var/log/openhab/openhab.log.1.gz to /var/log/openhab/openhab.log.0.gz: java.nio.file.FileSystemException /var/log/openhab/openhab.log.0.gz: Read-only file system
org.ops4j.pax.logging.pax-logging-api [log4j2] ERROR : Unable to delete 1, /var/log/openhab/openhab.log.1.gz: Read-only file system
org.ops4j.pax.logging.pax-logging-api [log4j2] ERROR : Unable to copy file /var/log/openhab/openhab.log.1.gz to /var/log/openhab/openhab.log.0.gz: java.nio.file.FileSystemException /var/log/openhab/openhab.log.0.gz: Read-only file system
org.ops4j.pax.logging.pax-logging-api [log4j2] ERROR : Unable to delete 1, /var/log/openhab/openhab.log.1.gz: Read-only file system
org.ops4j.pax.logging.pax-logging-api [log4j2] ERROR : Unable to copy file /var/log/openhab/openhab.log.1.gz to /var/log/openhab/openhab.log.0.gz: java.nio.file.FileSystemException /var/log/openhab/openhab.log.0.gz: Read-only file system
org.ops4j.pax.logging.pax-logging-api [log4j2] ERROR : Unable to delete 1, /var/log/openhab/openhab.log.1.gz: Read-only file system
org.ops4j.pax.logging.pax-logging-api [log4j2] ERROR : Unable to copy file /var/log/openhab/openhab.log.1.gz to /var/log/openhab/openhab.log.0.gz: java.nio.file.FileSystemException /var/log/openhab/openhab.log.0.gz: Read-only file system

looks like a permissions issue but I am unsure of next steps…any suggestions?

Some progress…I did manage to fix the aforementioned permissions and now am getting the trace information. First thing I am seeing is this entry: Sending ONVIF request:GetSystemDateAndTime

It is repeated. Could this be the clue?

Does the camera have onvif support? I could not see any evidence it does with a quick Google. Onvif cameras should get auto discovered and set themselves up.

You would need to setup as generic thing type and supply the urls for the camera manually via the config fields.

Second point is if you wish to use ffmpeg to do motion detection you would use the channel ffmpegMotion which should be described in the documentation for the binding in its own section.

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.
Thanks again!

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.

mjpegUrl: http://moretrees.world:8085/0/stream
snapshotUrl: http://192.168.0.235/var/lib/motion

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)

Again, many thanks for all the assistance.

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.

Try making a generic camera have these settings…

    snapshotUrl="ffmpeg"
    mjpegUrl="http://moretrees.world:8085/0/stream"
    ffmpegInputOptions="-f mjpeg"
ffmpegInput="http://moretrees.world:8085/0/stream"

This will use ffmpeg to do all the work converting it to what the binding needs so it will create a larger load compared to a true IP Camera that does all this in the onboard ARM processor.

Before buying a camera, make sure you do a search on the brand and model in the below forum to see how the ONVIF support works like…
Home | IP Cam Talk

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.