ONVIF Camera sends motion detection to phone but not openhab trigger

Hi @msherm,

I have the same pbm with TP-Link Tapo C310 camera. The notification are properly sent to my phone via the Tapo Application but I was not able to trigger OpenHab rule according to a motion item.

Did you find a solution?

Thanks.

Put the ipcamera binding into debug logs, docs cover this at the very top under heading what to do if you need help. It should list any unknown events so they can be reported to be added.

The other thing you can try is see if onvif device manager shows the events in its stream. It is possible some cameras don’t send the event so confirming with another onvif program would be a good idea.

Edit: if your camera does not send the event you can always create motion alerts using the ffmpeg feature the binding has, see docs for info.

Hi @matt1!

Thank for your reply!

I put the binding in debug mode and here is the ONVIF calls extracted from the logs (see at the end for the complete log):

2021-10-11 20:01:05.810 [TRACE] [amera.internal.onvif.OnvifConnection] - Sending ONVIF request:GetSystemDateAndTime
2021-10-11 20:01:06.184 [TRACE] [amera.internal.onvif.OnvifConnection] - Sending ONVIF request:GetCapabilities
2021-10-11 20:01:06.339 [TRACE] [amera.internal.onvif.OnvifConnection] - Sending ONVIF request:GetProfiles
2021-10-11 20:01:06.478 [TRACE] [amera.internal.onvif.OnvifConnection] - Sending ONVIF request:GetSnapshotUri
2021-10-11 20:01:06.487 [TRACE] [amera.internal.onvif.OnvifConnection] - Sending ONVIF request:GetStreamUri
2021-10-11 20:01:06.513 [TRACE] [amera.internal.onvif.OnvifConnection] - Sending ONVIF request:GetEventProperties
2021-10-11 20:01:06.542 [TRACE] [amera.internal.onvif.OnvifConnection] - Sending ONVIF request:GetServiceCapabilities
2021-10-11 20:01:06.775 [TRACE] [amera.internal.onvif.OnvifConnection] - Sending ONVIF request:CreatePullPointSubscription
2021-10-11 20:01:06.970 [TRACE] [amera.internal.onvif.OnvifConnection] - Sending ONVIF request:PullMessages
2021-10-11 20:01:15.046 [TRACE] [amera.internal.onvif.OnvifConnection] - Sending ONVIF request:Renew
2021-10-11 20:01:15.098 [TRACE] [amera.internal.onvif.OnvifConnection] - Sending ONVIF request:PullMessages
2021-10-11 20:01:23.141 [TRACE] [amera.internal.onvif.OnvifConnection] - Sending ONVIF request:Renew

The workflow looks right but it seems the last Renew command generate a fault from my camera and then after that nothing more, even if I still get notification from the Tapo Application about newer motions.

In order to debug further, do you have a suggestion for a ONVIF application working with events? The ones I have tested do not handle events…

An other point: even when one event is caught during initialization, no item state is set! I have 2 items defined:

Switch GarageTapoCam_MotionAlarm "Tapo garage cam motion detection" <alarm> (Garage_cam) ["MotionDetector"] { channel="ipcamera:onvif:cam_garage_tapo_c310:motionAlarm" }

Switch GarageTapoCam_cellMotionAlarm "Tapo garage cam motion detection" <alarm> (Garage_cam) ["MotionDetector"] { channel="ipcamera:onvif:cam_garage_tapo_c310:cellMotionAlarm" }

For more information, here is the ‘complete’ logs:

