I too was having issues with motion detection, so I went with this method
Reolink NVR Camera(s) in Home Assistant
For example, if your Reolink NVR has the following information,
IP address: 192.168.86.17
username: admin
password: 123456
You may also change the channel number (starts at 0) to recieve different channels.
Motion detection (configuration.yaml
)
binary_sensor:
- platform: rest
resource: http://192.168.86.17/api.cgi?cmd=GetMdState&channel=2&user=admin&password=123456
name: Carport
scan_interval: 2
value_template: '{{ value_json[0].value.state }}'
device_class: motion
- platform: rest
resource: http://192.168.86.17/api.cgi?cmd=GetAiState&channel=2&user=admin&password=123456
name: Carport Vehicle AI
scan_interval: 2
value_template: '{{ value_json[0].value.vehicle.alarm_state }}'
device_class: motion
- platform: rest
resource: http://192.168.86.17/api.cgi?cmd=GetAiState&channel=2&user=admin&password=123456
name: Carport Person AI
scan_interval: 2
value_template: '{{ value_json[0].value.people.alarm_state }}'
device_class: motion
- platform: rest
resource: http://192.168.86.17/api.cgi?cmd=GetAiState&channel=2&user=admin&password=123456
name: Carport Pet AI
scan_interval: 2
value_template: '{{ value_json[0].value.dog_cat.alarm_state }}'
device_class: motion
Camera (configuration.yaml
)
stream:
camera:
- platform: generic
name: Carport
still_image_url: http://192.168.86.17/cgi-bin/api.cgi?cmd=Snap&channel=2&rs=Carport&user=admin&password=123456
stream_source: rtsp://admin:[email protected]:554/h264Preview_03_sub
Use Picture Glance Card to view camera in HA
Works flawless