bartbutenaers / node-red-contrib-onvif-nodes

Node Red nodes for communicating with OnVif compliant IP devices
Apache License 2.0
65 stars 25 forks source link

Onvif PTZ speed #7

Open tesco222 opened 4 years ago

tesco222 commented 4 years ago

Good afternoon,

I am LOVING your work on the nodered integration of PTZ cameras. I have my Wanscam k54 now moving around as I command it! I would like to slow its movement though or change the amount it moves when I click "left". your excellent guide mentioned "An extra Time option can be specified, which is the time interval (in seconds) that the movement will be applied. For example a tilt value of -0.5 with time 2, means that the device will move down at half speed during 2 seconds." But I cannot see how I can input a time?

bartbutenaers commented 4 years ago

Hi @tesco222,

Thanks for your feedback! It is much too long ago that I worked on this node, but will announce a new beta version on the Node-RED forum very soon...

I had to look in my code to see how it works, and indeed seems I have forgotten to document it. You should be able to set the 3 speed factors in the input message of the PTZ node:

Each factor is allowed to have a numeric value between -1.0 and +1.0

Would you be so kind to test whether those parameters still work? And would be nice if you could share your example flow, so I can update the readme page.

Thanks !!! Bart

tesco222 commented 4 years ago

Hi Bart,

Thanks for coming back to me. Changing the numbers doesn't seem to affect the amount or speed or movement. I have tried at 0.1 and 1 and even 0.0001 but the camera still rotates the same number of degrees and at the same speed. Wonder if it is hard coded to the camera somewhere as if i swipe on my ios camera app to move it is moves the same amount too.

my code is below