2021-10-11 20:01:06.775 [TRACE] [amera.internal.onvif.OnvifConnection] - Sending ONVIF request:CreatePullPointSubscription
2021-10-11 20:01:06.841 [TRACE] [amera.internal.onvif.OnvifConnection] - Onvif reply is:<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://www.w3.org/2003/05/soap-envelope" xmlns:SOAP-ENC="http://www.w3.org/2003/05/soap-encoding" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:
wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsdd="http://schemas.xmlsoap.org/ws/2005/04/discovery" xmlns:chan="http://schemas.microsoft.com/ws/2005/02/duplex" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-20040
1-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsa5="http://www.w3.org/2005/08/addressing" xmlns:xmime="http://tempuri.org/xmime.xsd" xmlns:xop="http:/
/www.w3.org/2004/08/xop/include" xmlns:wsrfbf="http://docs.oasis-open.org/wsrf/bf-2" xmlns:wstop="http://docs.oasis-open.org/wsn/t-1" xmlns:wsrfr="http://docs.oasis-open.org/wsrf/r-2" xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2" xmlns:
tt="http://www.onvif.org/ver10/schema" xmlns:ter="http://www.onvif.org/ver10/error" xmlns:tns1="http://www.onvif.org/ver10/topics" xmlns:tds="http://www.onvif.org/ver10/device/wsdl" xmlns:trt="http://www.onvif.org/ver10/media/wsdl" xmlns:
tev="http://www.onvif.org/ver10/events/wsdl" xmlns:tdn="http://www.onvif.org/ver10/network/wsdl" xmlns:timg="http://www.onvif.org/ver20/imaging/wsdl" xmlns:trp="http://www.onvif.org/ver10/replay/wsdl" xmlns:tan="http://www.onvif.org/ver20
/analytics/wsdl"><SOAP-ENV:Body><SOAP-ENV:Fault><SOAP-ENV:Code><SOAP-ENV:Value>SOAP-ENV:Sender</SOAP-ENV:Value></SOAP-ENV:Code><SOAP-ENV:Reason><SOAP-ENV:Text xml:lang="en">Method 'GetServiceCapabilities' not implemented: method name or namespace not recognized</SOAP-ENV:Text></SOAP-ENV:Reason></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>

2021-10-11 20:01:06.960 [TRACE] [amera.internal.onvif.OnvifConnection] - Onvif reply is:<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://www.w3.org/2003/05/soap-envelope" xmlns:SOAP-ENC="http://www.w3.org/2003/05/soap-encoding" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsdd="http://schemas.xmlsoap.org/ws/2005/04/discovery" xmlns:chan="http://schemas.microsoft.com/ws/2005/02/duplex" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsa5="http://www.w3.org/2005/08/addressing" xmlns:xmime="http://tempuri.org/xmime.xsd" xmlns:xop="http://www.w3.org/2004/08/xop/include" xmlns:wsrfbf="http://docs.oasis-open.org/wsrf/bf-2" xmlns:wstop="http://docs.oasis-open.org/wsn/t-1" xmlns:wsrfr="http://docs.oasis-open.org/wsrf/r-2" xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2" xmlns:tt="http://www.onvif.org/ver10/schema" xmlns:ter="http://www.onvif.org/ver10/error" xmlns:tns1="http://www.onvif.org/ver10/topics" xmlns:tds="http://www.onvif.org/ver10/device/wsdl" xmlns:trt="http://www.onvif.org/ver10/media/wsdl" xmlns:tev="http://www.onvif.org/ver10/events/wsdl" xmlns:tdn="http://www.onvif.org/ver10/network/wsdl" xmlns:timg="http://www.onvif.org/ver20/imaging/wsdl" xmlns:trp="http://www.onvif.org/ver10/replay/wsdl" xmlns:tan="http://www.onvif.org/ver20/analytics/wsdl"><SOAP-ENV:Header><wsa5:To SOAP-ENV:mustUnderstand="true">http://192.168.0.249/onvif/service</wsa5:To><wsa5:Action SOAP-ENV:mustUnderstand="true">http://www.onvif.org/ver10/events/wsdl/EventPortType/CreatePullPointSubscriptionResponse</wsa5:Action></SOAP-ENV:Header><SOAP-ENV:Body><tev:CreatePullPointSubscriptionResponse><tev:SubscriptionReference><wsa5:Address>http://192.168.0.249:1025/event-1025_1025</wsa5:Address></tev:SubscriptionReference><wsnt:CurrentTime>2021-10-11T18:01:06Z</wsnt:CurrentTime><wsnt:TerminationTime>2021-10-11T18:11:06Z</wsnt:TerminationTime></tev:CreatePullPointSubscriptionResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>

