IpCamera: New IP Camera Binding

@matt1 just a quick update and question regarding the updated binding. Its been running about 5 days now and it seems reasonably stable with no binding induced lost connections that I see, and FFMPEG Motion Detection is working pretty well.

I did have a question about an observed behavior however. If I lose wifi to the camera, or force a reboot of the camera, should the binding automatically reconnect when the camera comes back ONLINE. What I am seeing is that it does not, or at least the binding does not reconnect in any reasonable amount of time that actually observed (5 mins or so). Thoughts??

Yes it should fully come back, however FFmpeg based alarms and some types of streams will not unless you restart the streams. The mjpeg streams should handle going offline and not need to be restarted.

Yes it appears there is another bug that I have been trying to squash the past few days, and I may have found it tonight. New build is uploaded in usual spot and it has some extra logging enabled in it to show when the ONVIF disconnects and connects so just ignore this. If the camera is still contactable but something happens with the onvif side, the camera wont go offline and just trys to reconnect only the onvif and it appears that something has been going wrong in that area of the code. I need to test this newer build for a few days before I know if it is fixed.

1 Like

@matt1. Sounds good. I just installed the new Beta Aug 31. I rebooted the camera and sure enough it now comes back ONLINE by itself. I tried this a couple of times and all were successful. I will continue to run it and report any issues that I encounter.

Upgrade to the latest jar, I think this latest one will be the changes I submit to merge and it now has the extra logging removed. The build you wrote you were using can loose the alarms so I would make the change.

1 Like

Hoped that the last build 3.4.0.202209021001 could fix my issue (that was explained in this post in Oct 2021) but it wasn’t. My Imou Ranger 2 still lost connection to the binding after restart or network/power problem, and the connection is only re-established if I disable and then re-enable the binding.

This is my things file:

Thing ipcamera:onvif:Livingroom_Imou @ "Livingroom" [ 
 ipAddress="192.168.0.214", 
 username="admin", 
 password="secret",
 ffmpegInput="rtsp://192.168.0.214:554/cam/realmonitor?channel=1&subtype=0&unicast=true&proto=Onvif",
 snapshotUrl="ffmpeg"
]

Maybe buying a new camera is the solution, or I’m missing something?

Can you enable TRACE level logging and tell the camera to reboot, so that it happens whilst the TRACE logs are getting produced? What your describing has been happening and will be a bug in the binding if pausing and unpausing the camera or binding solves the issue. This has not been happening with cameras that use their own API for the alarms and events, only cameras that were ONVIF thing type and only when a soft reconnect occurs so a lot of users of the binding will not be seeing this issue.

EDIT:

@downloadme4free
I did some testing and could reproduce it when doing a reboot here. I uploaded an ALPHA build if you wish to try. This one has extra logging in it and also uses reEntrantLocks to prevent what may be a threadsafe issue, they can cause a deadlock condition if I stuffed it up hence why the extra logs are there to help track it down whilst I run some tests. This build seems to work when I reboot the camera 3 times and do a few other tests but I wont know how it is for a few days, then I need to pull the logs out and retest before I can start a merge so any help testing it would be great.

1 Like

This is the TRACE log when camera is disconnected, and I disable then re-enable the camera thing. After that camera can trigger alarm and record animated GIF:

==> /var/log/openhab/events.log <==
2022-09-05 20:11:53.877 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'PZEM_Current' changed from 1.532 to 1.528
2022-09-05 20:11:53.893 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'PZEM_Voltage' changed from 218 to 219
2022-09-05 20:11:56.732 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Linh_Lastseen' changed from 2022-09-05T20:11:26.627+0700 to 2022-09-05T20:11:56.685+0700
2022-09-05 20:11:56.955 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'ipcamera:onvif:Livingroom_Imou' changed from ONLINE to UNINITIALIZED

==> /var/log/openhab/openhab.log <==
2022-09-05 20:11:56.967 [TRACE] [amera.internal.onvif.OnvifConnection] - Sending ONVIF request:Unsubscribe

==> /var/log/openhab/events.log <==
2022-09-05 20:11:57.020 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'ipcamera:onvif:Livingroom_Imou' changed from UNINITIALIZED to UNINITIALIZED (DISABLED)

==> /var/log/openhab/openhab.log <==
2022-09-05 20:11:57.024 [DEBUG] [amera.internal.onvif.OnvifConnection] - Camera is not reachable on ONVIF port:80 or the port may be wrong.
2022-09-05 20:11:59.033 [DEBUG] [amera.internal.onvif.OnvifConnection] - Eventloop is shutdown:true

==> /var/log/openhab/events.log <==
2022-09-05 20:12:03.887 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'PZEM_Today_Consumption' changed from 6.271 to 6.273
2022-09-05 20:12:03.890 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'PZEM_Current' changed from 1.528 to 1.53
2022-09-05 20:12:03.894 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'PZEM_Power' changed from 321 to 320
2022-09-05 20:12:03.898 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'PZEM_Total_Consumption' changed from 250.434 to 250.436
2022-09-05 20:12:03.899 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'PZEM_Voltage' changed from 219 to 218
2022-09-05 20:12:03.925 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'This_Month_Power_Cost' changed from 539892.67392 to 539898.15168
2022-09-05 20:12:04.162 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'ipcamera:onvif:Livingroom_Imou' changed from UNINITIALIZED (DISABLED) to INITIALIZING

