IpCamera: New IP Camera Binding

The state needs to be changed to either ON or a number between 1 and 100, then you should see logs getting produced. If not then please open a new thread with what items and sitemap lines you are using. It would also be worth watching the event.log file to see if the control sends the command to the channel.

Sorry maybe that was a misunderstanding. FFmpeg Motion Alarm is a switch only and if I understood it correct it should get to ON when ffmpeg is detecting a motion. I think you’re referring to the Dimmer ffmpegMotionControl, that’s set to 100.
In the events.log there’s nothing about the ffmpegMotionAlarm.

Yes I was mixed up and your right. Need to change ffmpegMotionControl for the logs to start.

@matt1 do you have any idea why I see this in the log sometimes, (aprox every 10-15 minutes):

2020-09-02 18:59:17.751 [WARN ] [ing.ipcamera.handler.IpCameraHandler] - Cleaning the channels has just found a connection with wrong open state.
2020-09-02 18:59:17.758 [WARN ] [ing.ipcamera.handler.IpCameraHandler] - Can't find ch when removing handler 		URL:/cgi-bin/api.cgi?cmd=onvifSnapPic&channel=0

That’s probably nothing to worry about But annoying that is reoccurring in the logs. With trace logs it should break down what URLs the channels have been used for and it is hard to comment when I only have a fraction of the information. When did it start? What causes it to start? What camera? What java version? Don’t reply here as these things should be in their own thread.

I’m looking at rewriting this code over the next few days So thanks for the heads up your logs are getting that regularly. I never see that happening here so it is worth looking into in more depth to work out the cause.

Hello to IPCamera binding community:) I’m very new to it (though always wanted to try it).
I am setting up UniView IPC2122LR3 which says to have ONVIF Conformance. Initial discovery found the camera, but I’m struggling to get it working through openhab - will spend little more time reading logs&forums and, if needed, most likely create a separate topic for that.

Meanwhile a more generic question on common/best practices - for a solar powered set-up, I’m thinking of a scenario where I would be able to keep camera off or asleep, waking it up only when PIR sensors detect motion. Is it something generally available on ONVIF (or more advanced API-support?) cameras? Or it’s a very niche thing and, if absolutely want to, then must go with a relay controlling power to camera? Thank You in advance!

I really don’t know, best to ask where a lot of camera experts hang out like https://ipcamtalk.com/.

It is very niche as usually battery powered means you have to go without ONVIF and pay a monthly fee for a cloud, or use a ‘trail camera’ that only stores to a uSD card and is not automatable.

You could use a Shelly to turn the power on and off as they can do DC switching, or another way is to use POE with a ‘poe switch’ that has SNMP which may make it possible to turn the POE power on and off https://www.openhab.org/addons/bindings/snmp/.

The issue with doing that is the camera will take time to boot up, I have not timed them but they usually need 10 or more seconds to boot and in that time the person that triggered the PIR is already gone.

Thank You for thinking about it, @matt1!:slight_smile: Yeah, it could be that for my case I may end up looking for a battery powered device and bare the cloud need. Shelly or SonoffSV to cut the 12V DC on poe - that I had in mind as well. Loosing on bootup time though may be showstopper. Keeping camera on and enabling IR led over onvif could also be an option (or keep it always off on camera and use external IR, powered on when motion happens). Not cutting to 0, but would help significantly reducing cameras consumption overnight. Will check out what ipcamtalk guys can suggest - thanks for the hint!

Maybe it’s stupid question, but which item is responsible for showing view from camera?
I have configured thing i paper ui and it’s showing online status, but I’m struggling with displaying it on sitemap. Any help?

New build 2020-09-04 now uploaded. This build will be the last one before some breaking changes will be introduced, so if you want to stay on this build and wait until openHAB V3.x is out then this build is using the latest code.

@Kim_Andersen This build should not put the entry in your logs anymore as it has a whole new way of doing things under the hood.

2 Likes

I thought that when your PR 8329 is closed binding will be included in addon refresh procedure and will be avaiable in 2.5.x versions. Addon update is still running.

If the binding will be merged before 2.5.9 is released I can not say, it is not up to me.
I need help testing the massive number of changes before it gets merged, so I plan to make a build for people to test with maybe tomorrow.
Anyone that has not set up the binding should wait a day as a test build with the breaking changes in it would be best to use before it is merged so you don’t have to deal with a large number of changes.