[{"id":"34838472.1e51ec","type":"inject","z":"be5f8b33.e25518","name":"Right","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":310,"y":780,"wires":[["df2aad6b.e147c"]]},{"id":"fc9acb21.d481b8","type":"inject","z":"be5f8b33.e25518","name":"Left","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":310,"y":820,"wires":[["8672cda.bbd2a3"]]},{"id":"d1650e33.26e59","type":"inject","z":"be5f8b33.e25518","name":"Zoom in","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":320,"y":860,"wires":[["26532fe3.1738b"]]},{"id":"bbafaf2c.e54a3","type":"inject","z":"be5f8b33.e25518","name":"Zoom out","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":320,"y":900,"wires":[["475862d3.91958c"]]},{"id":"df2aad6b.e147c","type":"change","z":"be5f8b33.e25518","name":"","rules":[{"t":"set","p":"pan_speed","pt":"msg","to":"-1","tot":"num"},{"t":"set","p":"action","pt":"msg","to":"continuousMove","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":520,"y":780,"wires":[["15372eb.4ed1dd1"]]},{"id":"8672cda.bbd2a3","type":"change","z":"be5f8b33.e25518","name":"","rules":[{"t":"set","p":"pan_speed","pt":"msg","to":"0.9","tot":"num"},{"t":"set","p":"action","pt":"msg","to":"continuousMove","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":520,"y":820,"wires":[["15372eb.4ed1dd1"]]},{"id":"26532fe3.1738b","type":"change","z":"be5f8b33.e25518","name":"","rules":[{"t":"set","p":"zoom_speed","pt":"msg","to":"-0.5","tot":"num"},{"t":"set","p":"action","pt":"msg","to":"continuousMove","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":520,"y":860,"wires":[["15372eb.4ed1dd1"]]},{"id":"475862d3.91958c","type":"change","z":"be5f8b33.e25518","name":"","rules":[{"t":"set","p":"zoom_speed","pt":"msg","to":"0.5","tot":"num"},{"t":"set","p":"action","pt":"msg","to":"continuousMove","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":520,"y":900,"wires":[["15372eb.4ed1dd1"]]},{"id":"88e0ebd4.4e4bf8","type":"inject","z":"be5f8b33.e25518","name":"Stop","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":310,"y":940,"wires":[["a3c7ecd9.5a3c5"]]},{"id":"a3c7ecd9.5a3c5","type":"change","z":"be5f8b33.e25518","name":"","rules":[{"t":"set","p":"action","pt":"msg","to":"stop","tot":"str"},{"t":"set","p":"stopPanTilt","pt":"msg","to":"true","tot":"bool"},{"t":"set","p":"stopZoom","pt":"msg","to":"true","tot":"bool"}],"action":"","property":"","from":"","to":"","reg":false,"x":520,"y":940,"wires":[["15372eb.4ed1dd1"]]},{"id":"9cc35770.2bc858","type":"inject","z":"be5f8b33.e25518","name":"Up","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":310,"y":700,"wires":[["c82e5345.854b3"]]},{"id":"f64b8d92.a8077","type":"inject","z":"be5f8b33.e25518","name":"Down","topic":"","payload":"","payloadType":"date","repeat":"","crontab":"","once":false,"onceDelay":0.1,"x":310,"y":740,"wires":[["a63deb31.0a17d8"]]},{"id":"c82e5345.854b3","type":"change","z":"be5f8b33.e25518","name":"","rules":[{"t":"set","p":"tilt_speed","pt":"msg","to":"-0.2","tot":"num"},{"t":"set","p":"action","pt":"msg","to":"continuousMove","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":520,"y":700,"wires":[["15372eb.4ed1dd1"]]},{"id":"a63deb31.0a17d8","type":"change","z":"be5f8b33.e25518","name":"","rules":[{"t":"set","p":"tilt_speed","pt":"msg","to":"0.2","tot":"num"},{"t":"set","p":"action","pt":"msg","to":"continuousMove","tot":"str"}],"action":"","property":"","from":"","to":"","reg":false,"x":520,"y":740,"wires":[["15372eb.4ed1dd1"]]},{"id":"15372eb.4ed1dd1","type":"onvif-ptz","z":"be5f8b33.e25518","name":"","deviceConfig":"a1d845e1.731ec8","profileName":"","action":"","panSpeed":0,"tiltSpeed":0,"zoomSpeed":0,"panPosition":0,"tiltPosition":0,"zoomPosition":0,"panTranslation":0,"tiltTranslation":0,"zoomTranslation":0,"time":1,"preset":"","presetName":"","stopPanTilt":true,"stopZoom":true,"configurationToken":"","x":778,"y":700,"wires":[["d246b178.d835a"]]},{"id":"a1d845e1.731ec8","type":"onvif-config","z":"","xaddress":"192.168.1.38","port":"80","name":"garden ptz"}]

On Fri, 20 Mar 2020 at 22:06, bartbutenaers notifications@github.com wrote:

Hi @tesco222 https://github.com/tesco222,

Thanks for your feedback! It is much too long ago that I worked on this node, but will announce a new beta version on the Node-RED forum very soon...

I had to look in my code to see how it works, and indeed seems I have forgotten to document it. You should be able to set the 3 speed factors in the input message of the PTZ node:

  • msg.pan_speed
  • msg.tilt_speed
  • msg.zoom_speed

Each factor is allowed to have a numeric value between -1.0 and +1.0

Would you be so kind to test whether those parameters still work? And would be nice if you could share your example flow, so I can update the readme page.

Thanks !!! Bart

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/bartbutenaers/node-red-contrib-onvif-nodes/issues/7#issuecomment-601930400, or unsubscribe https://github.com/notifications/unsubscribe-auth/AO4BOMW53UEEOXLGLK2RUEDRIPSGZANCNFSM4LPN7ILA .

cxtal commented 3 weeks ago

I can confirm this issue persists on a Tapo camera. This happens regardless of the speed, either pan or tilt speed, both being set at 1. However it seems that setting the speed to -1 does make the camera pan and tilt very slowly which is expected. There are some additional observations; namely setting the pan and tilt position using absolute movements to values around 0 makes the camera pan and tilt very slowly. Extreme values, such as setting pan and tilt to either 1 or -1 will be very fast and the camera will move as expected.