==> /var/log/openhab/openhab.log <==
2022-09-05 20:12:04.180 [DEBUG] [amera.internal.onvif.OnvifConnection] - Connecting 192.168.0.214 to ONVIF
2022-09-05 20:12:04.182 [TRACE] [amera.internal.onvif.OnvifConnection] - Sending ONVIF request:GetSystemDateAndTime
2022-09-05 20:12:04.244 [TRACE] [amera.internal.onvif.OnvifConnection] - Onvif reply is:<?xml version="1.0" encoding="utf-8" standalone="yes" ?><s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:sc="http://www.w3.org/2003/05/soap-encoding" xmlns:tt="http://www.onvif.org/ver10/schema" xmlns:tds="http://www.onvif.org/ver10/device/wsdl"><s:Header></s:Header><s:Body><tds:GetSystemDateAndTimeResponse><tds:SystemDateAndTime><tt:DateTimeType>Manual</tt:DateTimeType><tt:DaylightSavings>false</tt:DaylightSavings><tt:TimeZone><tt:TZ>GMT+07:00</tt:TZ></tt:TimeZone><tt:UTCDateTime><tt:Time><tt:Hour>13</tt:Hour><tt:Minute>12</tt:Minute><tt:Second>3</tt:Second></tt:Time><tt:Date><tt:Year>2022</tt:Year><tt:Month>9</tt:Month><tt:Day>5</tt:Day></tt:Date></tt:UTCDateTime></tds:SystemDateAndTime></tds:GetSystemDateAndTimeResponse></s:Body></s:Envelope>
2022-09-05 20:12:04.246 [TRACE] [amera.internal.onvif.OnvifConnection] - Sending ONVIF request:GetCapabilities
2022-09-05 20:12:04.253 [DEBUG] [amera.internal.onvif.OnvifConnection] - Cameras  UTC dateTime is:2022-9-5T13:12:3
2022-09-05 20:12:04.259 [DEBUG] [amera.internal.onvif.OnvifConnection] - Openhabs UTC dateTime is:2022-09-05T13:12:04.258Z
2022-09-05 20:12:04.317 [TRACE] [amera.internal.onvif.OnvifConnection] - Onvif reply is:<?xml version="1.0" encoding="utf-8" standalone="yes" ?><s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:sc="http://www.w3.org/2003/05/soap-encoding" xmlns:tt="http://www.onvif.org/ver10/schema" xmlns:tds="http://www.onvif.org/ver10/device/wsdl"><s:Body><tds:GetCapabilitiesResponse><tds:Capabilities><tt:Device><tt:XAddr>http://192.168.0.214/onvif/device_service</tt:XAddr><tt:Network><tt:IPFilter>false</tt:IPFilter><tt:IPVersion6>false</tt:IPVersion6><tt:DynDNS>false</tt:DynDNS><tt:Extension><tt:Dot11Configuration>false</tt:Dot11Configuration></tt:Extension></tt:Network><tt:System><tt:DiscoveryResolve>false</tt:DiscoveryResolve><tt:DiscoveryBye>true</tt:DiscoveryBye><tt:RemoteDiscovery>false</tt:RemoteDiscovery><tt:SystemBackup>false</tt:SystemBackup><tt:SystemLogging>false</tt:SystemLogging><tt:FirmwareUpgrade>false</tt:FirmwareUpgrade><tt:SupportedVersions><tt:Major>2</tt:Major><tt:Minor>00</tt:Minor></tt:SupportedVersions><tt:SupportedVersions><tt:Major>2</tt:Major><tt:Minor>10</tt:Minor></tt:SupportedVersions><tt:SupportedVersions><tt:Major>2</tt:Major><tt:Minor>20</tt:Minor></tt:SupportedVersions><tt:SupportedVersions><tt:Major>2</tt:Major><tt:Minor>30</tt:Minor></tt:SupportedVersions><tt:SupportedVersions><tt:Major>2</tt:Major><tt:Minor>40</tt:Minor></tt:SupportedVersions><tt:SupportedVersions><tt:Major>2</tt:Major><tt:Minor>42</tt:Minor></tt:SupportedVersions><tt:SupportedVersions><tt:Major>16</tt:Major><tt:Minor>12</tt:Minor></tt:SupportedVersions><tt:SupportedVersions><tt:Major>18</tt:Major><tt:Minor>06</tt:Minor></tt:SupportedVersions><tt:SupportedVersions><tt:Major>18</tt:Major><tt:Minor>12</tt:Minor></tt:SupportedVersions><tt:Extension><tt:HttpFirmwareUpgrade>false</tt:HttpFirmwareUpgrade><tt:HttpSystemBackup>false</tt:HttpSystemBackup><tt:HttpSystemLogging>false</tt:HttpSystemLogging><tt:HttpSupportInformation>false</tt:HttpSupportInformation></tt:Extension></tt:System><tt:IO><tt:InputConnectors>0</tt:InputConnectors><tt:RelayOutputs>0</tt:RelayOutputs></tt:IO><tt:Security><tt:TLS1.1>false</tt:TLS1.1><tt:TLS1.2>false</tt:TLS1.2><tt:OnboardKeyGeneration>false</tt:OnboardKeyGeneration><tt:AccessPolicyConfig>false</tt:AccessPolicyConfig><tt:X.509Token>false</tt:X.509Token><tt:SAMLToken>false</tt:SAMLToken><tt:KerberosToken>false</tt:KerberosToken><tt:RELToken>false</tt:RELToken><tt:Extension><tt:TLS1.0>false</tt:TLS1.0><tt:Extension><tt:Dot1X>false</tt:Dot1X><tt:SupportedEAPMethod>0</tt:SupportedEAPMethod><tt:RemoteUserHandling>false</tt:RemoteUserHandling></tt:Extension></tt:Extension></tt:Security></tt:Device><tt:Events><tt:XAddr>http://192.168.0.214/onvif/event_service</tt:XAddr><tt:WSSubscriptionPolicySupport>true</tt:WSSubscriptionPolicySupport><tt:WSPullPointSupport>true</tt:WSPullPointSupport><tt:WSPausableSubscriptionManagerInterfaceSupport>false</tt:WSPausableSubscriptionManagerInterfaceSupport></tt:Events><tt:Imaging><tt:XAddr>http://192.168.0.214/onvif/imaging_service</tt:XAddr></tt:Imaging><tt:Media><tt:XAddr>http://192.168.0.214/onvif/media_service</tt:XAddr><tt:StreamingCapabilities><tt:RTPMulticast>false</tt:RTPMulticast><tt:RTP_TCP>true</tt:RTP_TCP><tt:RTP_RTSP_TCP>true</tt:RTP_RTSP_TCP></tt:StreamingCapabilities><tt:Extension><tt:ProfileCapabilities><tt:MaximumNumberOfProfiles>6</tt:MaximumNumberOfProfiles></tt:ProfileCapabilities></tt:Extension></tt:Media><tt:Extension><tt:DeviceIO><tt:XAddr>http://192.168.0.214/onvif/deviceIO_service</tt:XAddr><tt:VideoSources>1</tt:VideoSources><tt:VideoOutputs>0</tt:VideoOutputs><tt:AudioSources>0</tt:AudioSources><tt:AudioOutputs>0</tt:AudioOutputs><tt:RelayOutputs>0</tt:RelayOutputs><tt:SerialPorts>0</tt:SerialPorts><tt:DigitalInputs>0</tt:DigitalInputs></tt:DeviceIO></tt:Extension></tds:Capabilities></tds:GetCapabilitiesResponse></s:Body></s:Envelope>
2022-09-05 20:12:04.318 [DEBUG] [amera.internal.onvif.OnvifConnection] - deviceXAddr:http://192.168.0.214/onvif/device_service
2022-09-05 20:12:04.319 [DEBUG] [amera.internal.onvif.OnvifConnection] - eventsXAddr:http://192.168.0.214/onvif/event_service
2022-09-05 20:12:04.321 [DEBUG] [amera.internal.onvif.OnvifConnection] - mediaXAddr:http://192.168.0.214/onvif/media_service
2022-09-05 20:12:04.322 [TRACE] [amera.internal.onvif.OnvifConnection] - Camera must not support PTZ, it failed to give a <tt:PTZ><tt:XAddr>:<?xml version="1.0" encoding="utf-8" standalone="yes" ?><s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:sc="http://www.w3.org/2003/05/soap-encoding" xmlns:tt="http://www.onvif.org/ver10/schema" xmlns:tds="http://www.onvif.org/ver10/device/wsdl"><s:Body><tds:GetCapabilitiesResponse><tds:Capabilities><tt:Device><tt:XAddr>http://192.168.0.214/onvif/device_service</tt:XAddr><tt:Network><tt:IPFilter>false</tt:IPFilter><tt:IPVersion6>false</tt:IPVersion6><tt:DynDNS>false</tt:DynDNS><tt:Extension><tt:Dot11Configuration>false</tt:Dot11Configuration></tt:Extension></tt:Network><tt:System><tt:DiscoveryResolve>false</tt:DiscoveryResolve><tt:DiscoveryBye>true</tt:DiscoveryBye><tt:RemoteDiscovery>false</tt:RemoteDiscovery><tt:SystemBackup>false</tt:SystemBackup><tt:SystemLogging>false</tt:SystemLogging><tt:FirmwareUpgrade>false</tt:FirmwareUpgrade><tt:SupportedVersions><tt:Major>2</tt:Major><tt:Minor>00</tt:Minor></tt:SupportedVersions><tt:SupportedVersions><tt:Major>2</tt:Major><tt:Minor>10</tt:Minor></tt:SupportedVersions><tt:SupportedVersions><tt:Major>2</tt:Major><tt:Minor>20</tt:Minor></tt:SupportedVersions><tt:SupportedVersions><tt:Major>2</tt:Major><tt:Minor>30</tt:Minor></tt:SupportedVersions><tt:SupportedVersions><tt:Major>2</tt:Major><tt:Minor>40</tt:Minor></tt:SupportedVersions><tt:SupportedVersions><tt:Major>2</tt:Major><tt:Minor>42</tt:Minor></tt:SupportedVersions><tt:SupportedVersions><tt:Major>16</tt:Major><tt:Minor>12</tt:Minor></tt:SupportedVersions><tt:SupportedVersions><tt:Major>18</tt:Major><tt:Minor>06</tt:Minor></tt:SupportedVersions><tt:SupportedVersions><tt:Major>18</tt:Major><tt:Minor>12</tt:Minor></tt:SupportedVersions><tt:Extension><tt:HttpFirmwareUpgrade>false</tt:HttpFirmwareUpgrade><tt:HttpSystemBackup>false</tt:HttpSystemBackup><tt:HttpSystemLogging>false</tt:HttpSystemLogging><tt:HttpSupportInformation>false</tt:HttpSupportInformation></tt:Extension></tt:System><tt:IO><tt:InputConnectors>0</tt:InputConnectors><tt:RelayOutputs>0</tt:RelayOutputs></tt:IO><tt:Security><tt:TLS1.1>false</tt:TLS1.1><tt:TLS1.2>false</tt:TLS1.2><tt:OnboardKeyGeneration>false</tt:OnboardKeyGeneration><tt:AccessPolicyConfig>false</tt:AccessPolicyConfig><tt:X.509Token>false</tt:X.509Token><tt:SAMLToken>false</tt:SAMLToken><tt:KerberosToken>false</tt:KerberosToken><tt:RELToken>false</tt:RELToken><tt:Extension><tt:TLS1.0>false</tt:TLS1.0><tt:Extension><tt:Dot1X>false</tt:Dot1X><tt:SupportedEAPMethod>0</tt:SupportedEAPMethod><tt:RemoteUserHandling>false</tt:RemoteUserHandling></tt:Extension></tt:Extension></tt:Security></tt:Device><tt:Events><tt:XAddr>http://192.168.0.214/onvif/event_service</tt:XAddr><tt:WSSubscriptionPolicySupport>true</tt:WSSubscriptionPolicySupport><tt:WSPullPointSupport>true</tt:WSPullPointSupport><tt:WSPausableSubscriptionManagerInterfaceSupport>false</tt:WSPausableSubscriptionManagerInterfaceSupport></tt:Events><tt:Imaging><tt:XAddr>http://192.168.0.214/onvif/imaging_service</tt:XAddr></tt:Imaging><tt:Media><tt:XAddr>http://192.168.0.214/onvif/media_service</tt:XAddr><tt:StreamingCapabilities><tt:RTPMulticast>false</tt:RTPMulticast><tt:RTP_TCP>true</tt:RTP_TCP><tt:RTP_RTSP_TCP>true</tt:RTP_RTSP_TCP></tt:StreamingCapabilities><tt:Extension><tt:ProfileCapabilities><tt:MaximumNumberOfProfiles>6</tt:MaximumNumberOfProfiles></tt:ProfileCapabilities></tt:Extension></tt:Media><tt:Extension><tt:DeviceIO><tt:XAddr>http://192.168.0.214/onvif/deviceIO_service</tt:XAddr><tt:VideoSources>1</tt:VideoSources><tt:VideoOutputs>0</tt:VideoOutputs><tt:AudioSources>0</tt:AudioSources><tt:AudioOutputs>0</tt:AudioOutputs><tt:RelayOutputs>0</tt:RelayOutputs><tt:SerialPorts>0</tt:SerialPorts><tt:DigitalInputs>0</tt:DigitalInputs></tt:DeviceIO></tt:Extension></tds:Capabilities></tds:GetCapabilitiesResponse></s:Body></s:Envelope>
2022-09-05 20:12:04.324 [TRACE] [amera.internal.onvif.OnvifConnection] - Sending ONVIF request:GetProfiles
2022-09-05 20:12:04.401 [TRACE] [amera.internal.onvif.OnvifConnection] - Onvif reply is:<?xml version="1.0" encoding="utf-8" standalone="yes" ?><s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:sc="http://www.w3.org/2003/05/soap-encoding" xmlns:trt="http://www.onvif.org/ver10/media/wsdl" xmlns:tt="http://www.onvif.org/ver10/schema"><s:Body><trt:GetProfilesResponse><trt:Profiles token="Profile000" fixed="true"><tt:Name>Profile000</tt:Name><tt:VideoSourceConfiguration token="VideoSource000"><tt:Name>VideoSource000</tt:Name><tt:UseCount>2</tt:UseCount><tt:SourceToken>VideoSource000</tt:SourceToken><tt:Bounds x="0" y="0" width="1920" height="1080"></tt:Bounds></tt:VideoSourceConfiguration><tt:VideoEncoderConfiguration token="VideoEncoder000"><tt:Name>VideoEncoder000</tt:Name><tt:UseCount>1</tt:UseCount><tt:Encoding>H265</tt:Encoding><tt:Resolution><tt:Width>1920</tt:Width><tt:Height>1080</tt:Height></tt:Resolution><tt:Quality>6.000000</tt:Quality><tt:RateControl><tt:FrameRateLimit>25</tt:FrameRateLimit><tt:EncodingInterval>1</tt:EncodingInterval><tt:BitrateLimit>4096</tt:BitrateLimit></tt:RateControl><tt:H265><tt:GovLength>50</tt:GovLength><tt:H265Profile>Main</tt:H265Profile></tt:H265><tt:Multicast><tt:Address><tt:Type>IPv4</tt:Type><tt:IPv4Address>224.1.2.4</tt:IPv4Address></tt:Address><tt:Port>40000</tt:Port><tt:TTL>64</tt:TTL><tt:AutoStart>false</tt:AutoStart></tt:Multicast><tt:SessionTimeout>PT60S</tt:SessionTimeout></tt:VideoEncoderConfiguration><tt:MetadataConfiguration token="Metadata000" CompressionType="None" GeoLocation="false"><tt:Name>Metadata000</tt:Name><tt:UseCount>1</tt:UseCount><tt:PTZStatus><tt:Status>false</tt:Status><tt:Position>false</tt:Position></tt:PTZStatus><tt:Events><tt:Filter><wsnt:TopicExpression Dialect="http://www.onvif.org/ver10/tev/topicExpression/ConcreteSet" xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2" xmlns:tns1="http://www.onvif.org/ver10/topics">tns1:Media/ConfigurationChanged</wsnt:TopicExpression></tt:Filter></tt:Events><tt:Analytics>true</tt:Analytics><tt:Multicast><tt:Address><tt:Type>IPv4</tt:Type><tt:IPv4Address>224.1.2.4</tt:IPv4Address></tt:Address><tt:Port>40000</tt:Port><tt:TTL>64</tt:TTL><tt:AutoStart>false</tt:AutoStart></tt:Multicast><tt:SessionTimeout>PT60S</tt:SessionTimeout></tt:MetadataConfiguration></trt:Profiles><trt:Profiles token="Profile001" fixed="true"><tt:Name>Profile001</tt:Name><tt:VideoSourceConfiguration token="VideoSource000"><tt:Name>VideoSource000</tt:Name><tt:UseCount>2</tt:UseCount><tt:SourceToken>VideoSource000</tt:SourceToken><tt:Bounds x="0" y="0" width="1920" height="1080"></tt:Bounds></tt:VideoSourceConfiguration><tt:VideoEncoderConfiguration token="VideoEncoder001"><tt:Name>VideoEncoder001</tt:Name><tt:UseCount>1</tt:UseCount><tt:Encoding>H264</tt:Encoding><tt:Resolution><tt:Width>640</tt:Width><tt:Height>480</tt:Height></tt:Resolution><tt:Quality>4.000000</tt:Quality><tt:RateControl><tt:FrameRateLimit>10</tt:FrameRateLimit><tt:EncodingInterval>1</tt:EncodingInterval><tt:BitrateLimit>640</tt:BitrateLimit></tt:RateControl><tt:H264><tt:GovLength>20</tt:GovLength><tt:H264Profile>High</tt:H264Profile></tt:H264><tt:Multicast><tt:Address><tt:Type>IPv4</tt:Type><tt:IPv4Address>224.1.2.4</tt:IPv4Address></tt:Address><tt:Port>40016</tt:Port><tt:TTL>64</tt:TTL><tt:AutoStart>false</tt:AutoStart></tt:Multicast><tt:SessionTimeout>PT60S</tt:SessionTimeout></tt:VideoEncoderConfiguration><tt:MetadataConfiguration token="Metadata001" CompressionType="None" GeoLocation="false"><tt:Name>Metadata001</tt:Name><tt:UseCount>1</tt:UseCount><tt:PTZStatus><tt:Status>false</tt:Status><tt:Position>false</tt:Position></tt:PTZStatus><tt:Events><tt:Filter><wsnt:TopicExpression Dialect="http://www.onvif.org/ver10/tev/topicExpression/ConcreteSet" xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2" xmlns:tns1="http://www.onvif.org/ver10/topics">tns1:Media/ConfigurationChanged</wsnt:TopicExpression></tt:Filter></tt:Events><tt:Analytics>true</tt:Analytics><tt:Multicast><tt:Address><tt:Type>IPv4</tt:Type><tt:IPv4Address>224.1.2.4</tt:IPv4Address></tt:Address><tt:Port>40016</tt:Port><tt:TTL>64</tt:TTL><tt:AutoStart>false</tt:AutoStart></tt:Multicast><tt:SessionTimeout>PT60S</tt:SessionTimeout></tt:MetadataConfiguration></trt:Profiles></trt:GetProfilesResponse></s:Body></s:Envelope>
2022-09-05 20:12:04.404 [TRACE] [amera.internal.onvif.OnvifConnection] - String was found:Profile000
2022-09-05 20:12:04.406 [TRACE] [amera.internal.onvif.OnvifConnection] - String was found:Profile001
2022-09-05 20:12:04.407 [TRACE] [amera.internal.onvif.OnvifConnection] - Sending ONVIF request:GetSnapshotUri
2022-09-05 20:12:04.411 [TRACE] [amera.internal.onvif.OnvifConnection] - Sending ONVIF request:GetStreamUri
2022-09-05 20:12:04.424 [TRACE] [amera.internal.onvif.OnvifConnection] - Sending ONVIF request:GetEventProperties
2022-09-05 20:12:04.427 [TRACE] [amera.internal.onvif.OnvifConnection] - Sending ONVIF request:GetServiceCapabilities
2022-09-05 20:12:04.468 [TRACE] [amera.internal.onvif.OnvifConnection] - Onvif reply is:<?xml version="1.0" encoding="utf-8" standalone="yes" ?><s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:sc="http://www.w3.org/2003/05/soap-encoding" xmlns:ter="http://www.onvif.org/ver10/error" xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2" xmlns:wsrf-bf="http://docs.oasis-open.org/wsrf/bf-2" xmlns:d="http://schemas.xmlsoap.org/ws/2005/04/discovery"><s:Body><s:Fault><s:Code><s:Value>s:Sender</s:Value><s:Subcode><s:Value>ter:ActionNotSupported</s:Value><s:Subcode><s:Value>ter:NotImplemented</s:Value></s:Subcode></s:Subcode></s:Code><s:Reason><s:Text xml:lang="en">This optional method is not implemented</s:Text></s:Reason></s:Fault></s:Body></s:Envelope>
2022-09-05 20:12:04.524 [TRACE] [amera.internal.onvif.OnvifConnection] - Onvif reply is:<?xml version="1.0" encoding="utf-8" standalone="yes" ?><s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:sc="http://www.w3.org/2003/05/soap-encoding" xmlns:ter="http://www.onvif.org/ver10/error" xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2" xmlns:wsrf-bf="http://docs.oasis-open.org/wsrf/bf-2" xmlns:d="http://schemas.xmlsoap.org/ws/2005/04/discovery"><s:Body><s:Fault><s:Code><s:Value>s:Sender</s:Value><s:Subcode><s:Value>ter:ActionNotSupported</s:Value><s:Subcode><s:Value>ter:NotImplemented</s:Value></s:Subcode></s:Subcode></s:Code><s:Reason><s:Text xml:lang="en">This optional method is not implemented</s:Text></s:Reason></s:Fault></s:Body></s:Envelope>
2022-09-05 20:12:04.552 [TRACE] [amera.internal.onvif.OnvifConnection] - Onvif reply is:<?xml version="1.0" encoding="utf-8" standalone="yes" ?><s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:sc="http://www.w3.org/2003/05/soap-encoding" xmlns:wsa5="http://www.w3.org/2005/08/addressing" xmlns:tev="http://www.onvif.org/ver10/events/wsdl" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:wstop="http://docs.oasis-open.org/wsn/t-1" xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2" xmlns:tns1="http://www.onvif.org/ver10/topics" xmlns:tt="http://www.onvif.org/ver10/schema"><s:Header><wsa5:Action>http://www.onvif.org/ver10/events/wsdl/EventPortType/GetEventPropertiesResponse</wsa5:Action></s:Header><s:Body><tev:GetEventPropertiesResponse><tev:TopicNamespaceLocation>http://www.onvif.org/onvif/ver10/topics/topicns.xml</tev:TopicNamespaceLocation><wsnt:FixedTopicSet>true</wsnt:FixedTopicSet><wstop:TopicSet><tns1:VideoSource><MotionAlarm wstop:topic="true"><tt:MessageDescription IsProperty="true"><tt:Source><tt:SimpleItemDescription Name="Source" Type="tt:ReferenceToken"></tt:SimpleItemDescription></tt:Source><tt:Data><tt:SimpleItemDescription Name="State" Type="xs:boolean"></tt:SimpleItemDescription></tt:Data></tt:MessageDescription></MotionAlarm><GlobalSceneChange><ImagingService wstop:topic="true"><tt:MessageDescription IsProperty="true"><tt:Source><tt:SimpleItemDescription Name="Source" Type="tt:ReferenceToken"></tt:SimpleItemDescription></tt:Source><tt:Data><tt:SimpleItemDescription Name="State" Type="xs:boolean"></tt:SimpleItemDescription></tt:Data></tt:MessageDescription></ImagingService></GlobalSceneChange></tns1:VideoSource><tns1:RuleEngine><TamperDetector><Tamper wstop:topic="true"><tt:MessageDescription IsProperty="true"><tt:Source><tt:SimpleItemDescription Name="VideoSourceConfigurationToken" Type="tt:ReferenceToken"></tt:SimpleItemDescription></tt:Source><tt:Data><tt:SimpleItemDescription Name="IsTamper" Type="xs:string"></tt:SimpleItemDescription></tt:Data></tt:MessageDescription></Tamper></TamperDetector></tns1:RuleEngine><tns1:Media><ProfileChanged wstop:topic="true"><tt:MessageDescription IsProperty="false"><tt:Source><tt:SimpleItemDescription Name="Token" Type="tt:ReferenceToken"></tt:SimpleItemDescription></tt:Source></tt:MessageDescription></ProfileChanged><ConfigurationChanged wstop:topic="true"><tt:MessageDescription IsProperty="false"><tt:Source><tt:SimpleItemDescription Name="Token" Type="tt:ReferenceToken"></tt:SimpleItemDescription><tt:SimpleItemDescription Name="Type" Type="xs:string"></tt:SimpleItemDescription></tt:Source></tt:MessageDescription></ConfigurationChanged></tns1:Media></wstop:TopicSet><wsnt:TopicExpressionDialect>http://docs.oasis-open.org/wsn/t-1/TopicExpression/Concrete</wsnt:TopicExpressionDialect><wsnt:TopicExpressionDialect>http://www.onvif.org/ver10/tev/topicExpression/ConcreteSet</wsnt:TopicExpressionDialect><tev:MessageContentFilterDialect>http://www.onvif.org/ver10/tev/messageContentFilter/ItemFilter</tev:MessageContentFilterDialect><tev:MessageContentSchemaLocation>http://www.onvif.org/onvif/ver10/schema/onvif.xsd</tev:MessageContentSchemaLocation></tev:GetEventPropertiesResponse></s:Body></s:Envelope>
2022-09-05 20:12:04.553 [TRACE] [amera.internal.onvif.OnvifConnection] - Sending ONVIF request:CreatePullPointSubscription
2022-09-05 20:12:04.624 [TRACE] [amera.internal.onvif.OnvifConnection] - Onvif reply is:<?xml version="1.0" encoding="utf-8" standalone="yes" ?><s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:sc="http://www.w3.org/2003/05/soap-encoding" xmlns:trt="http://www.onvif.org/ver10/media/wsdl" xmlns:tt="http://www.onvif.org/ver10/schema"><s:Body><trt:GetStreamUriResponse><trt:MediaUri><tt:Uri>rtsp://192.168.0.214:554/cam/realmonitor?channel=1&amp;subtype=0&amp;unicast=true&amp;proto=Onvif</tt:Uri><tt:InvalidAfterConnect>true</tt:InvalidAfterConnect><tt:InvalidAfterReboot>true</tt:InvalidAfterReboot><tt:Timeout>PT0S</tt:Timeout></trt:MediaUri></trt:GetStreamUriResponse></s:Body></s:Envelope>
2022-09-05 20:12:04.626 [DEBUG] [amera.internal.onvif.OnvifConnection] - GetStreamUri:rtsp://192.168.0.214:554/cam/realmonitor?channel=1&amp;subtype=0&amp;unicast=true&amp;proto=Onvif
2022-09-05 20:12:04.638 [TRACE] [amera.internal.onvif.OnvifConnection] - Onvif reply is:<?xml version="1.0" encoding="utf-8" standalone="yes" ?><s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:sc="http://www.w3.org/2003/05/soap-encoding" xmlns:tev="http://www.onvif.org/ver10/events/wsdl" xmlns:wsa5="http://www.w3.org/2005/08/addressing" xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2"><s:Header><wsa5:Action>http://www.onvif.org/ver10/events/wsdl/EventPortType/CreatePullPointSubscriptionResponse</wsa5:Action></s:Header><s:Body><tev:CreatePullPointSubscriptionResponse><tev:SubscriptionReference><wsa5:Address>http://192.168.0.214/onvif/Subscription?Idx=2</wsa5:Address></tev:SubscriptionReference><wsnt:CurrentTime>2022-09-05T13:12:04Z</wsnt:CurrentTime><wsnt:TerminationTime>2022-09-05T13:22:04Z</wsnt:TerminationTime></tev:CreatePullPointSubscriptionResponse></s:Body></s:Envelope>
2022-09-05 20:12:04.639 [DEBUG] [amera.internal.onvif.OnvifConnection] - subscriptionXAddr=http://192.168.0.214/onvif/Subscription?Idx=2
2022-09-05 20:12:04.640 [TRACE] [amera.internal.onvif.OnvifConnection] - Sending ONVIF request:PullMessages
2022-09-05 20:12:04.751 [TRACE] [amera.internal.onvif.OnvifConnection] - Onvif reply is:<?xml version="1.0" encoding="utf-8" standalone="yes" ?><s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:sc="http://www.w3.org/2003/05/soap-encoding" xmlns:wsa5="http://www.w3.org/2005/08/addressing" xmlns:tev="http://www.onvif.org/ver10/events/wsdl" xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2" xmlns:tt="http://www.onvif.org/ver10/schema" xmlns:tns1="http://www.onvif.org/ver10/topics"><s:Header><wsa5:Action>http://www.onvif.org/ver10/events/wsdl/PullPointSubscription/PullMessagesResponse</wsa5:Action></s:Header><s:Body><tev:PullMessagesResponse><tev:CurrentTime>2022-09-05T13:12:04Z</tev:CurrentTime><tev:TerminationTime>2022-09-05T13:22:04Z</tev:TerminationTime><wsnt:NotificationMessage><wsnt:Topic Dialect="http://www.onvif.org/ver10/tev/topicExpression/ConcreteSet">tns1:VideoSource/MotionAlarm</wsnt:Topic><wsnt:Message><tt:Message UtcTime="2022-09-05T13:12:04Z" PropertyOperation="Initialized"><tt:Source><tt:SimpleItem Name="Source" Value="VideoSource000"></tt:SimpleItem></tt:Source><tt:Data><tt:SimpleItem Name="State" Value="false"></tt:SimpleItem></tt:Data></tt:Message></wsnt:Message></wsnt:NotificationMessage></tev:PullMessagesResponse></s:Body></s:Envelope>
2022-09-05 20:12:04.752 [DEBUG] [amera.internal.onvif.OnvifConnection] - Onvif Event Topic:VideoSource/MotionAlarm, Data:State, Value:false
2022-09-05 20:12:04.754 [TRACE] [amera.internal.onvif.OnvifConnection] - Sending ONVIF request:Renew
2022-09-05 20:12:04.797 [TRACE] [amera.internal.onvif.OnvifConnection] - Onvif reply is:<?xml version="1.0" encoding="utf-8" standalone="yes" ?><s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:sc="http://www.w3.org/2003/05/soap-encoding" xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2" xmlns:wsa5="http://www.w3.org/2005/08/addressing"><s:Header><wsa5:Action>http://docs.oasis-open.org/wsn/bw-2/SubscriptionManager/RenewResponse</wsa5:Action></s:Header><s:Body><wsnt:RenewResponse><wsnt:TerminationTime>2022-09-05T13:13:04Z</wsnt:TerminationTime><wsnt:CurrentTime>2022-09-05T13:12:04Z</wsnt:CurrentTime></wsnt:RenewResponse></s:Body></s:Envelope>
2022-09-05 20:12:04.799 [TRACE] [amera.internal.onvif.OnvifConnection] - Sending ONVIF request:PullMessages
2022-09-05 20:12:05.798 [TRACE] [amera.internal.onvif.OnvifConnection] - Onvif reply is:<?xml version="1.0" encoding="utf-8" standalone="yes" ?><s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:sc="http://www.w3.org/2003/05/soap-encoding" xmlns:wsa5="http://www.w3.org/2005/08/addressing" xmlns:tev="http://www.onvif.org/ver10/events/wsdl" xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2" xmlns:tt="http://www.onvif.org/ver10/schema" xmlns:tns1="http://www.onvif.org/ver10/topics"><s:Header><wsa5:Action>http://www.onvif.org/ver10/events/wsdl/PullPointSubscription/PullMessagesResponse</wsa5:Action></s:Header><s:Body><tev:PullMessagesResponse><tev:CurrentTime>2022-09-05T13:12:05Z</tev:CurrentTime><tev:TerminationTime>2022-09-05T13:13:04Z</tev:TerminationTime><wsnt:NotificationMessage><wsnt:Topic Dialect="http://www.onvif.org/ver10/tev/topicExpression/ConcreteSet">tns1:VideoSource/GlobalSceneChange/ImagingService</wsnt:Topic><wsnt:Message><tt:Message UtcTime="2022-09-05T13:12:04Z" PropertyOperation="Initialized"><tt:Source><tt:SimpleItem Name="Source" Value="VideoSource000"></tt:SimpleItem></tt:Source><tt:Data><tt:SimpleItem Name="State" Value="false"></tt:SimpleItem></tt:Data></tt:Message></wsnt:Message></wsnt:NotificationMessage></tev:PullMessagesResponse></s:Body></s:Envelope>
2022-09-05 20:12:05.802 [DEBUG] [amera.internal.onvif.OnvifConnection] - Onvif Event Topic:VideoSource/GlobalSceneChange/ImagingService, Data:State, Value:false
2022-09-05 20:12:05.803 [TRACE] [amera.internal.onvif.OnvifConnection] - Sending ONVIF request:Renew
2022-09-05 20:12:05.860 [TRACE] [amera.internal.onvif.OnvifConnection] - Onvif reply is:<?xml version="1.0" encoding="utf-8" standalone="yes" ?><s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:sc="http://www.w3.org/2003/05/soap-encoding" xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2" xmlns:wsa5="http://www.w3.org/2005/08/addressing"><s:Header><wsa5:Action>http://docs.oasis-open.org/wsn/bw-2/SubscriptionManager/RenewResponse</wsa5:Action></s:Header><s:Body><wsnt:RenewResponse><wsnt:TerminationTime>2022-09-05T13:13:05Z</wsnt:TerminationTime><wsnt:CurrentTime>2022-09-05T13:12:05Z</wsnt:CurrentTime></wsnt:RenewResponse></s:Body></s:Envelope>
2022-09-05 20:12:05.862 [TRACE] [amera.internal.onvif.OnvifConnection] - Sending ONVIF request:PullMessages
2022-09-05 20:12:08.186 [DEBUG] [era.internal.handler.IpCameraHandler] - Binding has no snapshot url. Will use your CPU and FFmpeg to create snapshots from the cameras RTSP.
2022-09-05 20:12:08.190 [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://admin:********@192.168.0.214:554/cam/realmonitor?channel=1&subtype=0&unicast=true&proto=Onvif -an -vsync vfr -q:v 2 -update 1 http://127.0.0.1:8080/ipcamera/Livingroom_Imou/snapshot.jpg

==> /var/log/openhab/events.log <==
2022-09-05 20:12:08.192 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'ipcamera:onvif:Livingroom_Imou' changed from INITIALIZING to ONLINE

==> /var/log/openhab/openhab.log <==
2022-09-05 20:12:13.877 [TRACE] [amera.internal.onvif.OnvifConnection] - Onvif reply is:<?xml version="1.0" encoding="utf-8" standalone="yes" ?><s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:sc="http://www.w3.org/2003/05/soap-encoding" xmlns:wsa5="http://www.w3.org/2005/08/addressing" xmlns:tev="http://www.onvif.org/ver10/events/wsdl" xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2" xmlns:tt="http://www.onvif.org/ver10/schema" xmlns:tns1="http://www.onvif.org/ver10/topics"><s:Header><wsa5:Action>http://www.onvif.org/ver10/events/wsdl/PullPointSubscription/PullMessagesResponse</wsa5:Action></s:Header><s:Body><tev:PullMessagesResponse><tev:CurrentTime>2022-09-05T13:12:13Z</tev:CurrentTime><tev:TerminationTime>2022-09-05T13:13:05Z</tev:TerminationTime></tev:PullMessagesResponse></s:Body></s:Envelope>
2022-09-05 20:12:13.879 [TRACE] [amera.internal.onvif.OnvifConnection] - Sending ONVIF request:Renew

==> /var/log/openhab/events.log <==
2022-09-05 20:12:13.910 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'PZEM_Power' changed from 320 to 318
2022-09-05 20:12:13.913 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'PZEM_Current' changed from 1.53 to 1.52

==> /var/log/openhab/openhab.log <==
2022-09-05 20:12:13.932 [TRACE] [amera.internal.onvif.OnvifConnection] - Onvif reply is:<?xml version="1.0" encoding="utf-8" standalone="yes" ?><s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:sc="http://www.w3.org/2003/05/soap-encoding" xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2" xmlns:wsa5="http://www.w3.org/2005/08/addressing"><s:Header><wsa5:Action>http://docs.oasis-open.org/wsn/bw-2/SubscriptionManager/RenewResponse</wsa5:Action></s:Header><s:Body><wsnt:RenewResponse><wsnt:TerminationTime>2022-09-05T13:13:13Z</wsnt:TerminationTime><wsnt:CurrentTime>2022-09-05T13:12:13Z</wsnt:CurrentTime></wsnt:RenewResponse></s:Body></s:Envelope>
2022-09-05 20:12:13.934 [TRACE] [amera.internal.onvif.OnvifConnection] - Sending ONVIF request:PullMessages

==> /var/log/openhab/events.log <==
2022-09-05 20:12:16.316 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Nam_Lastseen' changed from 2022-09-05T20:11:46.079+0700 to 2022-09-05T20:12:16.310+0700
2022-09-05 20:12:16.665 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'LivingroomLightsSwitch_RSSI' changed from 98 to 96
2022-09-05 20:12:16.755 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Binh_Lastseen' changed from 2022-09-05T20:11:46.542+0700 to 2022-09-05T20:12:16.749+0700

==> /var/log/openhab/openhab.log <==
2022-09-05 20:12:21.958 [TRACE] [amera.internal.onvif.OnvifConnection] - Onvif reply is:<?xml version="1.0" encoding="utf-8" standalone="yes" ?><s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:sc="http://www.w3.org/2003/05/soap-encoding" xmlns:wsa5="http://www.w3.org/2005/08/addressing" xmlns:tev="http://www.onvif.org/ver10/events/wsdl" xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2" xmlns:tt="http://www.onvif.org/ver10/schema" xmlns:tns1="http://www.onvif.org/ver10/topics"><s:Header><wsa5:Action>http://www.onvif.org/ver10/events/wsdl/PullPointSubscription/PullMessagesResponse</wsa5:Action></s:Header><s:Body><tev:PullMessagesResponse><tev:CurrentTime>2022-09-05T13:12:21Z</tev:CurrentTime><tev:TerminationTime>2022-09-05T13:13:13Z</tev:TerminationTime></tev:PullMessagesResponse></s:Body></s:Envelope>
2022-09-05 20:12:21.959 [TRACE] [amera.internal.onvif.OnvifConnection] - Sending ONVIF request:Renew
2022-09-05 20:12:22.028 [TRACE] [amera.internal.onvif.OnvifConnection] - Onvif reply is:<?xml version="1.0" encoding="utf-8" standalone="yes" ?><s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:sc="http://www.w3.org/2003/05/soap-encoding" xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2" xmlns:wsa5="http://www.w3.org/2005/08/addressing"><s:Header><wsa5:Action>http://docs.oasis-open.org/wsn/bw-2/SubscriptionManager/RenewResponse</wsa5:Action></s:Header><s:Body><wsnt:RenewResponse><wsnt:TerminationTime>2022-09-05T13:13:21Z</wsnt:TerminationTime><wsnt:CurrentTime>2022-09-05T13:12:21Z</wsnt:CurrentTime></wsnt:RenewResponse></s:Body></s:Envelope>
2022-09-05 20:12:22.030 [TRACE] [amera.internal.onvif.OnvifConnection] - Sending ONVIF request:PullMessages

==> /var/log/openhab/events.log <==
2022-09-05 20:12:23.872 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'PZEM_Today_Consumption' changed from 6.273 to 6.275
2022-09-05 20:12:23.877 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'PZEM_Power' changed from 318 to 319
2022-09-05 20:12:23.880 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'PZEM_Total_Consumption' changed from 250.436 to 250.438
2022-09-05 20:12:23.883 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'PZEM_Current' changed from 1.52 to 1.523
2022-09-05 20:12:23.909 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'This_Month_Power_Cost' changed from 539898.15168 to 539903.62944
2022-09-05 20:12:26.847 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Linh_Lastseen' changed from 2022-09-05T20:11:56.685+0700 to 2022-09-05T20:12:26.837+0700

==> /var/log/openhab/openhab.log <==
2022-09-05 20:12:30.039 [TRACE] [amera.internal.onvif.OnvifConnection] - Onvif reply is:<?xml version="1.0" encoding="utf-8" standalone="yes" ?><s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:sc="http://www.w3.org/2003/05/soap-encoding" xmlns:wsa5="http://www.w3.org/2005/08/addressing" xmlns:tev="http://www.onvif.org/ver10/events/wsdl" xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2" xmlns:tt="http://www.onvif.org/ver10/schema" xmlns:tns1="http://www.onvif.org/ver10/topics"><s:Header><wsa5:Action>http://www.onvif.org/ver10/events/wsdl/PullPointSubscription/PullMessagesResponse</wsa5:Action></s:Header><s:Body><tev:PullMessagesResponse><tev:CurrentTime>2022-09-05T13:12:29Z</tev:CurrentTime><tev:TerminationTime>2022-09-05T13:13:21Z</tev:TerminationTime></tev:PullMessagesResponse></s:Body></s:Envelope>
2022-09-05 20:12:30.042 [TRACE] [amera.internal.onvif.OnvifConnection] - Sending ONVIF request:Renew
2022-09-05 20:12:30.099 [TRACE] [amera.internal.onvif.OnvifConnection] - Onvif reply is:<?xml version="1.0" encoding="utf-8" standalone="yes" ?><s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:sc="http://www.w3.org/2003/05/soap-encoding" xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2" xmlns:wsa5="http://www.w3.org/2005/08/addressing"><s:Header><wsa5:Action>http://docs.oasis-open.org/wsn/bw-2/SubscriptionManager/RenewResponse</wsa5:Action></s:Header><s:Body><wsnt:RenewResponse><wsnt:TerminationTime>2022-09-05T13:13:29Z</wsnt:TerminationTime><wsnt:CurrentTime>2022-09-05T13:12:29Z</wsnt:CurrentTime></wsnt:RenewResponse></s:Body></s:Envelope>
2022-09-05 20:12:30.101 [TRACE] [amera.internal.onvif.OnvifConnection] - Sending ONVIF request:PullMessages

==> /var/log/openhab/events.log <==
2022-09-05 20:12:31.190 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Kitchen_Temperature' changed from 33.7 to 33.6
2022-09-05 20:12:31.194 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Kitchen_Humidity' changed from 51.1 to 50.7
2022-09-05 20:12:33.881 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'PZEM_Power' changed from 319 to 320
2022-09-05 20:12:33.884 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'PZEM_Current' changed from 1.523 to 1.531

==> /var/log/openhab/openhab.log <==
2022-09-05 20:12:36.487 [WARN ] [rest.core.item.EnrichedItemDTOMapper] - Failed transforming the state 'NULL' on item 'Vacuum_Error_State' with pattern 'MAP(vacuum_error.map):%s': Target value not found in map for 'NULL'
2022-09-05 20:12:36.578 [WARN ] [rest.core.item.EnrichedItemDTOMapper] - Failed transforming the state 'NULL' on item 'Vacuum_Box_Type' with pattern 'MAP(vacuum_box_type.map):%s': Target value not found in map for 'NULL'
2022-09-05 20:12:38.153 [TRACE] [amera.internal.onvif.OnvifConnection] - Onvif reply is:<?xml version="1.0" encoding="utf-8" standalone="yes" ?><s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:sc="http://www.w3.org/2003/05/soap-encoding" xmlns:wsa5="http://www.w3.org/2005/08/addressing" xmlns:tev="http://www.onvif.org/ver10/events/wsdl" xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2" xmlns:tt="http://www.onvif.org/ver10/schema" xmlns:tns1="http://www.onvif.org/ver10/topics"><s:Header><wsa5:Action>http://www.onvif.org/ver10/events/wsdl/PullPointSubscription/PullMessagesResponse</wsa5:Action></s:Header><s:Body><tev:PullMessagesResponse><tev:CurrentTime>2022-09-05T13:12:37Z</tev:CurrentTime><tev:TerminationTime>2022-09-05T13:13:29Z</tev:TerminationTime></tev:PullMessagesResponse></s:Body></s:Envelope>
2022-09-05 20:12:38.155 [TRACE] [amera.internal.onvif.OnvifConnection] - Sending ONVIF request:Renew
2022-09-05 20:12:38.226 [TRACE] [amera.internal.onvif.OnvifConnection] - Onvif reply is:<?xml version="1.0" encoding="utf-8" standalone="yes" ?><s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:sc="http://www.w3.org/2003/05/soap-encoding" xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2" xmlns:wsa5="http://www.w3.org/2005/08/addressing"><s:Header><wsa5:Action>http://docs.oasis-open.org/wsn/bw-2/SubscriptionManager/RenewResponse</wsa5:Action></s:Header><s:Body><wsnt:RenewResponse><wsnt:TerminationTime>2022-09-05T13:13:37Z</wsnt:TerminationTime><wsnt:CurrentTime>2022-09-05T13:12:37Z</wsnt:CurrentTime></wsnt:RenewResponse></s:Body></s:Envelope>
2022-09-05 20:12:38.228 [TRACE] [amera.internal.onvif.OnvifConnection] - Sending ONVIF request:PullMessages
2022-09-05 20:12:38.635 [WARN ] [rest.core.item.EnrichedItemDTOMapper] - Failed transforming the state 'NULL' on item 'Vacuum_Error_State' with pattern 'MAP(vacuum_error.map):%s': Target value not found in map for 'NULL'
2022-09-05 20:12:38.725 [WARN ] [rest.core.item.EnrichedItemDTOMapper] - Failed transforming the state 'NULL' on item 'Vacuum_Box_Type' with pattern 'MAP(vacuum_box_type.map):%s': Target value not found in map for 'NULL'

==> /var/log/openhab/events.log <==
2022-09-05 20:12:43.892 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'PZEM_Today_Consumption' changed from 6.275 to 6.276
2022-09-05 20:12:43.912 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'PZEM_Current' changed from 1.531 to 1.525
2022-09-05 20:12:43.914 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'PZEM_Total_Consumption' changed from 250.438 to 250.439

==> /var/log/openhab/openhab.log <==
2022-09-05 20:12:46.226 [TRACE] [amera.internal.onvif.OnvifConnection] - Onvif reply is:<?xml version="1.0" encoding="utf-8" standalone="yes" ?><s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:sc="http://www.w3.org/2003/05/soap-encoding" xmlns:wsa5="http://www.w3.org/2005/08/addressing" xmlns:tev="http://www.onvif.org/ver10/events/wsdl" xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2" xmlns:tt="http://www.onvif.org/ver10/schema" xmlns:tns1="http://www.onvif.org/ver10/topics"><s:Header><wsa5:Action>http://www.onvif.org/ver10/events/wsdl/PullPointSubscription/PullMessagesResponse</wsa5:Action></s:Header><s:Body><tev:PullMessagesResponse><tev:CurrentTime>2022-09-05T13:12:45Z</tev:CurrentTime><tev:TerminationTime>2022-09-05T13:13:37Z</tev:TerminationTime></tev:PullMessagesResponse></s:Body></s:Envelope>
2022-09-05 20:12:46.236 [TRACE] [amera.internal.onvif.OnvifConnection] - Sending ONVIF request:Renew
2022-09-05 20:12:46.308 [TRACE] [amera.internal.onvif.OnvifConnection] - Onvif reply is:<?xml version="1.0" encoding="utf-8" standalone="yes" ?><s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:sc="http://www.w3.org/2003/05/soap-encoding" xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2" xmlns:wsa5="http://www.w3.org/2005/08/addressing"><s:Header><wsa5:Action>http://docs.oasis-open.org/wsn/bw-2/SubscriptionManager/RenewResponse</wsa5:Action></s:Header><s:Body><wsnt:RenewResponse><wsnt:TerminationTime>2022-09-05T13:13:45Z</wsnt:TerminationTime><wsnt:CurrentTime>2022-09-05T13:12:45Z</wsnt:CurrentTime></wsnt:RenewResponse></s:Body></s:Envelope>
2022-09-05 20:12:46.310 [TRACE] [amera.internal.onvif.OnvifConnection] - Sending ONVIF request:PullMessages

==> /var/log/openhab/events.log <==
2022-09-05 20:12:46.398 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Nam_Lastseen' changed from 2022-09-05T20:12:16.310+0700 to 2022-09-05T20:12:46.353+0700

This is the log when camera is running normally, then I turn its power OFF then back ON:

==> /var/log/openhab/events.log <==
2022-09-05 20:18:52.792 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Nam_Lastseen' changed from 2022-09-05T20:18:22.502+0700 to 2022-09-05T20:18:52.786+0700
2022-09-05 20:18:53.940 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'PZEM_Today_Consumption' changed from 6.307 to 6.308
2022-09-05 20:18:53.949 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'PZEM_Current' changed from 1.46 to 1.459
2022-09-05 20:18:53.951 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'PZEM_Total_Consumption' changed from 250.47 to 250.471
2022-09-05 20:18:53.984 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'This_Month_Power_Cost' changed from 539991.2736 to 539994.01248
2022-09-05 20:18:58.666 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Linh_Lastseen' changed from 2022-09-05T20:18:28.541+0700 to 2022-09-05T20:18:58.661+0700
2022-09-05 20:19:03.883 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'PZEM_Today_Consumption' changed from 6.308 to 6.309
2022-09-05 20:19:03.890 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'PZEM_Total_Consumption' changed from 250.471 to 250.472
2022-09-05 20:19:03.925 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'This_Month_Power_Cost' changed from 539994.01248 to 539996.75136
2022-09-05 20:19:13.897 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'PZEM_Current' changed from 1.459 to 1.457

==> /var/log/openhab/openhab.log <==
2022-09-05 20:18:59.126 [TRACE] [amera.internal.onvif.OnvifConnection] - Onvif reply is:<?xml version="1.0" encoding="utf-8" standalone="yes" ?><s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:sc="http://www.w3.org/2003/05/soap-encoding" xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2" xmlns:wsa5="http://www.w3.org/2005/08/addressing"><s:Header><wsa5:Action>http://docs.oasis-open.org/wsn/bw-2/SubscriptionManager/RenewResponse</wsa5:Action></s:Header><s:Body><wsnt:RenewResponse><wsnt:TerminationTime>2022-09-05T13:19:58Z</wsnt:TerminationTime><wsnt:CurrentTime>2022-09-05T13:18:58Z</wsnt:CurrentTime></wsnt:RenewResponse></s:Body></s:Envelope>
2022-09-05 20:18:59.127 [TRACE] [amera.internal.onvif.OnvifConnection] - Sending ONVIF request:PullMessages
2022-09-05 20:19:07.142 [TRACE] [amera.internal.onvif.OnvifConnection] - Onvif reply is:<?xml version="1.0" encoding="utf-8" standalone="yes" ?><s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:sc="http://www.w3.org/2003/05/soap-encoding" xmlns:wsa5="http://www.w3.org/2005/08/addressing" xmlns:tev="http://www.onvif.org/ver10/events/wsdl" xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2" xmlns:tt="http://www.onvif.org/ver10/schema" xmlns:tns1="http://www.onvif.org/ver10/topics"><s:Header><wsa5:Action>http://www.onvif.org/ver10/events/wsdl/PullPointSubscription/PullMessagesResponse</wsa5:Action></s:Header><s:Body><tev:PullMessagesResponse><tev:CurrentTime>2022-09-05T13:19:06Z</tev:CurrentTime><tev:TerminationTime>2022-09-05T13:19:58Z</tev:TerminationTime></tev:PullMessagesResponse></s:Body></s:Envelope>
2022-09-05 20:19:07.144 [TRACE] [amera.internal.onvif.OnvifConnection] - Sending ONVIF request:Renew
2022-09-05 20:19:07.195 [TRACE] [amera.internal.onvif.OnvifConnection] - Onvif reply is:<?xml version="1.0" encoding="utf-8" standalone="yes" ?><s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:sc="http://www.w3.org/2003/05/soap-encoding" xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2" xmlns:wsa5="http://www.w3.org/2005/08/addressing"><s:Header><wsa5:Action>http://docs.oasis-open.org/wsn/bw-2/SubscriptionManager/RenewResponse</wsa5:Action></s:Header><s:Body><wsnt:RenewResponse><wsnt:TerminationTime>2022-09-05T13:20:06Z</wsnt:TerminationTime><wsnt:CurrentTime>2022-09-05T13:19:06Z</wsnt:CurrentTime></wsnt:RenewResponse></s:Body></s:Envelope>
2022-09-05 20:19:07.197 [TRACE] [amera.internal.onvif.OnvifConnection] - Sending ONVIF request:PullMessages
2022-09-05 20:19:15.198 [TRACE] [amera.internal.onvif.OnvifConnection] - Onvif reply is:<?xml version="1.0" encoding="utf-8" standalone="yes" ?><s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:sc="http://www.w3.org/2003/05/soap-encoding" xmlns:wsa5="http://www.w3.org/2005/08/addressing" xmlns:tev="http://www.onvif.org/ver10/events/wsdl" xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2" xmlns:tt="http://www.onvif.org/ver10/schema" xmlns:tns1="http://www.onvif.org/ver10/topics"><s:Header><wsa5:Action>http://www.onvif.org/ver10/events/wsdl/PullPointSubscription/PullMessagesResponse</wsa5:Action></s:Header><s:Body><tev:PullMessagesResponse><tev:CurrentTime>2022-09-05T13:19:14Z</tev:CurrentTime><tev:TerminationTime>2022-09-05T13:20:06Z</tev:TerminationTime></tev:PullMessagesResponse></s:Body></s:Envelope>
2022-09-05 20:19:15.200 [TRACE] [amera.internal.onvif.OnvifConnection] - Sending ONVIF request:Renew
2022-09-05 20:19:15.266 [TRACE] [amera.internal.onvif.OnvifConnection] - Onvif reply is:<?xml version="1.0" encoding="utf-8" standalone="yes" ?><s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:sc="http://www.w3.org/2003/05/soap-encoding" xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2" xmlns:wsa5="http://www.w3.org/2005/08/addressing"><s:Header><wsa5:Action>http://docs.oasis-open.org/wsn/bw-2/SubscriptionManager/RenewResponse</wsa5:Action></s:Header><s:Body><wsnt:RenewResponse><wsnt:TerminationTime>2022-09-05T13:20:14Z</wsnt:TerminationTime><wsnt:CurrentTime>2022-09-05T13:19:14Z</wsnt:CurrentTime></wsnt:RenewResponse></s:Body></s:Envelope>
2022-09-05 20:19:15.268 [TRACE] [amera.internal.onvif.OnvifConnection] - Sending ONVIF request:PullMessages

==> /var/log/openhab/events.log <==
2022-09-05 20:19:16.649 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'LivingroomLightsSwitch_Humidity' changed from 55.9 to 55.8
2022-09-05 20:19:16.651 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Livingroom_Humidity' changed from 55.9 to 55.8
2022-09-05 20:19:19.419 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Binh_Lastseen' changed from 2022-09-05T20:18:49.306+0700 to 2022-09-05T20:19:19.378+0700
2022-09-05 20:19:23.029 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Nam_Lastseen' changed from 2022-09-05T20:18:52.786+0700 to 2022-09-05T20:19:23.023+0700

==> /var/log/openhab/openhab.log <==
2022-09-05 20:19:23.277 [TRACE] [amera.internal.onvif.OnvifConnection] - Onvif reply is:<?xml version="1.0" encoding="utf-8" standalone="yes" ?><s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:sc="http://www.w3.org/2003/05/soap-encoding" xmlns:wsa5="http://www.w3.org/2005/08/addressing" xmlns:tev="http://www.onvif.org/ver10/events/wsdl" xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2" xmlns:tt="http://www.onvif.org/ver10/schema" xmlns:tns1="http://www.onvif.org/ver10/topics"><s:Header><wsa5:Action>http://www.onvif.org/ver10/events/wsdl/PullPointSubscription/PullMessagesResponse</wsa5:Action></s:Header><s:Body><tev:PullMessagesResponse><tev:CurrentTime>2022-09-05T13:19:22Z</tev:CurrentTime><tev:TerminationTime>2022-09-05T13:20:14Z</tev:TerminationTime></tev:PullMessagesResponse></s:Body></s:Envelope>
2022-09-05 20:19:23.281 [TRACE] [amera.internal.onvif.OnvifConnection] - Sending ONVIF request:Renew
2022-09-05 20:19:23.353 [TRACE] [amera.internal.onvif.OnvifConnection] - Onvif reply is:<?xml version="1.0" encoding="utf-8" standalone="yes" ?><s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:sc="http://www.w3.org/2003/05/soap-encoding" xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2" xmlns:wsa5="http://www.w3.org/2005/08/addressing"><s:Header><wsa5:Action>http://docs.oasis-open.org/wsn/bw-2/SubscriptionManager/RenewResponse</wsa5:Action></s:Header><s:Body><wsnt:RenewResponse><wsnt:TerminationTime>2022-09-05T13:20:22Z</wsnt:TerminationTime><wsnt:CurrentTime>2022-09-05T13:19:22Z</wsnt:CurrentTime></wsnt:RenewResponse></s:Body></s:Envelope>
2022-09-05 20:19:23.355 [TRACE] [amera.internal.onvif.OnvifConnection] - Sending ONVIF request:PullMessages

==> /var/log/openhab/events.log <==
2022-09-05 20:19:23.906 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'PZEM_Current' changed from 1.457 to 1.459
2022-09-05 20:19:23.909 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'PZEM_Today_Consumption' changed from 6.309 to 6.31
2022-09-05 20:19:23.912 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'PZEM_Total_Consumption' changed from 250.472 to 250.473
2022-09-05 20:19:23.942 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'This_Month_Power_Cost' changed from 539996.75136 to 539999.49024
2022-09-05 20:19:28.960 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Linh_Lastseen' changed from 2022-09-05T20:18:58.661+0700 to 2022-09-05T20:19:28.953+0700
2022-09-05 20:19:29.789 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Bathroom_Humidity' changed from 69 to 68
2022-09-05 20:19:31.202 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Kitchen_Humidity' changed from 50.7 to 50.8

==> /var/log/openhab/openhab.log <==
2022-09-05 20:19:31.390 [TRACE] [amera.internal.onvif.OnvifConnection] - Onvif reply is:<?xml version="1.0" encoding="utf-8" standalone="yes" ?><s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:sc="http://www.w3.org/2003/05/soap-encoding" xmlns:wsa5="http://www.w3.org/2005/08/addressing" xmlns:tev="http://www.onvif.org/ver10/events/wsdl" xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2" xmlns:tt="http://www.onvif.org/ver10/schema" xmlns:tns1="http://www.onvif.org/ver10/topics"><s:Header><wsa5:Action>http://www.onvif.org/ver10/events/wsdl/PullPointSubscription/PullMessagesResponse</wsa5:Action></s:Header><s:Body><tev:PullMessagesResponse><tev:CurrentTime>2022-09-05T13:19:30Z</tev:CurrentTime><tev:TerminationTime>2022-09-05T13:20:22Z</tev:TerminationTime></tev:PullMessagesResponse></s:Body></s:Envelope>
2022-09-05 20:19:31.391 [TRACE] [amera.internal.onvif.OnvifConnection] - Sending ONVIF request:Renew
2022-09-05 20:19:31.447 [TRACE] [amera.internal.onvif.OnvifConnection] - Onvif reply is:<?xml version="1.0" encoding="utf-8" standalone="yes" ?><s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:sc="http://www.w3.org/2003/05/soap-encoding" xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2" xmlns:wsa5="http://www.w3.org/2005/08/addressing"><s:Header><wsa5:Action>http://docs.oasis-open.org/wsn/bw-2/SubscriptionManager/RenewResponse</wsa5:Action></s:Header><s:Body><wsnt:RenewResponse><wsnt:TerminationTime>2022-09-05T13:20:30Z</wsnt:TerminationTime><wsnt:CurrentTime>2022-09-05T13:19:30Z</wsnt:CurrentTime></wsnt:RenewResponse></s:Body></s:Envelope>
2022-09-05 20:19:31.450 [TRACE] [amera.internal.onvif.OnvifConnection] - Sending ONVIF request:PullMessages

==> /var/log/openhab/events.log <==
2022-09-05 20:19:33.911 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'PZEM_Today_Consumption' changed from 6.31 to 6.311
2022-09-05 20:19:33.926 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'PZEM_Power' changed from 301 to 300
2022-09-05 20:19:33.932 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'PZEM_Current' changed from 1.459 to 1.456
2022-09-05 20:19:33.934 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'PZEM_Total_Consumption' changed from 250.473 to 250.474
2022-09-05 20:19:33.962 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'This_Month_Power_Cost' changed from 539999.49024 to 540002.22912

==> /var/log/openhab/openhab.log <==
2022-09-05 20:19:39.476 [TRACE] [amera.internal.onvif.OnvifConnection] - Onvif reply is:<?xml version="1.0" encoding="utf-8" standalone="yes" ?><s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:sc="http://www.w3.org/2003/05/soap-encoding" xmlns:wsa5="http://www.w3.org/2005/08/addressing" xmlns:tev="http://www.onvif.org/ver10/events/wsdl" xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2" xmlns:tt="http://www.onvif.org/ver10/schema" xmlns:tns1="http://www.onvif.org/ver10/topics"><s:Header><wsa5:Action>http://www.onvif.org/ver10/events/wsdl/PullPointSubscription/PullMessagesResponse</wsa5:Action></s:Header><s:Body><tev:PullMessagesResponse><tev:CurrentTime>2022-09-05T13:19:38Z</tev:CurrentTime><tev:TerminationTime>2022-09-05T13:20:30Z</tev:TerminationTime></tev:PullMessagesResponse></s:Body></s:Envelope>
2022-09-05 20:19:39.478 [TRACE] [amera.internal.onvif.OnvifConnection] - Sending ONVIF request:Renew
2022-09-05 20:19:39.543 [TRACE] [amera.internal.onvif.OnvifConnection] - Onvif reply is:<?xml version="1.0" encoding="utf-8" standalone="yes" ?><s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:sc="http://www.w3.org/2003/05/soap-encoding" xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2" xmlns:wsa5="http://www.w3.org/2005/08/addressing"><s:Header><wsa5:Action>http://docs.oasis-open.org/wsn/bw-2/SubscriptionManager/RenewResponse</wsa5:Action></s:Header><s:Body><wsnt:RenewResponse><wsnt:TerminationTime>2022-09-05T13:20:38Z</wsnt:TerminationTime><wsnt:CurrentTime>2022-09-05T13:19:38Z</wsnt:CurrentTime></wsnt:RenewResponse></s:Body></s:Envelope>
2022-09-05 20:19:39.545 [TRACE] [amera.internal.onvif.OnvifConnection] - Sending ONVIF request:PullMessages

==> /var/log/openhab/events.log <==
2022-09-05 20:19:43.879 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'PZEM_Total_Consumption' changed from 250.474 to 250.475
2022-09-05 20:19:43.883 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'PZEM_Power' changed from 300 to 301
2022-09-05 20:19:43.884 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'PZEM_Today_Consumption' changed from 6.311 to 6.312
2022-09-05 20:19:43.886 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'PZEM_Current' changed from 1.456 to 1.46
2022-09-05 20:19:43.911 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'This_Month_Power_Cost' changed from 540002.22912 to 540004.96800

==> /var/log/openhab/openhab.log <==
2022-09-05 20:19:45.537 [TRACE] [amera.internal.onvif.OnvifConnection] - Onvif reply is:<?xml version="1.0" encoding="utf-8" standalone="yes" ?><s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:sc="http://www.w3.org/2003/05/soap-encoding" xmlns:wsa5="http://www.w3.org/2005/08/addressing" xmlns:tev="http://www.onvif.org/ver10/events/wsdl" xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2" xmlns:tt="http://www.onvif.org/ver10/schema" xmlns:tns1="http://www.onvif.org/ver10/topics"><s:Header><wsa5:Action>http://www.onvif.org/ver10/events/wsdl/PullPointSubscription/PullMessagesResponse</wsa5:Action></s:Header><s:Body><tev:PullMessagesResponse><tev:CurrentTime>2022-09-05T13:19:44Z</tev:CurrentTime><tev:TerminationTime>2022-09-05T13:20:38Z</tev:TerminationTime><wsnt:NotificationMessage><wsnt:Topic Dialect="http://www.onvif.org/ver10/tev/topicExpression/ConcreteSet">tns1:VideoSource/MotionAlarm</wsnt:Topic><wsnt:Message><tt:Message UtcTime="2022-09-05T13:19:44Z" PropertyOperation="Changed"><tt:Source><tt:SimpleItem Name="Source" Value="VideoSource000"></tt:SimpleItem></tt:Source><tt:Data><tt:SimpleItem Name="State" Value="true"></tt:SimpleItem></tt:Data></tt:Message></wsnt:Message></wsnt:NotificationMessage></tev:PullMessagesResponse></s:Body></s:Envelope>
2022-09-05 20:19:45.539 [DEBUG] [amera.internal.onvif.OnvifConnection] - Onvif Event Topic:VideoSource/MotionAlarm, Data:State, Value:true
2022-09-05 20:19:45.541 [TRACE] [amera.internal.onvif.OnvifConnection] - Sending ONVIF request:Renew

==> /var/log/openhab/events.log <==
2022-09-05 20:19:45.544 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'CameraMotionAlarm' changed from OFF to ON

==> /var/log/openhab/openhab.log <==
2022-09-05 20:19:45.562 [DEBUG] [ng.ipcamera.internal.IpCameraActions] - Recording ipcamera.gif for 5 seconds.
2022-09-05 20:19:45.564 [DEBUG] [hab.binding.ipcamera.internal.Ffmpeg] - Starting ffmpeg with this command now:-y -t 5 -hide_banner -loglevel warning -rtsp_transport tcp -i rtsp://admin:********@192.168.0.214:554/cam/realmonitor?channel=1&subtype=0&unicast=true&proto=Onvif -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 /var/lib/openhab/ipcamera/Livingroom_Imou/ipcamera.gif

==> /var/log/openhab/events.log <==
2022-09-05 20:19:45.569 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'CameraRecordingGif' changed from 0 to 5

==> /var/log/openhab/openhab.log <==
2022-09-05 20:19:45.739 [TRACE] [amera.internal.onvif.OnvifConnection] - Onvif reply is:<?xml version="1.0" encoding="utf-8" standalone="yes" ?><s:Envelope xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:sc="http://www.w3.org/2003/05/soap-encoding" xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2" xmlns:wsa5="http://www.w3.org/2005/08/addressing"><s:Header><wsa5:Action>http://docs.oasis-open.org/wsn/bw-2/SubscriptionManager/RenewResponse</wsa5:Action></s:Header><s:Body><wsnt:RenewResponse><wsnt:TerminationTime>2022-09-05T13:20:45Z</wsnt:TerminationTime><wsnt:CurrentTime>2022-09-05T13:19:45Z</wsnt:CurrentTime></wsnt:RenewResponse></s:Body></s:Envelope>
2022-09-05 20:19:45.740 [TRACE] [amera.internal.onvif.OnvifConnection] - Sending ONVIF request:PullMessages
2022-09-05 20:19:47.430 [DEBUG] [hab.binding.ipcamera.internal.Ffmpeg] - [swscaler @ 0x1cc20b0] deprecated pixel format used, make sure you did set range correctly

==> /var/log/openhab/events.log <==
2022-09-05 20:19:49.525 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Binh_Lastseen' changed from 2022-09-05T20:19:19.378+0700 to 2022-09-05T20:19:49.519+0700
2022-09-05 20:19:53.846 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Nam_Lastseen' changed from 2022-09-05T20:19:23.023+0700 to 2022-09-05T20:19:53.841+0700
2022-09-05 20:19:53.889 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'PZEM_Today_Consumption' changed from 6.312 to 6.313
2022-09-05 20:19:53.891 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'PZEM_Power' changed from 301 to 344
2022-09-05 20:19:53.892 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'PZEM_Power_Factor' changed from 0.95 to 0.92
2022-09-05 20:19:53.895 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'PZEM_Total_Consumption' changed from 250.475 to 250.476
2022-09-05 20:19:53.896 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'PZEM_Current' changed from 1.46 to 1.73
2022-09-05 20:19:53.923 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'This_Month_Power_Cost' changed from 540004.96800 to 540007.70688
2022-09-05 20:19:59.266 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Linh_Lastseen' changed from 2022-09-05T20:19:28.953+0700 to 2022-09-05T20:19:59.258+0700
2022-09-05 20:20:03.902 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'PZEM_Today_Consumption' changed from 6.313 to 6.314
2022-09-05 20:20:03.910 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'PZEM_Power' changed from 344 to 325
2022-09-05 20:20:03.913 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'PZEM_Power_Factor' changed from 0.92 to 0.93
2022-09-05 20:20:03.914 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'PZEM_Current' changed from 1.73 to 1.62
2022-09-05 20:20:03.915 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'PZEM_Total_Consumption' changed from 250.476 to 250.477
2022-09-05 20:20:03.917 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'PZEM_Voltage' changed from 217 to 216
2022-09-05 20:20:03.942 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'This_Month_Power_Cost' changed from 540007.70688 to 540010.44576
2022-09-05 20:20:13.910 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'PZEM_Power' changed from 325 to 324
2022-09-05 20:20:13.914 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'PZEM_Today_Consumption' changed from 6.314 to 6.315
2022-09-05 20:20:13.918 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'PZEM_Current' changed from 1.62 to 1.618

Try with the Alpha build as it has extra logging in it that will be useful, also please tell me when the camera was rebooted as by looking at the logs it is not clear when you do that. If the logs just stop when you reboot, I can not know this info unless you give some extra detail.

That one is important to know as an ONVIF camera defined by the ONVIF spec should have a snapshot url, I would get a camera that follows the spec fully. If I need to re-run tests to see if I can reproduce the issue I would need to emmulate this condition to see what happens. If you use gear that is similar to what the dev/maintainer uses then you will have less issues as you stay in the area that is well tested.

1 Like

This Imou Ranger 2 has no snapshot URL. I’ve searched everywhere on the Internet and see many people have the same issue with this model.
You told me earlier that cameras those not fully ONVIF compliant may cause the problem. I will get another camera that has snapshot URL and fully ONVIF compliant to test and report later

I would try the build I just uploaded as I was able to reproduce an issue and it seems fixed, it has the extra logging removed. The fact that a restart of the binding was fixing it for you, this indicates that it was a bug and not the camera locking up. I would recommend a camera that has a snapshot ability regardless and even better if it has a good reputation.

EDIT:
@downloadme4free
I read through the code of the binding and my guess is that the snapshot generation from the rtsp stream will not restart automatically if your setting up as ONVIF thing type. If you setup as GENERIC thing type it should restart this feature, but not when the binding sees an onvif camera, as all ONVIF cameras should have this feature as the onvif spec states it is mandatory to get onvif compliance. So I would have to change the binding to allow this special use case and run some tests. If your camera does not have motion alarms that onvif gives you, then just setup as generic and you will have a better experience. If I do change the binding, you will still be using it in a way that I do not test any changes against, so bugs can slip through easier. Upgrading the camera is a small amount to get into an area that is better tested and supported.

Finally, I borrowed a Dahua camera DH-IPC-HDW2431TP-AS-S2 to test. As manufacturer said it’s an Onvif Profile S/Profile G/Profile T compliant device. In the binding this camera can be recognized and work as both Onvif and Dahua thing types, and I tried both.

In the things file I have:

Thing ipcamera:dahua:Dahua_Test @ "Livingroom" [ 
 ipAddress="192.168.0.234", 
 username="admin", 
 password="secret",
 snapshotUrl="http://192.168.0.234/cgi-bin/snapshot.cgi?Channel=1"
]

I switch between “dahua” and “onvif” thing, with each thing I test the camera alarm, record GIF, unplug then re-plug the power, and the results are:

With Onvif thing: When camera is working, if connection is lost (at 2022-09-08 21:27:40 in the log) then binding will try to re-connect and camera will go alive again (at 2022-09-08 21:28:48), but camera cannot trigger alarm and recording anymore.

==> /var/log/openhab/openhab.log <==
2022-09-08 21:26:38.028 [TRACE] [amera.internal.onvif.OnvifConnection] - Sending ONVIF request:PullMessages
2022-09-08 21:26:44.526 [TRACE] [amera.internal.onvif.OnvifConnection] - Onvif reply is:<?xml version="1.0" encoding="utf-8" standalone="yes" ?><s:Envelope xmlns:sc="http://www.w3.org/2003/05/soap-encoding" xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:tt="http://www.onvif.org/ver10/schema" xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2" xmlns:tev="http://www.onvif.org/ver10/events/wsdl" xmlns:wsa5="http://www.w3.org/2005/08/addressing" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wstop="http://docs.oasis-open.org/wsn/t-1" xmlns:tns1="http://www.onvif.org/ver10/topics"><s:Header/><s:Body><tev:PullMessagesResponse><tev:CurrentTime>2022-09-08T13:26:34Z</tev:CurrentTime><tev:TerminationTime>2022-09-08T13:27:29Z</tev:TerminationTime></tev:PullMessagesResponse></s:Body></s:Envelope>
2022-09-08 21:26:44.527 [TRACE] [amera.internal.onvif.OnvifConnection] - Sending ONVIF request:Renew
2022-09-08 21:26:44.542 [TRACE] [amera.internal.onvif.OnvifConnection] - Onvif reply is:<?xml version="1.0" encoding="utf-8" standalone="yes" ?><s:Envelope xmlns:sc="http://www.w3.org/2003/05/soap-encoding" xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:tt="http://www.onvif.org/ver10/schema" xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2" xmlns:wsa5="http://www.w3.org/2005/08/addressing" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wstop="http://docs.oasis-open.org/wsn/t-1" xmlns:tns1="http://www.onvif.org/ver10/topics"><s:Header/><s:Body><wsnt:RenewResponse><wsnt:TerminationTime>2022-09-08T13:27:35Z</wsnt:TerminationTime><wsnt:CurrentTime>2022-09-08T13:26:35Z</wsnt:CurrentTime></wsnt:RenewResponse></s:Body></s:Envelope>
2022-09-08 21:26:44.543 [TRACE] [amera.internal.onvif.OnvifConnection] - Sending ONVIF request:PullMessages
2022-09-08 21:26:49.776 [DEBUG] [ipcamera.internal.MyNettyAuthHandler] - Camera at IP:192.168.0.234 gave a reply with a response code of :500
2022-09-08 21:26:51.036 [TRACE] [amera.internal.onvif.OnvifConnection] - Onvif reply is:<?xml version="1.0" encoding="utf-8" standalone="yes" ?><s:Envelope xmlns:sc="http://www.w3.org/2003/05/soap-encoding" xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:tt="http://www.onvif.org/ver10/schema" xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2" xmlns:tev="http://www.onvif.org/ver10/events/wsdl" xmlns:wsa5="http://www.w3.org/2005/08/addressing" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wstop="http://docs.oasis-open.org/wsn/t-1" xmlns:tns1="http://www.onvif.org/ver10/topics"><s:Header/><s:Body><tev:PullMessagesResponse><tev:CurrentTime>2022-09-08T13:26:41Z</tev:CurrentTime><tev:TerminationTime>2022-09-08T13:27:35Z</tev:TerminationTime></tev:PullMessagesResponse></s:Body></s:Envelope>
2022-09-08 21:26:51.037 [TRACE] [amera.internal.onvif.OnvifConnection] - Sending ONVIF request:Renew
2022-09-08 21:26:51.049 [TRACE] [amera.internal.onvif.OnvifConnection] - Onvif reply is:<?xml version="1.0" encoding="utf-8" standalone="yes" ?><s:Envelope xmlns:sc="http://www.w3.org/2003/05/soap-encoding" xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:tt="http://www.onvif.org/ver10/schema" xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2" xmlns:wsa5="http://www.w3.org/2005/08/addressing" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wstop="http://docs.oasis-open.org/wsn/t-1" xmlns:tns1="http://www.onvif.org/ver10/topics"><s:Header/><s:Body><wsnt:RenewResponse><wsnt:TerminationTime>2022-09-08T13:27:42Z</wsnt:TerminationTime><wsnt:CurrentTime>2022-09-08T13:26:42Z</wsnt:CurrentTime></wsnt:RenewResponse></s:Body></s:Envelope>
2022-09-08 21:26:51.051 [TRACE] [amera.internal.onvif.OnvifConnection] - Sending ONVIF request:PullMessages

==> /var/log/openhab/openhab.log <==
2022-09-08 21:26:57.546 [TRACE] [amera.internal.onvif.OnvifConnection] - Onvif reply is:<?xml version="1.0" encoding="utf-8" standalone="yes" ?><s:Envelope xmlns:sc="http://www.w3.org/2003/05/soap-encoding" xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:tt="http://www.onvif.org/ver10/schema" xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2" xmlns:tev="http://www.onvif.org/ver10/events/wsdl" xmlns:wsa5="http://www.w3.org/2005/08/addressing" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wstop="http://docs.oasis-open.org/wsn/t-1" xmlns:tns1="http://www.onvif.org/ver10/topics"><s:Header/><s:Body><tev:PullMessagesResponse><tev:CurrentTime>2022-09-08T13:26:47Z</tev:CurrentTime><tev:TerminationTime>2022-09-08T13:27:42Z</tev:TerminationTime></tev:PullMessagesResponse></s:Body></s:Envelope>
2022-09-08 21:26:57.548 [TRACE] [amera.internal.onvif.OnvifConnection] - Sending ONVIF request:Renew
2022-09-08 21:26:57.561 [TRACE] [amera.internal.onvif.OnvifConnection] - Onvif reply is:<?xml version="1.0" encoding="utf-8" standalone="yes" ?><s:Envelope xmlns:sc="http://www.w3.org/2003/05/soap-encoding" xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:tt="http://www.onvif.org/ver10/schema" xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2" xmlns:wsa5="http://www.w3.org/2005/08/addressing" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wstop="http://docs.oasis-open.org/wsn/t-1" xmlns:tns1="http://www.onvif.org/ver10/topics"><s:Header/><s:Body><wsnt:RenewResponse><wsnt:TerminationTime>2022-09-08T13:27:48Z</wsnt:TerminationTime><wsnt:CurrentTime>2022-09-08T13:26:48Z</wsnt:CurrentTime></wsnt:RenewResponse></s:Body></s:Envelope>
2022-09-08 21:26:57.563 [TRACE] [amera.internal.onvif.OnvifConnection] - Sending ONVIF request:PullMessages
2022-09-08 21:26:58.396 [TRACE] [amera.internal.onvif.OnvifConnection] - Onvif reply is:<?xml version="1.0" encoding="utf-8" standalone="yes" ?><s:Envelope xmlns:sc="http://www.w3.org/2003/05/soap-encoding" xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:tt="http://www.onvif.org/ver10/schema" xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2" xmlns:tev="http://www.onvif.org/ver10/events/wsdl" xmlns:wsa5="http://www.w3.org/2005/08/addressing" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wstop="http://docs.oasis-open.org/wsn/t-1" xmlns:tns1="http://www.onvif.org/ver10/topics"><s:Header/><s:Body><tev:PullMessagesResponse><tev:CurrentTime>2022-09-08T13:26:49Z</tev:CurrentTime><tev:TerminationTime>2022-09-08T13:27:48Z</tev:TerminationTime><wsnt:NotificationMessage><wsnt:Topic Dialect="http://www.onvif.org/ver10/tev/topicExpression/ConcreteSet">tns1:RuleEngine/CellMotionDetector/Motion</wsnt:Topic><wsnt:Message><tt:Message UtcTime="2022-09-08T13:26:49Z" PropertyOperation="Changed"><tt:Source><tt:SimpleItem Name="VideoSourceConfigurationToken" Value="00000"/><tt:SimpleItem Name="VideoAnalyticsConfigurationToken" Value="00000"/><tt:SimpleItem Name="Rule" Value="00000"/></tt:Source><tt:Data><tt:SimpleItem Name="IsMotion" Value="true"/></tt:Data></tt:Message></wsnt:Message></wsnt:NotificationMessage></tev:PullMessagesResponse></s:Body></s:Envelope>
2022-09-08 21:26:58.397 [DEBUG] [amera.internal.onvif.OnvifConnection] - Onvif Event Topic:RuleEngine/CellMotionDetector/Motion, Data:IsMotion, Value:true
2022-09-08 21:26:58.399 [TRACE] [amera.internal.onvif.OnvifConnection] - Sending ONVIF request:Renew
2022-09-08 21:26:58.412 [TRACE] [amera.internal.onvif.OnvifConnection] - Onvif reply is:<?xml version="1.0" encoding="utf-8" standalone="yes" ?><s:Envelope xmlns:sc="http://www.w3.org/2003/05/soap-encoding" xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:tt="http://www.onvif.org/ver10/schema" xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2" xmlns:wsa5="http://www.w3.org/2005/08/addressing" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wstop="http://docs.oasis-open.org/wsn/t-1" xmlns:tns1="http://www.onvif.org/ver10/topics"><s:Header/><s:Body><wsnt:RenewResponse><wsnt:TerminationTime>2022-09-08T13:27:49Z</wsnt:TerminationTime><wsnt:CurrentTime>2022-09-08T13:26:49Z</wsnt:CurrentTime></wsnt:RenewResponse></s:Body></s:Envelope>
2022-09-08 21:26:58.415 [TRACE] [amera.internal.onvif.OnvifConnection] - Sending ONVIF request:PullMessages
2022-09-08 21:26:58.429 [TRACE] [amera.internal.onvif.OnvifConnection] - Onvif reply is:<?xml version="1.0" encoding="utf-8" standalone="yes" ?><s:Envelope xmlns:sc="http://www.w3.org/2003/05/soap-encoding" xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:tt="http://www.onvif.org/ver10/schema" xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2" xmlns:tev="http://www.onvif.org/ver10/events/wsdl" xmlns:wsa5="http://www.w3.org/2005/08/addressing" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wstop="http://docs.oasis-open.org/wsn/t-1" xmlns:tns1="http://www.onvif.org/ver10/topics"><s:Header/><s:Body><tev:PullMessagesResponse><tev:CurrentTime>2022-09-08T13:26:49Z</tev:CurrentTime><tev:TerminationTime>2022-09-08T13:27:49Z</tev:TerminationTime><wsnt:NotificationMessage><wsnt:Topic Dialect="http://www.onvif.org/ver10/tev/topicExpression/ConcreteSet">tns1:VideoSource/MotionAlarm</wsnt:Topic><wsnt:Message><tt:Message UtcTime="2022-09-08T13:26:49Z" PropertyOperation="Changed"><tt:Source><tt:SimpleItem Name="Source" Value="00000"/></tt:Source><tt:Data><tt:SimpleItem Name="State" Value="true"/></tt:Data></tt:Message></wsnt:Message></wsnt:NotificationMessage></tev:PullMessagesResponse></s:Body></s:Envelope>
2022-09-08 21:26:58.431 [DEBUG] [amera.internal.onvif.OnvifConnection] - Onvif Event Topic:VideoSource/MotionAlarm, Data:State, Value:true
2022-09-08 21:26:58.432 [TRACE] [amera.internal.onvif.OnvifConnection] - Sending ONVIF request:Renew

==> /var/log/openhab/events.log <==
2022-09-08 21:26:58.438 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'DahuaMotionAlarm' changed from OFF to ON

==> /var/log/openhab/openhab.log <==
2022-09-08 21:26:58.447 [TRACE] [amera.internal.onvif.OnvifConnection] - Onvif reply is:<?xml version="1.0" encoding="utf-8" standalone="yes" ?><s:Envelope xmlns:sc="http://www.w3.org/2003/05/soap-encoding" xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:tt="http://www.onvif.org/ver10/schema" xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2" xmlns:wsa5="http://www.w3.org/2005/08/addressing" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wstop="http://docs.oasis-open.org/wsn/t-1" xmlns:tns1="http://www.onvif.org/ver10/topics"><s:Header/><s:Body><wsnt:RenewResponse><wsnt:TerminationTime>2022-09-08T13:27:49Z</wsnt:TerminationTime><wsnt:CurrentTime>2022-09-08T13:26:49Z</wsnt:CurrentTime></wsnt:RenewResponse></s:Body></s:Envelope>
2022-09-08 21:26:58.449 [TRACE] [amera.internal.onvif.OnvifConnection] - Sending ONVIF request:PullMessages
2022-09-08 21:26:59.024 [DEBUG] [ng.ipcamera.internal.IpCameraActions] - Recording ipcamera.gif for 5 seconds.
2022-09-08 21:26:59.026 [DEBUG] [hab.binding.ipcamera.internal.Ffmpeg] - Starting ffmpeg with this command now:-y -t 5 -hide_banner -loglevel warning -rtsp_transport tcp -i rtsp://admin:********@192.168.0.234:554/cam/realmonitor?channel=1&amp;subtype=0&amp;unicast=true&amp;proto=Onvif -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 /var/lib/openhab/ipcamera/Dahua_Test/ipcamera.gif

==> /var/log/openhab/events.log <==
2022-09-08 21:26:59.033 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'DahuaRecordingGif' changed from 0 to 5
==> /var/log/openhab/openhab.log <==
2022-09-08 21:27:00.735 [DEBUG] [hab.binding.ipcamera.internal.Ffmpeg] - Guessed Channel Layout for Input Stream #0.1 : mono
2022-09-08 21:27:01.010 [DEBUG] [hab.binding.ipcamera.internal.Ffmpeg] - [swscaler @ 0x1e778e0] deprecated pixel format used, make sure you did set range correctly
2022-09-08 21:27:04.944 [TRACE] [amera.internal.onvif.OnvifConnection] - Onvif reply is:<?xml version="1.0" encoding="utf-8" standalone="yes" ?><s:Envelope xmlns:sc="http://www.w3.org/2003/05/soap-encoding" xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:tt="http://www.onvif.org/ver10/schema" xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2" xmlns:tev="http://www.onvif.org/ver10/events/wsdl" xmlns:wsa5="http://www.w3.org/2005/08/addressing" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wstop="http://docs.oasis-open.org/wsn/t-1" xmlns:tns1="http://www.onvif.org/ver10/topics"><s:Header/><s:Body><tev:PullMessagesResponse><tev:CurrentTime>2022-09-08T13:26:55Z</tev:CurrentTime><tev:TerminationTime>2022-09-08T13:27:49Z</tev:TerminationTime></tev:PullMessagesResponse></s:Body></s:Envelope>
2022-09-08 21:27:04.947 [TRACE] [amera.internal.onvif.OnvifConnection] - Sending ONVIF request:Renew
2022-09-08 21:27:04.970 [TRACE] [amera.internal.onvif.OnvifConnection] - Onvif reply is:<?xml version="1.0" encoding="utf-8" standalone="yes" ?><s:Envelope xmlns:sc="http://www.w3.org/2003/05/soap-encoding" xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:tt="http://www.onvif.org/ver10/schema" xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2" xmlns:wsa5="http://www.w3.org/2005/08/addressing" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wstop="http://docs.oasis-open.org/wsn/t-1" xmlns:tns1="http://www.onvif.org/ver10/topics"><s:Header/><s:Body><wsnt:RenewResponse><wsnt:TerminationTime>2022-09-08T13:27:55Z</wsnt:TerminationTime><wsnt:CurrentTime>2022-09-08T13:26:55Z</wsnt:CurrentTime></wsnt:RenewResponse></s:Body></s:Envelope>
2022-09-08 21:27:04.972 [TRACE] [amera.internal.onvif.OnvifConnection] - Sending ONVIF request:PullMessages
2022-09-08 21:27:04.998 [TRACE] [amera.internal.onvif.OnvifConnection] - Onvif reply is:<?xml version="1.0" encoding="utf-8" standalone="yes" ?><s:Envelope xmlns:sc="http://www.w3.org/2003/05/soap-encoding" xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:tt="http://www.onvif.org/ver10/schema" xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2" xmlns:tev="http://www.onvif.org/ver10/events/wsdl" xmlns:wsa5="http://www.w3.org/2005/08/addressing" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wstop="http://docs.oasis-open.org/wsn/t-1" xmlns:tns1="http://www.onvif.org/ver10/topics"><s:Header/><s:Body><tev:PullMessagesResponse><tev:CurrentTime>2022-09-08T13:26:55Z</tev:CurrentTime><tev:TerminationTime>2022-09-08T13:27:55Z</tev:TerminationTime><wsnt:NotificationMessage><wsnt:Topic Dialect="http://www.onvif.org/ver10/tev/topicExpression/ConcreteSet">tns1:RuleEngine/CellMotionDetector/Motion</wsnt:Topic><wsnt:Message><tt:Message UtcTime="2022-09-08T13:26:55Z" PropertyOperation="Changed"><tt:Source><tt:SimpleItem Name="VideoSourceConfigurationToken" Value="00000"/><tt:SimpleItem Name="VideoAnalyticsConfigurationToken" Value="00000"/><tt:SimpleItem Name="Rule" Value="00000"/></tt:Source><tt:Data><tt:SimpleItem Name="IsMotion" Value="false"/></tt:Data></tt:Message></wsnt:Message></wsnt:NotificationMessage></tev:PullMessagesResponse></s:Body></s:Envelope>
2022-09-08 21:27:05.000 [DEBUG] [amera.internal.onvif.OnvifConnection] - Onvif Event Topic:RuleEngine/CellMotionDetector/Motion, Data:IsMotion, Value:false
2022-09-08 21:27:05.002 [TRACE] [amera.internal.onvif.OnvifConnection] - Sending ONVIF request:Renew
2022-09-08 21:27:05.041 [TRACE] [amera.internal.onvif.OnvifConnection] - Onvif reply is:<?xml version="1.0" encoding="utf-8" standalone="yes" ?><s:Envelope xmlns:sc="http://www.w3.org/2003/05/soap-encoding" xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:tt="http://www.onvif.org/ver10/schema" xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2" xmlns:wsa5="http://www.w3.org/2005/08/addressing" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wstop="http://docs.oasis-open.org/wsn/t-1" xmlns:tns1="http://www.onvif.org/ver10/topics"><s:Header/><s:Body><wsnt:RenewResponse><wsnt:TerminationTime>2022-09-08T13:27:56Z</wsnt:TerminationTime><wsnt:CurrentTime>2022-09-08T13:26:56Z</wsnt:CurrentTime></wsnt:RenewResponse></s:Body></s:Envelope>
2022-09-08 21:27:05.043 [TRACE] [amera.internal.onvif.OnvifConnection] - Sending ONVIF request:PullMessages
2022-09-08 21:27:05.072 [TRACE] [amera.internal.onvif.OnvifConnection] - Onvif reply is:<?xml version="1.0" encoding="utf-8" standalone="yes" ?><s:Envelope xmlns:sc="http://www.w3.org/2003/05/soap-encoding" xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:tt="http://www.onvif.org/ver10/schema" xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2" xmlns:tev="http://www.onvif.org/ver10/events/wsdl" xmlns:wsa5="http://www.w3.org/2005/08/addressing" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wstop="http://docs.oasis-open.org/wsn/t-1" xmlns:tns1="http://www.onvif.org/ver10/topics"><s:Header/><s:Body><tev:PullMessagesResponse><tev:CurrentTime>2022-09-08T13:26:56Z</tev:CurrentTime><tev:TerminationTime>2022-09-08T13:27:56Z</tev:TerminationTime><wsnt:NotificationMessage><wsnt:Topic Dialect="http://www.onvif.org/ver10/tev/topicExpression/ConcreteSet">tns1:VideoSource/MotionAlarm</wsnt:Topic><wsnt:Message><tt:Message UtcTime="2022-09-08T13:26:55Z" PropertyOperation="Changed"><tt:Source><tt:SimpleItem Name="Source" Value="00000"/></tt:Source><tt:Data><tt:SimpleItem Name="State" Value="false"/></tt:Data></tt:Message></wsnt:Message></wsnt:NotificationMessage></tev:PullMessagesResponse></s:Body></s:Envelope>
2022-09-08 21:27:05.075 [DEBUG] [amera.internal.onvif.OnvifConnection] - Onvif Event Topic:VideoSource/MotionAlarm, Data:State, Value:false
2022-09-08 21:27:05.078 [TRACE] [amera.internal.onvif.OnvifConnection] - Sending ONVIF request:Renew

==> /var/log/openhab/events.log <==
2022-09-08 21:27:05.080 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'DahuaMotionAlarm' changed from ON to OFF

==> /var/log/openhab/openhab.log <==
2022-09-08 21:27:05.106 [TRACE] [amera.internal.onvif.OnvifConnection] - Onvif reply is:<?xml version="1.0" encoding="utf-8" standalone="yes" ?><s:Envelope xmlns:sc="http://www.w3.org/2003/05/soap-encoding" xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:tt="http://www.onvif.org/ver10/schema" xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2" xmlns:wsa5="http://www.w3.org/2005/08/addressing" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wstop="http://docs.oasis-open.org/wsn/t-1" xmlns:tns1="http://www.onvif.org/ver10/topics"><s:Header/><s:Body><wsnt:RenewResponse><wsnt:TerminationTime>2022-09-08T13:27:56Z</wsnt:TerminationTime><wsnt:CurrentTime>2022-09-08T13:26:56Z</wsnt:CurrentTime></wsnt:RenewResponse></s:Body></s:Envelope>
2022-09-08 21:27:05.108 [TRACE] [amera.internal.onvif.OnvifConnection] - Sending ONVIF request:PullMessages

==> /var/log/openhab/openhab.log <==
2022-09-08 21:27:11.615 [TRACE] [amera.internal.onvif.OnvifConnection] - Onvif reply is:<?xml version="1.0" encoding="utf-8" standalone="yes" ?><s:Envelope xmlns:sc="http://www.w3.org/2003/05/soap-encoding" xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:tt="http://www.onvif.org/ver10/schema" xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2" xmlns:tev="http://www.onvif.org/ver10/events/wsdl" xmlns:wsa5="http://www.w3.org/2005/08/addressing" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wstop="http://docs.oasis-open.org/wsn/t-1" xmlns:tns1="http://www.onvif.org/ver10/topics"><s:Header/><s:Body><tev:PullMessagesResponse><tev:CurrentTime>2022-09-08T13:27:01Z</tev:CurrentTime><tev:TerminationTime>2022-09-08T13:27:56Z</tev:TerminationTime></tev:PullMessagesResponse></s:Body></s:Envelope>
2022-09-08 21:27:11.617 [TRACE] [amera.internal.onvif.OnvifConnection] - Sending ONVIF request:Renew
2022-09-08 21:27:11.630 [TRACE] [amera.internal.onvif.OnvifConnection] - Onvif reply is:<?xml version="1.0" encoding="utf-8" standalone="yes" ?><s:Envelope xmlns:sc="http://www.w3.org/2003/05/soap-encoding" xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:tt="http://www.onvif.org/ver10/schema" xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2" xmlns:wsa5="http://www.w3.org/2005/08/addressing" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wstop="http://docs.oasis-open.org/wsn/t-1" xmlns:tns1="http://www.onvif.org/ver10/topics"><s:Header/><s:Body><wsnt:RenewResponse><wsnt:TerminationTime>2022-09-08T13:28:02Z</wsnt:TerminationTime><wsnt:CurrentTime>2022-09-08T13:27:02Z</wsnt:CurrentTime></wsnt:RenewResponse></s:Body></s:Envelope>
2022-09-08 21:27:11.632 [TRACE] [amera.internal.onvif.OnvifConnection] - Sending ONVIF request:PullMessages

==> /var/log/openhab/openhab.log <==
2022-09-08 21:27:16.163 [DEBUG] [amera.internal.servlet.CameraServlet] - GET:/ipcamera.gif, received from 192.168.0.206
2022-09-08 21:27:16.173 [DEBUG] [amera.internal.servlet.CameraServlet] - GET:/ipcamera.gif, received from 192.168.0.206
2022-09-08 21:27:18.125 [TRACE] [amera.internal.onvif.OnvifConnection] - Onvif reply is:<?xml version="1.0" encoding="utf-8" standalone="yes" ?><s:Envelope xmlns:sc="http://www.w3.org/2003/05/soap-encoding" xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:tt="http://www.onvif.org/ver10/schema" xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2" xmlns:tev="http://www.onvif.org/ver10/events/wsdl" xmlns:wsa5="http://www.w3.org/2005/08/addressing" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wstop="http://docs.oasis-open.org/wsn/t-1" xmlns:tns1="http://www.onvif.org/ver10/topics"><s:Header/><s:Body><tev:PullMessagesResponse><tev:CurrentTime>2022-09-08T13:27:08Z</tev:CurrentTime><tev:TerminationTime>2022-09-08T13:28:02Z</tev:TerminationTime></tev:PullMessagesResponse></s:Body></s:Envelope>
2022-09-08 21:27:18.128 [TRACE] [amera.internal.onvif.OnvifConnection] - Sending ONVIF request:Renew
2022-09-08 21:27:18.147 [TRACE] [amera.internal.onvif.OnvifConnection] - Onvif reply is:<?xml version="1.0" encoding="utf-8" standalone="yes" ?><s:Envelope xmlns:sc="http://www.w3.org/2003/05/soap-encoding" xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:tt="http://www.onvif.org/ver10/schema" xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2" xmlns:wsa5="http://www.w3.org/2005/08/addressing" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wstop="http://docs.oasis-open.org/wsn/t-1" xmlns:tns1="http://www.onvif.org/ver10/topics"><s:Header/><s:Body><wsnt:RenewResponse><wsnt:TerminationTime>2022-09-08T13:28:09Z</wsnt:TerminationTime><wsnt:CurrentTime>2022-09-08T13:27:09Z</wsnt:CurrentTime></wsnt:RenewResponse></s:Body></s:Envelope>
2022-09-08 21:27:18.149 [TRACE] [amera.internal.onvif.OnvifConnection] - Sending ONVIF request:PullMessages

==> /var/log/openhab/openhab.log <==
2022-09-08 21:27:24.644 [TRACE] [amera.internal.onvif.OnvifConnection] - Onvif reply is:<?xml version="1.0" encoding="utf-8" standalone="yes" ?><s:Envelope xmlns:sc="http://www.w3.org/2003/05/soap-encoding" xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:tt="http://www.onvif.org/ver10/schema" xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2" xmlns:tev="http://www.onvif.org/ver10/events/wsdl" xmlns:wsa5="http://www.w3.org/2005/08/addressing" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wstop="http://docs.oasis-open.org/wsn/t-1" xmlns:tns1="http://www.onvif.org/ver10/topics"><s:Header/><s:Body><tev:PullMessagesResponse><tev:CurrentTime>2022-09-08T13:27:14Z</tev:CurrentTime><tev:TerminationTime>2022-09-08T13:28:09Z</tev:TerminationTime></tev:PullMessagesResponse></s:Body></s:Envelope>
2022-09-08 21:27:24.648 [TRACE] [amera.internal.onvif.OnvifConnection] - Sending ONVIF request:Renew
2022-09-08 21:27:24.661 [TRACE] [amera.internal.onvif.OnvifConnection] - Onvif reply is:<?xml version="1.0" encoding="utf-8" standalone="yes" ?><s:Envelope xmlns:sc="http://www.w3.org/2003/05/soap-encoding" xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:tt="http://www.onvif.org/ver10/schema" xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2" xmlns:wsa5="http://www.w3.org/2005/08/addressing" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wstop="http://docs.oasis-open.org/wsn/t-1" xmlns:tns1="http://www.onvif.org/ver10/topics"><s:Header/><s:Body><wsnt:RenewResponse><wsnt:TerminationTime>2022-09-08T13:28:15Z</wsnt:TerminationTime><wsnt:CurrentTime>2022-09-08T13:27:15Z</wsnt:CurrentTime></wsnt:RenewResponse></s:Body></s:Envelope>
2022-09-08 21:27:24.664 [TRACE] [amera.internal.onvif.OnvifConnection] - Sending ONVIF request:PullMessages

==> /var/log/openhab/openhab.log <==
2022-09-08 21:27:28.559 [DEBUG] [amera.internal.servlet.CameraServlet] - GET:/ipcamera.gif, received from 192.168.0.206
2022-09-08 21:27:28.559 [DEBUG] [amera.internal.servlet.CameraServlet] - GET:/ipcamera.gif, received from 192.168.0.206

==> /var/log/openhab/openhab.log <==
2022-09-08 21:27:31.167 [TRACE] [amera.internal.onvif.OnvifConnection] - Onvif reply is:<?xml version="1.0" encoding="utf-8" standalone="yes" ?><s:Envelope xmlns:sc="http://www.w3.org/2003/05/soap-encoding" xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:tt="http://www.onvif.org/ver10/schema" xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2" xmlns:tev="http://www.onvif.org/ver10/events/wsdl" xmlns:wsa5="http://www.w3.org/2005/08/addressing" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wstop="http://docs.oasis-open.org/wsn/t-1" xmlns:tns1="http://www.onvif.org/ver10/topics"><s:Header/><s:Body><tev:PullMessagesResponse><tev:CurrentTime>2022-09-08T13:27:21Z</tev:CurrentTime><tev:TerminationTime>2022-09-08T13:28:15Z</tev:TerminationTime></tev:PullMessagesResponse></s:Body></s:Envelope>
2022-09-08 21:27:31.169 [TRACE] [amera.internal.onvif.OnvifConnection] - Sending ONVIF request:Renew
2022-09-08 21:27:31.182 [TRACE] [amera.internal.onvif.OnvifConnection] - Onvif reply is:<?xml version="1.0" encoding="utf-8" standalone="yes" ?><s:Envelope xmlns:sc="http://www.w3.org/2003/05/soap-encoding" xmlns:s="http://www.w3.org/2003/05/soap-envelope" xmlns:tt="http://www.onvif.org/ver10/schema" xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2" xmlns:wsa5="http://www.w3.org/2005/08/addressing" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wstop="http://docs.oasis-open.org/wsn/t-1" xmlns:tns1="http://www.onvif.org/ver10/topics"><s:Header/><s:Body><wsnt:RenewResponse><wsnt:TerminationTime>2022-09-08T13:28:22Z</wsnt:TerminationTime><wsnt:CurrentTime>2022-09-08T13:27:22Z</wsnt:CurrentTime></wsnt:RenewResponse></s:Body></s:Envelope>
2022-09-08 21:27:31.184 [TRACE] [amera.internal.onvif.OnvifConnection] - Sending ONVIF request:PullMessages

==> /var/log/openhab/openhab.log <==
2022-09-08 21:27:40.227 [TRACE] [amera.internal.onvif.OnvifConnection] - Sending ONVIF request:Unsubscribe
2022-09-08 21:27:40.233 [DEBUG] [amera.internal.onvif.OnvifConnection] - Connecting 192.168.0.234 to ONVIF
2022-09-08 21:27:40.235 [TRACE] [amera.internal.onvif.OnvifConnection] - Sending ONVIF request:GetSystemDateAndTime

==> /var/log/openhab/events.log <==
2022-09-08 21:27:40.241 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'ipcamera:onvif:Dahua_Test' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): Connection Timeout: Check your IP and PORT are correct and the camera can be reached.