I am currently running the changes on my system and they appear to be working fine.

Ok I will check it on Jfrog time to time that it is included or not. What will be the exact name? IPcamera I suspect. As I use manual install still I will test latest version when you upload. I have 3 Pcs of Foscam 9800ip.

EDIT: binding is now merged into openHAB 2.5.9

Basically if you see anything in ALL CAPS in your files, they need to be converted to the newer standard in the docs.

1 Like

thank you matt hope i will find the time , i am in the middle renovation of for the new (olddd ) house i got

thanks allot for all the help!

1 Like

I was on the build version 2.5.4 (installed on 2020_07_23) - all worked fine. I renamed the old file and copied the new testing file into my addons directory, but now my cam stopped working in openhab. All my items, where i can see the path to the streams (rtsp, mjpeg and so on) are empty now.

Is this my fault? Do i have to change something, when i want to use the new test-binding?

Only short answer… If i have to change something, i hope i will find the information in this thread or the readme.

I don´t see anything in the logs (i have NOT enabled debugging yet).

Yes, you need to look at your text based files and everywhere you see something in ALL_CAPS you need to replace it with the camelCase version out of the new readme file. Just use find and replace to go through the files with, and you should be up and running pretty quickly as it is only renaming that has taken place.
If the binding gets merged for 2.5.9, you will have to do this then and also in openHAB 3.x so if you don’t want to do it right now there is a newer version without the breaking changes in the ‘old versions’ folder.

I would love people to help test the latest changes to ensure what gets merged is:

  • As bug free as possible
  • All cameras get auto detected correctly by the binding.
  • It is painless to get things running and a helpful message is in the logs to say what went wrong.
  • Default settings work for all cameras.
  • Readme is accurate and helpful.

Thanks but it is still not working:

old

Thing ipcamera:DAHUA:CamEingang "Cam Eingang" @ "Cameras"
[
    IPADDRESS="192.168.102.46",
    USERNAME="admin",
    PASSWORD="admin",
    POLL_CAMERA_MS=1000,
    SERVER_PORT=50001,
    IP_WHITELIST="DISABLE",
    IMAGE_UPDATE_EVENTS=1,
    GIF_PREROLL=1,
    GIF_POSTROLL=20,
    FFMPEG_INPUT="rtsp://192.168.102.46:554/cam/realmonitor?channel=1&subtype=0&unicast=true&proto=Onvif",
    FFMPEG_OUTPUT="/tmpfs/camera1/",
    FFMPEG_GIF_OUT_ARGUMENTS="-filter_complex fps=4,scale=480:-2:flags=lanczos,setpts=0.25*PTS,split[o1][o2];[o1]palettegen[p];[o2]fifo[o3];[o3][p]paletteuse",
    UPDATE_IMAGE=false
]

new

Thing ipcamera:dahua:CamEingang "Cam Eingang" @ "Cameras"
[
    ipAdress="192.168.102.46",
    username="admin",
    password="admin",
    pollTime=1000,
    serverPort=50001,
    ipWhitelist="DISABLE",
    updateImageWhen=1,
    gifPreroll=1,
    gifPostroll=20,
    ffmpegInput="rtsp://192.168.102.46:554/cam/realmonitor?channel=1&subtype=0&unicast=true&proto=Onvif",
    ffmpegOutput="/tmpfs/camera1/",
    gifOutOptions="-filter_complex fps=4,scale=480:-2:flags=lanczos,setpts=0.25*PTS,split[o1][o2];[o1]palettegen[p];[o2]fifo[o3];[o3][p]paletteuse",
    updateImage="OFF"
]

Any idea?

ipAddress has two ‘d’ and the rest can be removed, so try this…

Thing ipcamera:dahua:CamEingang "Cam Eingang" @ "Cameras"
[
    ipAddress="192.168.102.46",
    username="admin",
    password="admin123",
    serverPort=50001,
    gifPreroll=1,
    ffmpegOutput="/tmpfs/camera1/",
    gifOutOptions="-filter_complex fps=4,scale=480:-2:flags=lanczos,setpts=0.25*PTS,split[o1][o2];[o1]palettegen[p];[o2]fifo[o3];[o3][p]paletteuse"
]

edit:
@halloween dont forget that your item files will have DAHUA in them so do an auto find replace on them as well.
If camera is ONLINE the thing file should be correct.
If channels dont work it will be in the item files.

Thanks, that helped :wink: