fjramirez1987 / PTZ-YCC365

50 stars 20 forks source link

Stop not working on my cam (with fix) #11

Open dbuezas opened 2 years ago

dbuezas commented 2 years ago

The stop action has no effect

I replaced the xml with a velocity zero movement and that did the trick

    def stop(call):
        host = call.data.get(ATTR_HOST, DEFAULT_HOST)
        profile = call.data.get(ATTR_PROFILE, DEFAULT_PROFILE)

        xml = """<?xml version="1.0" encoding="utf-8"?>
        <soap:Envelope xmlns:soap="http://www.w3.org/2003/05/soap-envelope"
         xmlns:tptz="http://www.onvif.org/ver20/ptz/wsdl"
         xmlns:tt="http://www.onvif.org/ver10/schema">
         <soap:Body>
         <tptz:ContinuousMove>
         <tptz:ProfileToken>Profile_1</tptz:ProfileToken>
         <tptz:Velocity>
         <tt:PanTilt x="0" y="0"/>
         <tt:Zoom x="0"/>
         </tptz:Velocity>
         </tptz:ContinuousMove>
         </soap:Body>
        </soap:Envelope>"""

My camera is a Hiseeu WHD313

Thank you a lot for this component btw, I was about to buy a different camera! ❤️

BTW, inspired by this component, I did a bit of digging and found out that (at least in my camera) the problem is that the device reports having a different IP than my network (cam reports 192.168.0.10). I made a simple proxy that replaces all occurrences of that ip with the actual camera IP and home assistant does pick it up. This may be a hint with what's wrong with these cams

eerison commented 1 year ago

Hey @dbuezas did you did the request to http://your_cam/onvif/PTZ, how did you pass the authentication?

could you share a curl? atm I'm getting Not found, I guess it's other url for me :(

dbuezas commented 1 year ago

I didn't have to do anything special. If the camera works with ICSee or XMEye, you can use https://github.com/dbuezas/icsee-ptz instead