==> /var/log/openhab/openhab.log <==
2022-09-08 21:27:40.282 [DEBUG] [amera.internal.onvif.OnvifConnection] - Camera is not reachable on ONVIF port:80 or the port may be wrong.
2022-09-08 21:27:42.301 [DEBUG] [amera.internal.onvif.OnvifConnection] - Eventloop is shutdown:true
2022-09-08 21:27:44.240 [DEBUG] [era.internal.handler.IpCameraHandler] - About to connect to the IP Camera using the ONVIF PORT at IP:192.168.0.234:80

==> /var/log/openhab/openhab.log <==
2022-09-08 21:27:50.264 [DEBUG] [amera.internal.onvif.OnvifConnection] - Camera is not reachable on ONVIF port:80 or the port may be wrong.

==> /var/log/openhab/openhab.log <==
2022-09-08 21:27:52.243 [DEBUG] [era.internal.handler.IpCameraHandler] - About to connect to the IP Camera using the ONVIF PORT at IP:192.168.0.234:80

==> /var/log/openhab/openhab.log <==
2022-09-08 21:28:00.245 [DEBUG] [era.internal.handler.IpCameraHandler] - About to connect to the IP Camera using the ONVIF PORT at IP:192.168.0.234:80

==> /var/log/openhab/openhab.log <==
2022-09-08 21:28:08.248 [DEBUG] [era.internal.handler.IpCameraHandler] - About to connect to the IP Camera using the ONVIF PORT at IP:192.168.0.234:80