2021-10-11 20:01:06.964 [DEBUG] [amera.internal.onvif.OnvifConnection] - subscriptionXAddr=/event-1025_1025
2021-10-11 20:01:06.970 [TRACE] [amera.internal.onvif.OnvifConnection] - Sending ONVIF request:PullMessages
2021-10-11 20:01:09.915 [DEBUG] [era.internal.handler.IpCameraHandler] - Binding has no snapshot url. Will use your CPU and FFmpeg to create snapshots from the cameras RTSP.
2021-10-11 20:01:09.926 [DEBUG] [hab.binding.ipcamera.internal.Ffmpeg] - Starting ffmpeg with this command now:-rtsp_transport tcp -threads 1 -skip_frame nokey -hide_banner -loglevel warning -i rtsp://openhab:********@192.168.0.249:554/stream1 -an -vsync vfr -q:v 2 -update 1 http://127.0.0.1:8881/snapshot.jpg
2021-10-11 20:01:15.043 [TRACE] [amera.internal.onvif.OnvifConnection] - Onvif reply is:<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://www.w3.org/2003/05/soap-envelope" xmlns:SOAP-ENC="http://www.w3.org/2003/05/soap-encoding" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsdd="http://schemas.xmlsoap.org/ws/2005/04/discovery" xmlns:chan="http://schemas.microsoft.com/ws/2005/02/duplex" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsa5="http://www.w3.org/2005/08/addressing" xmlns:xmime="http://tempuri.org/xmime.xsd" xmlns:xop="http://www.w3.org/2004/08/xop/include" xmlns:wsrfbf="http://docs.oasis-open.org/wsrf/bf-2" xmlns:wstop="http://docs.oasis-open.org/wsn/t-1" xmlns:wsrfr="http://docs.oasis-open.org/wsrf/r-2" xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2" xmlns:tt="http://www.onvif.org/ver10/schema" xmlns:ter="http://www.onvif.org/ver10/error" xmlns:tns1="http://www.onvif.org/ver10/topics" xmlns:tds="http://www.onvif.org/ver10/device/wsdl" xmlns:trt="http://www.onvif.org/ver10/media/wsdl" xmlns:tev="http://www.onvif.org/ver10/events/wsdl" xmlns:tdn="http://www.onvif.org/ver10/network/wsdl" xmlns:timg="http://www.onvif.org/ver20/imaging/wsdl" xmlns:trp="http://www.onvif.org/ver10/replay/wsdl" xmlns:tan="http://www.onvif.org/ver20/analytics/wsdl"><SOAP-ENV:Header><wsa5:To SOAP-ENV:mustUnderstand="true">http://192.168.0.249/event-1025_1025</wsa5:To><wsa5:Action SOAP-ENV:mustUnderstand="true">http://www.onvif.org/ver10/events/wsdl/PullPointSubscription/PullMessagesResponse</wsa5:Action></SOAP-ENV:Header><SOAP-ENV:Body><tev:PullMessagesResponse><tev:CurrentTime>2021-10-11T18:01:07Z</tev:CurrentTime><tev:TerminationTime>2021-10-11T18:11:06Z</tev:TerminationTime></tev:PullMessagesResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>
2021-10-11 20:01:15.046 [TRACE] [amera.internal.onvif.OnvifConnection] - Sending ONVIF request:Renew
2021-10-11 20:01:15.094 [TRACE] [amera.internal.onvif.OnvifConnection] - Onvif reply is:<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://www.w3.org/2003/05/soap-envelope" xmlns:SOAP-ENC="http://www.w3.org/2003/05/soap-encoding" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:
wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsdd="http://schemas.xmlsoap.org/ws/2005/04/discovery" xmlns:chan="http://schemas.microsoft.com/ws/2005/02/duplex" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-20040
1-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsa5="http://www.w3.org/2005/08/addressing" xmlns:xmime="http://tempuri.org/xmime.xsd" xmlns:xop="http:/
/www.w3.org/2004/08/xop/include" xmlns:wsrfbf="http://docs.oasis-open.org/wsrf/bf-2" xmlns:wstop="http://docs.oasis-open.org/wsn/t-1" xmlns:wsrfr="http://docs.oasis-open.org/wsrf/r-2" xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2" xmlns:
tt="http://www.onvif.org/ver10/schema" xmlns:ter="http://www.onvif.org/ver10/error" xmlns:tns1="http://www.onvif.org/ver10/topics" xmlns:tds="http://www.onvif.org/ver10/device/wsdl" xmlns:trt="http://www.onvif.org/ver10/media/wsdl" xmlns:
tev="http://www.onvif.org/ver10/events/wsdl" xmlns:tdn="http://www.onvif.org/ver10/network/wsdl" xmlns:timg="http://www.onvif.org/ver20/imaging/wsdl" xmlns:trp="http://www.onvif.org/ver10/replay/wsdl" xmlns:tan="http://www.onvif.org/ver20
/analytics/wsdl"><SOAP-ENV:Header><wsa5:To SOAP-ENV:mustUnderstand="true">http://192.168.0.249/event-1025_1025</wsa5:To><wsa5:Action SOAP-ENV:mustUnderstand="true">http://docs.oasis-open.org/wsn/bw-2/SubscriptionManager/RenewResponse</wsa
5:Action></SOAP-ENV:Header><SOAP-ENV:Body><wsnt:RenewResponse><wsnt:TerminationTime>2021-10-11T18:01:16Z</wsnt:TerminationTime><wsnt:CurrentTime>2021-10-11T18:01:15Z</wsnt:CurrentTime></wsnt:RenewResponse></SOAP-ENV:Body></SOAP-ENV:Envelo
pe>

