I got a camera that has good feature for the price (50$), it can control the pan with http command.
I am newb and not sure how I can put in front end the commands: ideally just a button for each preset.
Of course would be good some code for automation (like if there is a motion, with an external motion sensor) to make the camera move to a preset position automatically
PT control
Up: http://camera_ip:web_port/decoder_control.cgi?command=0&user=username&pwd=password
Stop up: http://camera_ip:web_port/decoder_control.cgi?command=1&user=username&pwd=password
Down: http://camera_ip:web_port/decoder_control.cgi?command=2&user=username&pwd=password
Stop down: http://camera_ip:web_port/decoder_control.cgi?command=3&user=username&pwd=password
Left: http://camera_ip:web_port/decoder_control.cgi?command=4&user=username&pwd=password
Stop left: http://camera_ip:web_port/decoder_control.cgi?command=5&user=username&pwd=password
Right: http://camera_ip:web_port/decoder_control.cgi?command=6&user=username&pwd=password
Stop right: http://camera_ip:web_port/decoder_control.cgi?command=7&user=username&pwd=password
Set Preset position 1: http://camera_ip:web_port/decoder_control.cgi?command=30&user=username&pwd=password
Go Preset position 1: http://camera_ip:web_port/decoder_control.cgi?command=31&user=username&pwd=password
Set Preset position 2: http://camera_ip:web_port/decoder_control.cgi?command=32&user=username&pwd=password
Go Preset position 2: http://camera_ip:web_port/decoder_control.cgi?command=33&user=username&pwd=password
Set Preset position 3: http://camera_ip:web_port/decoder_control.cgi?command=34&user=username&pwd=password
Go Preset position 3: http://camera_ip:web_port/decoder_control.cgi?command=35&user=username&pwd=password
Set Preset position 4: http://camera_ip:web_port/decoder_control.cgi?command=36&user=username&pwd=password
Go Preset position 4: http://camera_ip:web_port/decoder_control.cgi?command=37&user=username&pwd=password
Set Preset position 5: http://camera_ip:web_port/decoder_control.cgi?command=38&user=username&pwd=password
Go Preset position 5: http://camera_ip:web_port/decoder_control.cgi?command=39&user=username&pwd=password
Set Preset position 6: http://camera_ip:web_port/decoder_control.cgi?command=40&user=username&pwd=password
Go Preset position 6: http://camera_ip:web_port/decoder_control.cgi?command=41&user=username&pwd=password
For the beginning I need something simple:
at night the camera goes to a certain preset position
(http://camera_ip:web_port/decoder_control.cgi?command=31&user=username&pwd=password)
at day the camera goes to a different preset position
http://camera_ip:web_port/decoder_control.cgi?command=32&user=username&pwd=password
what would be the easiest way?
That would be the automation part. for all the rest I can continue using the web interface of the producer
I was looking into this myself to automate my Foscam and turn off the IR at night (It faces a window making IR useless, but I canât permanently turn it off) but I didnât go that far with it.
In the bookmarks folder I have for this project I have these threads; presumably to figure out curl usage. It may help.
17-01-15 23:47:22 homeassistant.bootstrap: Invalid config for [automation]: Entity ID office_camera_presets_1_2 is an invalid entity id for dictionary value @ data[âactionâ][0][âentity_idâ]. Got None. (See /home/hass/.homeassistant/automation.yaml:1). Please check the docs at https://home-assistant.io/components/automation/
17-01-15 23:47:22 homeassistant.bootstrap: Invalid config for [automation]: Entity ID office_camera_presets_1_2 is an invalid entity id for dictionary value @ data[âactionâ][0][âentity_idâ]. Got None. (See /home/hass/.homeassistant/automation.yaml:1). Please check the docs at https://home-assistant.io/components/automation/
17-01-15 23:47:22 homeassistant.core: Bus:Handling <Event call_service[L]: service_call_id=1977193360-7, service=create, service_data=notification_id=invalid_config, title=Invalid config, message=The following components and platforms could not be set up:
To allow control of an Amcrest camera pan & tilt, I added an input_select, automation and shell_command to my configuration.yaml, and a shell script.
The reason for the â1â in the list of the input_select is to allow moving the camera in the same direction twice. For example, if you select âLeft,â the camera will move left. If you select âLeftâ again, the camera wonât move because the automation will not be triggered. I couldnât find any other way to do this. So if you want to move left twice, you need to select âLeft,â â1â and then âLeftâ again.
input_select:
move_camera:
name: Move Camera
options:
- Left
- Right
- 1
- Up
- Down
- Reboot
Hereâs the contents of camera.move. It expects two arguments, the ending IP address, (in this example 254) and the command to be passed
from input_select.move_camera
.