==> /var/log/openhab/openhab.log <==
2022-09-08 21:28:16.251 [DEBUG] [era.internal.handler.IpCameraHandler] - About to connect to the IP Camera using the ONVIF PORT at IP:192.168.0.234:80

==> /var/log/openhab/openhab.log <==
2022-09-08 21:28:24.252 [DEBUG] [era.internal.handler.IpCameraHandler] - About to connect to the IP Camera using the ONVIF PORT at IP:192.168.0.234:80

==> /var/log/openhab/openhab.log <==
2022-09-08 21:28:32.254 [DEBUG] [era.internal.handler.IpCameraHandler] - About to connect to the IP Camera using the ONVIF PORT at IP:192.168.0.234:80

==> /var/log/openhab/openhab.log <==
2022-09-08 21:28:40.255 [DEBUG] [era.internal.handler.IpCameraHandler] - About to connect to the IP Camera using the ONVIF PORT at IP:192.168.0.234:80
2022-09-08 21:28:48.257 [DEBUG] [era.internal.handler.IpCameraHandler] - About to connect to the IP Camera using the ONVIF PORT at IP:192.168.0.234:80
2022-09-08 21:28:48.268 [TRACE] [era.internal.handler.IpCameraHandler] - Sending camera: GET: http://192.168.0.234:80/cgi-bin/snapshot.cgi?Channel=1