2021-10-11 20:01:15.098 [TRACE] [amera.internal.onvif.OnvifConnection] - Sending ONVIF request:PullMessages
2021-10-11 20:01:16.739 [DEBUG] [hab.binding.ipcamera.internal.Ffmpeg] - Guessed Channel Layout for Input Stream #0.1 : mono
2021-10-11 20:01:16.856 [DEBUG] [hab.binding.ipcamera.internal.Ffmpeg] - [swscaler @ 0x55e48e3852c0] deprecated pixel format used, make sure you did set range correctly
2021-10-11 20:01:23.139 [TRACE] [amera.internal.onvif.OnvifConnection] - Onvif reply is:<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://www.w3.org/2003/05/soap-envelope" xmlns:SOAP-ENC="http://www.w3.org/2003/05/soap-encoding" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsdd="http://schemas.xmlsoap.org/ws/2005/04/discovery" xmlns:chan="http://schemas.microsoft.com/ws/2005/02/duplex" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsa5="http://www.w3.org/2005/08/addressing" xmlns:xmime="http://tempuri.org/xmime.xsd" xmlns:xop="http://www.w3.org/2004/08/xop/include" xmlns:wsrfbf="http://docs.oasis-open.org/wsrf/bf-2" xmlns:wstop="http://docs.oasis-open.org/wsn/t-1" xmlns:wsrfr="http://docs.oasis-open.org/wsrf/r-2" xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2" xmlns:tt="http://www.onvif.org/ver10/schema" xmlns:ter="http://www.onvif.org/ver10/error" xmlns:tns1="http://www.onvif.org/ver10/topics" xmlns:tds="http://www.onvif.org/ver10/device/wsdl" xmlns:trt="http://www.onvif.org/ver10/media/wsdl" xmlns:tev="http://www.onvif.org/ver10/events/wsdl" xmlns:tdn="http://www.onvif.org/ver10/network/wsdl" xmlns:timg="http://www.onvif.org/ver20/imaging/wsdl" xmlns:trp="http://www.onvif.org/ver10/replay/wsdl" xmlns:tan="http://www.onvif.org/ver20/analytics/wsdl"><SOAP-ENV:Header><wsa5:To SOAP-ENV:mustUnderstand="true">http://192.168.0.249/event-1025_1025</wsa5:To><wsa5:Action SOAP-ENV:mustUnderstand="true">http://www.onvif.org/ver10/events/wsdl/PullPointSubscription/PullMessagesResponse</wsa5:Action></SOAP-ENV:Header><SOAP-ENV:Body><tev:PullMessagesResponse><tev:CurrentTime>2021-10-11T18:01:15Z</tev:CurrentTime><tev:TerminationTime>2021-10-11T18:01:16Z</tev:TerminationTime></tev:PullMessagesResponse></SOAP-ENV:Body></SOAP-ENV:Envelope>

