fwestenberg / reolink_dev

Home Assistant Reolink addon
MIT License
550 stars 102 forks source link

Push debugging, please advice #310

Open Redferne opened 2 years ago

Redferne commented 2 years ago

homeassistant==2021.10.4 reolink==0.0.29 reolink_dev==0.26

Camera RLC-511 Firmware v3.0.0.142_20121803

homeassistant:
  internal_url: "http://192.168.0.38:80"

I see the Subscription sent to the camera:

2021-10-12 23:28:28 DEBUG (MainThread) [reolink.subscription_manager] Reolink host frontdoorcam.lan (Subscription) request data: 
    <soap:Envelope xmlns:add="http://www.w3.org/2005/08/addressing" xmlns:b="http://docs.oasis-open.org/wsn/b-2" xmlns:soap="http://www.w3.org/2003/05/soap-envelope">
    <soap:Header><wsse:Security soap:mustUnderstand="true" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" 
    xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
    <wsse:UsernameToken wsu:Id="UsernameToken-b7a95dbd-3e44-4c4c-8b60-54545d087a95">
    <wsse:Username>admin</wsse:Username>
    <wsse:Password Type="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-username-token-profile-1.0#PasswordDigest">m1C90PmYRM9v7wtTfmHiWiT8igg=</wsse:Password>
    <wsse:Nonce EncodingType="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-soap-message-security-1.0#Base64Binary">JD6ffpV2TrywA6Y9G7hf/g==</wsse:Nonce>
    <wsu:Created>2021-10-12T21:28:28.000Z</wsu:Created>
    </wsse:UsernameToken>
    </wsse:Security>
    </soap:Header>
    <soap:Body>
        <b:Subscribe>
            <b:ConsumerReference>
                <add:Address>http://192.168.0.38/api/webhook/1ab1587416ee3ed8087b51e578184bc838ddc397e82e7d657a191ce6e6615feb</add:Address>
            </b:ConsumerReference>
            <b:InitialTerminationTime>PT15M</b:InitialTerminationTime>
        </b:Subscribe>
    </soap:Body>
    </soap:Envelope>

2021-10-12 23:28:28 DEBUG (MainThread) [reolink.camera_api] send() HTTP Request params ={'token': 'f18e347470a6b8e'}
2021-10-12 23:28:28 DEBUG (MainThread) [reolink.camera_api] send() HTTP Request body =[{'cmd': 'GetAiState', 'action': 0, 'param': {'channel': 0}}]
2021-10-12 23:28:28 DEBUG (MainThread) [reolink.camera_api] send() HTTP Response status=200 content-type=(text/html)
2021-10-12 23:28:28 DEBUG (MainThread) [reolink.camera_api.data] send() HTTP Response data: [
   {
      "cmd" : "Unknown",
      "code" : 1,
      "error" : {
         "detail" : "not support",
         "rspCode" : -9
      }
   }
]

And the response here:

2021-10-12 23:28:29 DEBUG (MainThread) [reolink.subscription_manager] Reolink host frontdoorcam.lan (Subscription) got response status: 200. Payload:
<?xml version="1.0" encoding="UTF-8"?>
<SOAP-ENV:Envelope xmlns:SOAP-ENV="http://www.w3.org/2003/05/soap-envelope" xmlns:SOAP-ENC="http://www.w3.org/2003/05/soap-encoding"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xmlns:xsd="http://www.w3.org/2001/XMLSchema"
 xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing"
 xmlns:wsdd="http://schemas.xmlsoap.org/ws/2005/04/discovery"
 xmlns:wsa5="http://www.w3.org/2005/08/addressing"
 xmlns:xmime="http://tempuri.org/xmime.xsd"
 xmlns:xmime5="http://www.w3.org/2005/05/xmlmime"
 xmlns:xop="http://www.w3.org/2004/08/xop/include"
 xmlns:wsrfbf="http://docs.oasis-open.org/wsrf/bf-2"
 xmlns:tt="http://www.onvif.org/ver10/schema"
 xmlns:wstop="http://docs.oasis-open.org/wsn/t-1"
 xmlns:wsrfr="http://docs.oasis-open.org/wsrf/r-2"
 xmlns:ns1="http://www.onvif.org/ver10/actionengine/wsdl"
 xmlns:tev="http://www.onvif.org/ver10/events/wsdl"
 xmlns:ns10="http://www.onvif.org/ver10/events/wsdl/PullPointBinding
 xmlns:ns11="http://www.onvif.org/ver10/events/wsdl/CreatePullPointBinding"
 xmlns:ns12="http://www.onvif.org/ver10/events/wsdl/PausableSubscriptionManagerBinding"
 xmlns:ns13="http://www.onvif.org/ver10/network/wsdl/RemoteDiscoveryBinding"
 xmlns:ns14="http://www.onvif.org/ver10/network/wsdl/DiscoveryLookupBinding"
 xmlns:tdn="http://www.onvif.org/ver10/network/wsdl"
 xmlns:ns3="http://www.onvif.org/ver20/analytics/wsdl/RuleEngineBinding"
 xmlns:ns4="http://www.onvif.org/ver20/analytics/wsdl/AnalyticsEngineBinding"
 xmlns:tan="http://www.onvif.org/ver20/analytics/wsdl"
 xmlns:ns5="http://www.onvif.org/ver10/events/wsdl/PullPointSubscriptionBinding"
 xmlns:ns6="http://www.onvif.org/ver10/events/wsdl/EventBinding"
 xmlns:ns7="http://www.onvif.org/ver10/events/wsdl/SubscriptionManagerBinding"
 xmlns:ns8="http://www.onvif.org/ver10/events/wsdl/NotificationProducerBinding"
 xmlns:wsnt="http://docs.oasis-open.org/wsn/b-2"
 xmlns:ns9="http://www.onvif.org/ver10/events/wsdl/NotificationConsumerBinding"
 xmlns:tad="http://www.onvif.org/ver10/analyticsdevice/wsdl"
 xmlns:tds="http://www.onvif.org/ver10/device/wsdl"
 xmlns:timg="http://www.onvif.org/ver20/imaging/wsdl"
 xmlns:tls="http://www.onvif.org/ver10/display/wsdl"
 xmlns:tmd="http://www.onvif.org/ver10/deviceIO/wsdl"
 xmlns:tptz="http://www.onvif.org/ver20/ptz/wsdl"
 xmlns:trc="http://www.onvif.org/ver10/recording/wsdl"
 xmlns:trp="http://www.onvif.org/ver10/replay/wsdl"
 xmlns:trt="http://www.onvif.org/ver10/media/wsdl"
 xmlns:trv="http://www.onvif.org/ver10/receiver/wsdl"
 xmlns:tse="http://www.onvif.org/ver10/search/wsdl"
 xmlns:ter="http://www.onvif.org/ver10/error"
 xmlns:tns1="http://www.onvif.org/ver10/topics"
 xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd"
 xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
<SOAP-ENV:Header>
</SOAP-ENV:Header>
<SOAP-ENV:Body>
<wsnt:SubscribeResponse>
<wsnt:SubscriptionReference>
<wsa5:Address>http://192.168.0.48:8000/onvif/Notification?Idx=00_1</wsa5:Address>
</wsnt:SubscriptionReference>
<wsnt:CurrentTime>2021-10-12T21:28:30Z
</wsnt:CurrentTime>
<wsnt:TerminationTime>2021-10-12T21:43:30Z
</wsnt:TerminationTime>
</wsnt:SubscribeResponse>
</SOAP-ENV:Body>
</SOAP-ENV:Envelope>

2021-10-12 23:28:30 DEBUG (MainThread) [reolink.subscription_manager] Local time: 2021-10-12 21:28, camera time: 2021-10-12 21:28 (difference: 1.6957030296325684), termination time: 2021-10-12 21:43
2021-10-12 23:28:30 INFO (MainThread) [custom_components.reolink_dev.base] Host frontdoorcam.lan subscribed successfully to webhook http://192.168.0.38/api/webhook/1ab1587416ee3ed8087b51e578184bc838ddc397e82e7d657a191ce6e6615feb
2021-10-12 23:28:30 DEBUG (MainThread) [reolink.subscription_manager] Host frontdoorcam.lan should renew in: 898 seconds...

Not sure the response address is correct? Anyways. Nothing is ever posted on that webhook from the camera. Motion is enabled and Push is enabled.

image

cpainchaud commented 2 years ago

It looks fine but I can't tell what is wrong on your camera or your network, if the camera was hitting the webhook then you would get a few logs bare minimum.

Redferne commented 2 years ago

Motion Push notifications works in the Reolink Android App though, not sure if it's using the same SOAP API. Nothing is wrong with my network as other devices are POSTing webhooks just fine to Home Assistant.

cpainchaud commented 2 years ago

Android app is using nothing accessible to us. All I can tell from your logs you shared is that your camera is not sending message through the hook (unless you did not post all logs, which may be showing the camera has actually tried)