==> /var/log/openhab/events.log <==
2022-09-08 21:28:48.269 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'ipcamera:onvif:Dahua_Test' changed from OFFLINE (COMMUNICATION_ERROR): Connection Timeout: Check your IP and PORT are correct and the camera can be reached. to ONLINE

==> /var/log/openhab/openhab.log <==
2022-09-08 21:28:48.870 [TRACE] [era.internal.handler.IpCameraHandler] - Sending camera: GET: http://192.168.0.234:80/cgi-bin/snapshot.cgi?Channel=1

==> /var/log/openhab/openhab.log <==
2022-09-08 21:29:03.919 [DEBUG] [ipcamera.internal.MyNettyAuthHandler] - Camera at IP:192.168.0.234 gave a reply with a response code of :500

==> /var/log/openhab/openhab.log <==
2022-09-08 21:29:25.517 [DEBUG] [amera.internal.servlet.CameraServlet] - GET:/ipcamera.gif, received from 192.168.0.206
2022-09-08 21:29:25.521 [DEBUG] [amera.internal.servlet.CameraServlet] - GET:/ipcamera.gif, received from 192.168.0.206

2022-09-08 21:29:49.307 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'PZEM_Power' changed from 335 to 305
2022-09-08 21:29:49.309 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'PZEM_Today_Consumption' changed from 7.178 to 7.179
2022-09-08 21:29:49.312 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'PZEM_Power_Factor' changed from 0.92 to 0.94
2022-09-08 21:29:49.314 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'PZEM_Total_Consumption' changed from 278.773 to 278.774
2022-09-08 21:29:49.316 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'PZEM_Current' changed from 1.626 to 1.441
2022-09-08 21:29:49.341 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'This_Month_Power_Cost' changed from 617509.79424 to 617512.53312
2022-09-08 21:29:52.560 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Linh_Lastseen' changed from 2022-09-08T21:29:22.234+0700 to 2022-09-08T21:29:52.554+0700
2022-09-08 21:29:53.105 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'Binh_Lastseen' changed from 2022-09-08T21:29:22.879+0700 to 2022-09-08T21:29:53.098+0700
^C