2021-10-11 20:01:23.141 [TRACE] [amera.internal.onvif.OnvifConnection] - Sending ONVIF request:Renew
2021-10-11 20:01:23.322 [TRACE] [amera.internal.onvif.OnvifConnection] - Onvif reply is:<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://www.w3.org/2003/05/soap-envelope" xmlns:SOAP-ENC="http://www.w3.org/2003/05/soap-encoding" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsdd="http://schemas.xmlsoap.org/ws/2005/04/discovery" xmlns:chan="http://schemas.microsoft.com/ws/2005/02/duplex" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd" xmlns:wsa5="http://www.w3.org/2005/08/addressing" xmlns:xmime="http://tempuri.org/xmime.xsd" xmlns:xop="http://www.w3.org/2004/08/xop/include" xmlns:wsrfbf="http://docs.oasis-open.org/wsrf/bf-2" xmlns:wstop="http://docs.oasis-open.org/wsn/t-1" xmlns:wsrfr="http://docs.oasis-open.org/wsrf/r-2" xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2" xmlns:tt="http://www.onvif.org/ver10/schema" xmlns:ter="http://www.onvif.org/ver10/error" xmlns:tns1="http://www.onvif.org/ver10/topics" xmlns:tds="http://www.onvif.org/ver10/device/wsdl" xmlns:trt="http://www.onvif.org/ver10/media/wsdl" xmlns:tev="http://www.onvif.org/ver10/events/wsdl" xmlns:tdn="http://www.onvif.org/ver10/network/wsdl" xmlns:timg="http://www.onvif.org/ver20/imaging/wsdl" xmlns:trp="http://www.onvif.org/ver10/replay/wsdl" xmlns:tan="http://www.onvif.org/ver20/analytics/wsdl"><SOAP-ENV:Header><wsa5:To SOAP-ENV:mustUnderstand="true">http://192.168.0.249/event-1025_1025</wsa5:To><wsa5:Action SOAP-ENV:mustUnderstand="true">http://www.w3.org/2005/08/addressing/soap/fault</wsa5:Action></SOAP-ENV:Header><SOAP-ENV:Body><SOAP-ENV:Fault><SOAP-ENV:Code><SOAP-ENV:Value>SOAP-ENV:Sender</SOAP-ENV:Value></SOAP-ENV:Code><SOAP-ENV:Reason><SOAP-ENV:Text xml:lang="en"/></SOAP-ENV:Reason></SOAP-ENV:Fault></SOAP-ENV:Body></SOAP-ENV:Envelope>

I notice that the time on your camera does not match the time in openHAB? The ONVIF specs do state that they have to be within x seconds, however your camera and a lot of them do not seem to care. It may be related so please get the two to be close to each other to see if it helps.

I have not looked at the ONVIF spec for renew for ages but it is interesting that the camera is saying the events will terminate in 1 seconds time despite just getting asked to renew.

