I think it would be nice to have integrated controls for PTZ and motion alarms in the camera platform.
It could be done in the same way as the media player platform where each component sets it’s own capabilities and the UI updates accordingly.
It would make configuration of automation’s a lot easier.
The examples in the docs for foscam is not accurate. It’s a bit more complicated to set up motion detection alarms.
You need to supply the whole config for the motion-detection alarms, schemas, areas to trigger and other settings in the same curl call, otherwise all settings would be cleared when you toggle the switch. Its not that simple for a novice user to figure out.
There is also a lot of nice python library’s for controlling Foscam cameras, if we just have the infrastructure for it, it would be a small task to implement! The same probably goes for other cameras as well.
I’ve been trying to control the preset position of my amcrest cams for a few days using other commands with no sucess and have just come across this post.
Are you running hassbian? I am trying to figure out how to make it work using a AIO setup. This is what I have tried as a shell command so far but it isn’t working.
amcrest_test1: /srv/homeassistant/homeassistant_venv/bin/amcrest-cli --camera black --ptz-goto-preset 0 1
is where the virtual environment is located in the AIO set up and black is the name of my camera.
Any ideas?
Edit: black is what its named via amcrest, cam_black is how its refered to in home assistant
@tchellomello Do you have the necessary skills to being able to implement this in HA? I’m a very new member of the community, and I’m just starting on Pything/polymer etc, it’s a real mess right now.
I would gladly make a small donation if you or somebody else could make the PTZ waypoints available in the frontend and make us able to enable/disable the motion detection.
I’m also willing to help with testing, if you need to.
I’m using the Hass.io installer btw.
It’s just that we are so close on getting the PTZ controls in HA. We have the connections, the components etc, but we have been missing the PTZ control from since when I joined.
I have implemented something similar with custom ui elements. Its working pretty ok for now but there are many hard coded strings etc. For now, there are simply four buttons which activate a service on the server side (using manual switches atm, but this service could get integrated into e.g. the camera platform in some fashion [e.g., enable_motion_detection and disable_motion_detection are already there]).
Generally speaking, does anybody know what the current status regarding this is? This is the only thread I have found so far, maybe this has been discussed elsewhere.
There are also other things that have to be considered, e.g.:
there are many different ways to control ptz: (e.g. SOAP requests for onvif, general http requests, custom python library)
as far as I can estimate this, the service could be residing in many different locations and be referenced by the config? (e.g. in the onvif platform for onvif ptz cameras)
So far this is working for me great (as a custom ui element) but would love to help creating an general approach.
I will try something like this, thanks for sharing.
Just to confirm, is the image updated in real time? I mean, when I hit the icon to move the camera, the image keeps still until I click to view the stream, right?
You’ll need two web browser for doing that. When you trigger the PTZ it will make the camera rotate but the camera card is a picture card with low refresh rate so it will take time. If you access the stream by clicking on the picture on another page it will update in real time or close to it.