With Dahua thing: The same situation as Onvif, when camera lost connection (at 2022-09-08 21:19:21) binding re-connected (2022-09-08 21:21:01) and camera can trigger alarm and recording as normal.

==> /var/log/openhab/openhab.log <==
:
2022-09-08 21:18:18.991 [DEBUG] [hab.binding.ipcamera.internal.Ffmpeg] - Guessed Channel Layout for Input Stream #0.1 : mono
2022-09-08 21:18:19.232 [DEBUG] [hab.binding.ipcamera.internal.Ffmpeg] - [swscaler @ 0x268d2e0] deprecated pixel format used, make sure you did set range correctly
2022-09-08 21:18:21.691 [TRACE] [era.internal.handler.IpCameraHandler] - HTTP Result back from camera is        :--myboundary
Content-Type: text/plain
Content-Length:41

Code=VideoMotionInfo;action=State;index=0

:
2022-09-08 21:18:22.741 [TRACE] [era.internal.handler.IpCameraHandler] - HTTP Result back from camera is        :--myboundary
Content-Type: text/plain
Content-Length:41

Code=VideoMotionInfo;action=State;index=0

:
2022-09-08 21:18:26.311 [TRACE] [era.internal.handler.IpCameraHandler] - HTTP Result back from camera is        :--myboundary
Content-Type: text/plain
Content-Length:41