Can you test the camera in the program ‘ONVIF device manager’ and see if the events keep working in that program?

sorry bad notification settings! I just see your message! As I am on Debian, I have to find a windows PC to run the ‘ONVIF device manager’!

Thank the reply by the way!

Hi @matt1,

ONVIF device manager is able to retrieve my Tapo C310 events but the time is always 00:00:00.


I have checked the time setting and it it properly set.

Have you already seen such kind of pbm? May be is there some kind of debug parameter in ‘ONVIF device manager’ to see if there are extra messages that explain the time 00:00:00?

Regards

If it is working in ODM, can you record the traffic between the camera and that program with wireshark and send me a copy? Do not publish it in forum, send via PM as a password can be reversed engineered if you publish 2 way traffic data.

The binding does not care about the time, but the ONVIF specs state it is important they are within 5 seconds from memory so if your camera enforces this then it may explain it. It looks like it is probably 1 tiny thing stopping it from working.

Hi @matt1,

I captured and filtered the packet from the camera (192.168.0.249) and ODM (192.168.0.54). Here is the dump odm_filtered.pdf (93.2 KB) It is a zip file, with pdf extension to allow the forum to upload it.

Regards.

hi @matt1,

have you been able to figure it out? May be you prefere I create an issue no the github?

Regards.

Yes github tickets are far better so they don’t get lost or forgotten…

I took a look and this section seems to differ…

binding sends

<wsa5:To SOAP-ENV:mustUnderstand="true">http://192.168.0.249/event-1025_1025</wsa5:To>

ODM sends

<wsa5:To SOAP-ENV:mustUnderstand="true">http://192.168.0.249:1028/event-1028_1028</wsa5:To>

Note that ODM is sending a port 1028 in the to address. The port appears to change to possibly a random one.

I checked and there is a bug that means the port is not handled correctly by the binding.

This should be fixed in this newer build found in the link in this thread that explains a breaking change and how to deal with the dependencies:

IpCamera binding - Breaking changes and new features in 3.2 Milestone 3 and newer - Add-ons / Bindings - openHAB Community

@rotulet The fix has been merged and will make it into 3.2 Stable released sometime this month. You can change to using snapshots and get it right away, or use the precompiled jar from my website on older openHAB versions.

So great you found a solution! As I am using the docker version, do you think the 3.2.0-snapshot-debian will contain the fix? I’ll try this week end!

Unless there was more than 1 issue, this should fix it for you as I did find an issue and fix it because of your feedback, so thanks. If your using milestones, just do an update as the RC1 (not sure if docker has the release candidates) was released today and yes the daily snapshots will also have it.

Hi @rotulet
I know this an old post, but I recently get a Tapo c310 as well. It works fine as generic IP camera but when I use it as onvif camera (as it’s found by the binding) I wasn’t able to get it working, yet.

Could you please share your thing configuration? Mine looks like this:

UID: ipcamera:onvif:1921688479
label: test
thingTypeUID: ipcamera:onvif
configuration:
  mjpegOptions: -q:v 5 -r 2 -vf scale=640:-2 -update 1
  ipAddress: 192.168.84.79
  updateImageWhen: "0"
  onvifPort: 2020
  gifPreroll: 0
  ffmpegLocation: /usr/bin/ffmpeg
  ipWhitelist: DISABLE
  mp4OutOptions: -c:v copy -c:a copy
  pollTime: 1000
  port: 80
  snapshotOptions: -an -vsync vfr -q:v 2 -update 1
  ptzContinuous: false
  onvifMediaProfile: 0
  hlsOutOptions: -strict -2 -f lavfi -i aevalsrc=0 -acodec aac -vcodec copy
    -hls_flags delete_segments -hls_time 2 -hls_list_size 4
  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
  username: user
  password: "*****"

I’ve also tried to add an rstp stream rtsp://user:****@192.168.84.79:554/stream1 as ffmpeg input but it also doesn’t work.

Would be glad if you could help me on this