Code=VideoMotionInfo;action=State;index=0

:
2022-09-08 21:18:26.521 [TRACE] [era.internal.handler.IpCameraHandler] - HTTP Result back from camera is        :--myboundary
Content-Type: text/plain
Content-Length:41

Code=VideoMotionInfo;action=State;index=0

:
2022-09-08 21:18:26.941 [TRACE] [era.internal.handler.IpCameraHandler] - HTTP Result back from camera is        :--myboundary
Content-Type: text/plain
Content-Length:41

Code=VideoMotionInfo;action=State;index=0

:
2022-09-08 21:18:28.202 [TRACE] [era.internal.handler.IpCameraHandler] - HTTP Result back from camera is        :--myboundary
Content-Type: text/plain
Content-Length:41

Code=VideoMotionInfo;action=State;index=0

:

==> /var/log/openhab/openhab.log <==
2022-09-08 21:18:31.561 [TRACE] [era.internal.handler.IpCameraHandler] - HTTP Result back from camera is        :--myboundary
Content-Type: text/plain
Content-Length:41

Code=VideoMotionInfo;action=State;index=0

:
2022-09-08 21:18:31.980 [TRACE] [era.internal.handler.IpCameraHandler] - HTTP Result back from camera is        :--myboundary
Content-Type: text/plain
Content-Length:41

Code=VideoMotionInfo;action=State;index=0

:
2022-09-08 21:18:33.451 [TRACE] [era.internal.handler.IpCameraHandler] - HTTP Result back from camera is        :--myboundary
Content-Type: text/plain
Content-Length:41

Code=VideoMotionInfo;action=State;index=0

:
2022-09-08 21:18:37.634 [TRACE] [era.internal.handler.IpCameraHandler] - HTTP Result back from camera is        :--myboundary
Content-Type: text/plain
Content-Length:95

Code=VideoMotion;action=Stop;index=0;data={
   "Id" : [ 0 ],
   "RegionName" : [ "Region1" ]
}


:

==> /var/log/openhab/events.log <==
2022-09-08 21:18:37.639 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'DahuaMotionAlarm' changed from ON to OFF

==> /var/log/openhab/openhab.log <==
2022-09-08 21:18:47.724 [TRACE] [era.internal.handler.IpCameraHandler] - HTTP Result back from camera is        :--myboundary
Content-Type: text/plain
Content-Length:148

Code=RtspSessionDisconnect;action=Start;index=0;data={
   "Device" : "192.168.0.206",
   "StreamType" : "Main",
   "UserAgent" : " Lavf58.20.100"
}


:


==> /var/log/openhab/openhab.log <==
2022-09-08 21:19:03.228 [DEBUG] [amera.internal.servlet.CameraServlet] - GET:/ipcamera.gif, received from 192.168.0.206
2022-09-08 21:19:03.233 [DEBUG] [amera.internal.servlet.CameraServlet] - GET:/ipcamera.gif, received from 192.168.0.206

==> /var/log/openhab/openhab.log <==
2022-09-08 21:19:21.030 [DEBUG] [amera.internal.onvif.OnvifConnection] - Connecting 192.168.0.234 to ONVIF

==> /var/log/openhab/events.log <==
2022-09-08 21:19:21.031 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'ipcamera:dahua:Dahua_Test' changed from ONLINE to OFFLINE (COMMUNICATION_ERROR): Connection Timeout: Check your IP and PORT are correct and the camera can be reached.

==> /var/log/openhab/openhab.log <==
2022-09-08 21:19:21.032 [TRACE] [amera.internal.onvif.OnvifConnection] - Sending ONVIF request:GetSystemDateAndTime
2022-09-08 21:19:21.036 [INFO ] [era.internal.handler.IpCameraHandler] - The alarm stream was not running for camera 192.168.0.234, re-starting it now
2022-09-08 21:19:21.101 [DEBUG] [amera.internal.onvif.OnvifConnection] - Eventloop is shutdown:true
2022-09-08 21:19:25.036 [DEBUG] [era.internal.handler.IpCameraHandler] - About to connect to the IP Camera using the ONVIF PORT at IP:192.168.0.234:80

==> /var/log/openhab/openhab.log <==
2022-09-08 21:19:31.059 [DEBUG] [amera.internal.onvif.OnvifConnection] - Camera is not reachable on ONVIF port:80 or the port may be wrong.
2022-09-08 21:19:33.038 [DEBUG] [era.internal.handler.IpCameraHandler] - About to connect to the IP Camera using the ONVIF PORT at IP:192.168.0.234:80

==> /var/log/openhab/openhab.log <==
2022-09-08 21:19:41.039 [DEBUG] [era.internal.handler.IpCameraHandler] - About to connect to the IP Camera using the ONVIF PORT at IP:192.168.0.234:80

==> /var/log/openhab/openhab.log <==
2022-09-08 21:19:49.041 [DEBUG] [era.internal.handler.IpCameraHandler] - About to connect to the IP Camera using the ONVIF PORT at IP:192.168.0.234:80

==> /var/log/openhab/openhab.log <==
2022-09-08 21:19:57.043 [DEBUG] [era.internal.handler.IpCameraHandler] - About to connect to the IP Camera using the ONVIF PORT at IP:192.168.0.234:80

==> /var/log/openhab/openhab.log <==
2022-09-08 21:20:05.045 [DEBUG] [era.internal.handler.IpCameraHandler] - About to connect to the IP Camera using the ONVIF PORT at IP:192.168.0.234:80

==> /var/log/openhab/openhab.log <==
2022-09-08 21:20:13.047 [DEBUG] [era.internal.handler.IpCameraHandler] - About to connect to the IP Camera using the ONVIF PORT at IP:192.168.0.234:80

==> /var/log/openhab/openhab.log <==
2022-09-08 21:20:21.049 [DEBUG] [era.internal.handler.IpCameraHandler] - About to connect to the IP Camera using the ONVIF PORT at IP:192.168.0.234:80
2022-09-08 21:20:29.051 [DEBUG] [era.internal.handler.IpCameraHandler] - About to connect to the IP Camera using the ONVIF PORT at IP:192.168.0.234:80

==> /var/log/openhab/openhab.log <==
2022-09-08 21:20:37.053 [DEBUG] [era.internal.handler.IpCameraHandler] - About to connect to the IP Camera using the ONVIF PORT at IP:192.168.0.234:80

==> /var/log/openhab/openhab.log <==
2022-09-08 21:20:45.055 [DEBUG] [era.internal.handler.IpCameraHandler] - About to connect to the IP Camera using the ONVIF PORT at IP:192.168.0.234:80

==> /var/log/openhab/openhab.log <==
2022-09-08 21:20:53.057 [DEBUG] [era.internal.handler.IpCameraHandler] - About to connect to the IP Camera using the ONVIF PORT at IP:192.168.0.234:80

==> /var/log/openhab/openhab.log <==
2022-09-08 21:21:01.059 [DEBUG] [era.internal.handler.IpCameraHandler] - About to connect to the IP Camera using the ONVIF PORT at IP:192.168.0.234:80
2022-09-08 21:21:01.069 [TRACE] [era.internal.handler.IpCameraHandler] - Sending camera: GET: http://192.168.0.234:80/cgi-bin/snapshot.cgi?Channel=1

==> /var/log/openhab/events.log <==
2022-09-08 21:21:01.070 [INFO ] [ab.event.ThingStatusInfoChangedEvent] - Thing 'ipcamera:dahua:Dahua_Test' changed from OFFLINE (COMMUNICATION_ERROR): Connection Timeout: Check your IP and PORT are correct and the camera can be reached. to ONLINE

==> /var/log/openhab/openhab.log <==
2022-09-08 21:21:01.166 [TRACE] [era.internal.handler.IpCameraHandler] - Sending camera: GET: http://192.168.0.234:80/cgi-bin/snapshot.cgi?Channel=1
2022-09-08 21:21:02.075 [INFO ] [era.internal.handler.IpCameraHandler] - The alarm stream was not running for camera 192.168.0.234, re-starting it now
2022-09-08 21:21:02.083 [TRACE] [era.internal.handler.IpCameraHandler] - Sending camera: GET: http://192.168.0.234:80/cgi-bin/eventManager.cgi?action=attach&codes=[All]
2022-09-08 21:21:02.126 [TRACE] [era.internal.handler.IpCameraHandler] - Sending camera: GET: http://192.168.0.234:80/cgi-bin/eventManager.cgi?action=attach&codes=[All]
2022-09-08 21:21:06.476 [TRACE] [era.internal.handler.IpCameraHandler] - HTTP Result back from camera is        :--myboundary
Content-Type: text/plain
Content-Length:69

Code=SystemState;action=Pulse;index=0;data={
   "State" : "Active"
}


:
2022-09-08 21:21:06.480 [DEBUG] [era.internal.handler.IpCameraHandler] - Unrecognised Dahua event, Code=SystemState, action=Pulse

==> /var/log/openhab/openhab.log <==
2022-09-08 21:21:15.004 [TRACE] [era.internal.handler.IpCameraHandler] - HTTP Result back from camera is        :--myboundary
Content-Type: text/plain
Content-Length:41

Code=VideoMotionInfo;action=State;index=0

:
2022-09-08 21:21:15.098 [TRACE] [era.internal.handler.IpCameraHandler] - HTTP Result back from camera is        :--myboundary
Content-Type: text/plain
Content-Length:96

Code=VideoMotion;action=Start;index=0;data={
   "Id" : [ 0 ],
   "RegionName" : [ "Region1" ]
}


:

==> /var/log/openhab/events.log <==
2022-09-08 21:21:15.102 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'DahuaMotionAlarm' changed from OFF to ON

==> /var/log/openhab/openhab.log <==
2022-09-08 21:21:15.109 [DEBUG] [ng.ipcamera.internal.IpCameraActions] - Recording ipcamera.gif for 5 seconds.
2022-09-08 21:21:15.111 [DEBUG] [hab.binding.ipcamera.internal.Ffmpeg] - Starting ffmpeg with this command now:-y -t 5 -hide_banner -loglevel warning -rtsp_transport tcp -i rtsp://admin:********@192.168.0.234:554/cam/realmonitor?channel=1&amp;subtype=0&amp;unicast=true&amp;proto=Onvif -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 /var/lib/openhab/ipcamera/Dahua_Test/ipcamera.gif

==> /var/log/openhab/events.log <==
2022-09-08 21:21:15.115 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'DahuaRecordingGif' changed from 0 to 5

==> /var/log/openhab/openhab.log <==
2022-09-08 21:21:16.351 [DEBUG] [ipcamera.internal.MyNettyAuthHandler] - Camera at IP:192.168.0.234 gave a reply with a response code of :500
2022-09-08 21:21:16.418 [TRACE] [era.internal.handler.IpCameraHandler] - HTTP Result back from camera is        :--myboundary
Content-Type: text/plain
Content-Length:41

Code=VideoMotionInfo;action=State;index=0

:

==> /var/log/openhab/openhab.log <==
2022-09-08 21:21:17.528 [DEBUG] [hab.binding.ipcamera.internal.Ffmpeg] - Guessed Channel Layout for Input Stream #0.1 : mono
2022-09-08 21:21:17.774 [DEBUG] [hab.binding.ipcamera.internal.Ffmpeg] - [swscaler @ 0x120c4a0] deprecated pixel format used, make sure you did set range correctly

==> /var/log/openhab/openhab.log <==
2022-09-08 21:21:21.188 [TRACE] [era.internal.handler.IpCameraHandler] - HTTP Result back from camera is        :--myboundary
Content-Type: text/plain
Content-Length:95

Code=VideoMotion;action=Stop;index=0;data={
   "Id" : [ 0 ],
   "RegionName" : [ "Region1" ]
}


:

==> /var/log/openhab/events.log <==
2022-09-08 21:21:21.194 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'DahuaMotionAlarm' changed from ON to OFF

==> /var/log/openhab/openhab.log <==
2022-09-08 21:21:33.105 [DEBUG] [amera.internal.servlet.CameraServlet] - GET:/ipcamera.gif, received from 192.168.0.206
2022-09-08 21:21:33.107 [DEBUG] [amera.internal.servlet.CameraServlet] - GET:/ipcamera.gif, received from 192.168.0.206

==> /var/log/openhab/openhab.log <==
2022-09-08 21:21:39.404 [TRACE] [era.internal.handler.IpCameraHandler] - HTTP Result back from camera is        :--myboundary
Content-Type: text/plain
Content-Length:75

Code=InterVideoAccess;action=Pulse;index=0;data={
   "Type" : "WebLogin"
}


:
2022-09-08 21:21:39.405 [DEBUG] [era.internal.handler.IpCameraHandler] - Unrecognised Dahua event, Code=InterVideoAccess, action=Pulse
2022-09-08 21:21:44.106 [TRACE] [era.internal.handler.IpCameraHandler] - HTTP Result back from camera is        :--myboundary
Content-Type: text/plain
Content-Length:148

Code=RtspSessionDisconnect;action=Start;index=0;data={
   "Device" : "192.168.0.206",
   "StreamType" : "Main",
   "UserAgent" : " Lavf58.20.100"
}


:
2022-09-08 21:21:44.587 [DEBUG] [amera.internal.servlet.CameraServlet] - GET:/ipcamera.gif, received from 192.168.0.206
2022-09-08 21:21:44.590 [DEBUG] [amera.internal.servlet.CameraServlet] - GET:/ipcamera.gif, received from 192.168.0.206

==> /var/log/openhab/events.log <==
2022-09-08 21:21:44.881 [INFO ] [openhab.event.ItemStateChangedEvent ] - Item 'DahuaRecordingGif' changed from 5 to 0
^C

So the issue seems to happen only with Onvif thing, not with Dahua thing? Or am I missing some Onvif configuration? Thank you for your patience :smiley:

I think this will be the reason your logs mention a http error 500 and it causes the camera to stop responding for 30seconds when this occurs. You should get better results after doing the work around.

No problem, thank you for taking the time to test and report the results.

1 Like

I have made a PR for this binding with a number of major bug fixes for ONVIF cameras. Anyone using ONVIF events for their alarms should upgrade to the JAR link inside the PR to help test, as should anyone using PTZ features. If you’re using API based cameras without PTZ, then you probably won’t notice any difference, but it’s good to have people test nothing got broken. The risk of that is very very low as I have been testing the changes on my production system for over a week now and its far better. Installing the telstick binding fixes any Netty dependency issues.

[ipcamera] Fix ONVIF fails to reconnect by Skinah · Pull Request #13396 · openhab/openhab-addons (github.com)

@downloadme4free
I made a change that should auto use ffmpeg for your cameras snapshots that is ONVIF and missing the snapshot url. I also made a change so it should use this to detect if the camera is online/offline/rebooting, however during my tests, it appears ffmpeg does not exit and seems to hang when the camera reboots. To be clear this happens when running ffmpeg on the command line via the termina,l as well as in the binding, so it is not a binding bug but not the way I want it to work long term. Originally I did test this a year or more back and it did work when the network cable was pulled out of the camera, so my guess is that my ffmpeg version 4.1.9 has a bug that is freezing and changing ffmpeg versions may fix this (?). EDIT: I tested the same camera with pulling out the network cable and had the same result of ffmpeg locking up so most likely older versions worked.

@John_Siemon this should work for your camera. This ffmpeg freezing even via the command line will cause issues when I look at doing auto restarts for the ffmpeg alarms.

Can you run a test to see if it exits when you trigger a reboot? This can be done with the hikvision batch configuration program.

Command to use.
ffmpeg -rtsp_transport tcp -i rtsp://admin:password@192.168.1.4:554/Streaming/Channels/1 -update 1 http://127.0.0.1:8080/foo/bar.jpg

Does it exit back to the terminal when the camera reboots or does the output hang and stop updating forever? CTRL + C will close it if that happens. Note the version of ffmpeg you use so I can compare.

Thanks.

2 Likes

@matt1 I downloaded and installed the latest binding from Git, and updated to the latest HikVision Batch Config Tool, but from that point I’m a bit lost. Are u just wanting to use the HikVision Tool to execute the Reboot or to run your commands? I’m thinking the commands are run from the OH console (I’m using OH Docker). I put your commands in a script but I’m unclear on a few things and I get some errors when I run the script so I need some guidance here. First the is rtsp ip address is the OH docker address or the camera ip address? Secondly, http ip address is what, OH docker or camera? Finally the path to /foo/bar.jpg is what?

When I try to run the commands from the console one of the errors I get is “Missing argument for option ‘i’.”

Thanks for your help.

UPDATE:: Ok I’m a bit dense, but I figured out that 3 lines you list as a command are in fact a single line command, the rtsp ip is the camera, and you were referencing Batch Config Tool only to reboot the camera. The command ran and showed output as “frame= 194 fps= 15 q=24.8 size=N/A time=00:00:12.93 bitrate=N/A dup=6 drop=4 speed=1.01x” etc so I figure it is working as expected. When I reboot using Batch Config Tool, the console freezes and DOES NOT restart when the camera is back online in OH. I have to use CTL-C to exit.

That’s confirming my tests. Which ffmpeg version are you using? It gets listed when you run that command. How easy is it for you to test different ffmpeg versions to see if an older version exits cleanly or if a version 5.x branch works without locking up?

This will determine if I need to use more CPU power to watch the ffmpeg output to detect if it stops changing and then force kill the process. If it is only a bug that will get fixed in ffmpeg then it’s less CPU load to not have to do that.

Keen to do the coding to auto restart the ffmpeg alarms if someone can do the tests of older and newer ffmpeg versions and look to see if this is a reported bug on the ffmpeg github page.

I’m currently running ffmpeg version 4.3.4-0+deb11u1. Not sure how easy it would be for me swap out different versions of ffmpeg. I’m running OH in a docker on an Unraid server that is based on Slackware. I’m fairly certain that given time I could do the swap, but the bigger issue for me is time. Starting shortly I will be out of pocket until mid November and not have access to the server for testing.

I was hoping since you use docker, it would be simple to swap out the version for testing, if not then don’t worry about it. I have been doing some thinking about this and feel that the increase in load will not be much, only would happen if the ffmpeg alarm or snapshot creation is running, and would be handy to have in case the thread crashes for other reasons besides the camera rebooting/reconnecting. I want to get this sorted, since I have read the code recently and its all fresh in my head, so getting it done now makes sense and not waiting to see if the problem goes away with a newer ffmpeg version.

EDIT:
@John_Siemon and @downloadme4free
If you’re willing to test an Alpha build of the binding, I made some changes you were both wanting made.

  • FFmpeg snapshots will now auto restart and also take the camera offline if the stream locks up from a camera rebooting. I have tested and it seems to work here the 1 time I tried it.
  • FFmpeg motion alarm should auto restart if the camera reboots, ffmpeg crashes, or goes offline. I have not tested this yet as its late and want to read the github issue on this topic before completing and doing the testing in the next few days.

Feel free to give it a go.

Index of /openhab/IpCameraBinding/ (pcmus.com)

1 Like

I’ve tested the latest binding version at Index of /openhab/IpCameraBinding/ and attached the log here (it’s too big to fit in a post)

I did following actions to test with my Imou Ranger 2:

  • 2022-09-20 22:23:24: Disable the binding
  • 2022-09-20 22:23:28: Re-enable the binding. Camera is successfully connected and starts recording when triggering an alarm at 2022-09-20 22:23:46.
  • 2022-09-20 22:24:37: Unplug then re-plug the camera power, binding is trying to connect but gets some errors “Camera is not reachable on ONVIF port:80 or the port may be wrong.”
  • 2022-09-20 22:25:17: Finally camera is going online again but since then binding cannot receive any alarm from the camera. The issue stays the same.

ipcamera_binding_log.txt (141.9 KB)

@downloadme4free I have looked at the logs and noticed 2 things:

  1. 2022-09-20 22:25:19.183 [DEBUG] [g.ipcamera.internal.onvif.OnvifCodec] - Exception on ONVIF connection: Connection reset by peer
    This means that the camera was responsible for closing the connection and not replying to the request.

  2. The cameras time and date is very wrong, the ONVIF specs actually state that they must be within a short space of time otherwise the spec is that the traffic may be a hacker replaying old captured packets. For security ONVIF should not work with them so far out of sync. Note that they are close in time when it was working, but not close when it failed. Perhaps the camera does not backup the time with a battery and it uses an external server to correct the time with.

When it was working...
2022-09-20 22:23:28.998 [DEBUG] [amera.internal.onvif.OnvifConnection] - Cameras  UTC dateTime is:2022-9-20T15:23:28
2022-09-20 22:23:29.006 [DEBUG] [amera.internal.onvif.OnvifConnection] - Openhabs UTC dateTime is:2022-09-20T15:23:29.003Z

When it failed to start the alarm subscription....
2022-09-20 22:25:17.992 [DEBUG] [amera.internal.onvif.OnvifConnection] - Cameras  UTC dateTime is:2000-1-1T0:0:15
2022-09-20 22:25:18.000 [DEBUG] [amera.internal.onvif.OnvifConnection] - Openhabs UTC dateTime is:2022-09-20T15:25:17.999Z

I would not be surprised if the alarm subscription is failing as you need to renew and subscribe based on times.

@John_Siemon
Can you try the jar that is at this PR for making ffmpeg restart automatically? [ipcamera] FFmpeg based alarms will now auto restart if stopped by Skinah · Pull Request #13446 · openhab/openhab-addons · GitHub
It is testing to work here so you may be able to disable any rules that were used as a work around now.