Hi! Sorry for the response delay!

I do not use the UI configuration as you do but the file version. There are nearly the same parameter values. I can retrieve the stream but I am unable to retrieve the motion triggers.

Thing definition:

Thing ipcamera:onvif:cam_garage_tapo_c310 "Tapo camera on garage" [
  ipAddress="192.168.XXX.YYY",
  onvifPort=2020,
  gifPreroll=0,
  ipWhitelist="DISABLE",
  mp4OutOptions="-c:v copy -c:a copy",
  pollTime=500,
  updateImageWhen="0",
  username="openhab",
  password="CCCCCC",
  snapshotOptions="-an -vsync vfr -q:v 2 -update 1",
  ptzContinuous="false",
  onvifMediaProfile=0,
  ffmpegLocation="/usr/bin/ffmpeg",
  ffmpegOutput="/etc/openhab/html/camera1/",
  mjpegOptions="-q:v 5 -r 2 -vf scale=640:-2 -update 1",
  hlsOutOptions="-strict -2 -f lavfi -i aevalsrc=0 -acodec aac -vcodec copy -hls_flags delete_segments -hls_time 2 -hls_list_size 4",
  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"
  ]

Here are the item definitions I use:

Image GarageTapoCam_Image { channel="ipcamera:onvif:cam_garage_tapo_c310:image" }

Switch GarageTapoCam_MotionAlarm "Tapo garage cam motion detection" <alarm> (g_garage_cam) ["MotionDetector"] { channel="ipcamera:onvif:cam_garage_tapo_c310:motionAlarm" }

Switch GarageTapoCam_cellMotionAlarm "Tapo garage cam motion detection" <alarm> (g_garage_cam) ["MotionDetector"] { channel="ipcamera:onvif:cam_garage_tapo_c310:cellMotionAlarm" }

DateTime GarageTapoCam_MotionAlarm_LUP	"[%1$tF %1$tR]" <clock>	(g_garage_cam, g_lastupdate) { channel="ipcamera:onvif:cam_garage_tapo_c310:motionAlarm" [profile="timestamp-update"] }

String GarageTapoCam_MotionType "Tapo garage cam motion type" <alarm> (g_garage_cam) ["MotionDetector"] { channel="ipcamera:onvif:cam_garage_tapo_c310:lastMotionType" }

String GarageTapoCam_MotionStream "Tapo garage cam motion type" <alarm> (g_garage_cam) { channel="ipcamera:onvif:cam_garage_tapo_c310:snapshotUrl" }

I am using the 3.2.0 docker version with the ffmpeg package installed:

FROM openhab/openhab:3.2.0-debian

RUN apt-get update && \
        DEBIAN_FRONTEND=noninteractive apt-get install --no-install-recommends -y \
        ffmpeg && \
        c_rehash && \
        update-ca-certificates && \
        apt-get clean && \
        rm -rf /var/lib/apt/lists/*

Even with @matt1 's changes I can’t get it to work!

1 Like

I have forgotten to create an issue in github… so sad, it would have helped here!

@matt1 I did not find an issue for this pbm on github. Do you remember the issue ou PR?

I have migrated to 3.4.2 and I have the same issue

The problem here is we need to narrow the cause of the issue. If it works with onvif de ice manager but does not work with the binding then we need to use Wireshark to grab the traffic and compare what is different so we can make the change.

The history above shows a change was made and merged so now we need to diagnose again as it may be a second issue not related to the first one.

I also got the stream working (just copying your things file and it worked, so thanks for that), but the motion alarm is still not triggered. As a workaround I set up another pi with Motion which works pretty well indoors (the outdoor cameras have a lot of false alarms).
I control the motion-project via shell scripts in openhab. It does pretty much what I need.

I will try to recreate a dump with wireshark asap!

@matt1 I add a new issue on github with dump and log: [IpCamera] Tapo C310 is not supported · Issue #14738 · openhab/openhab-addons · GitHub

Regards.