Hi all
I am trying to get notifications working from Reolink camera status changes. I have got this to wotk for motion, but my attempt to get this to work with person detection is failing. My camera system is set up to do this - i can see the “running man” icon on the camera feed when it detects a person. The “person” entity exists within HA, and it does show updates when i stand in from of the camera. The problem is that the status never changes from off, even when the entity says it has changed. Or it is does change, it is so brief I don’t see it happen.
Can anyone tell me how i might fix this - i don’t know if my problem is within ha or something in Reolink settings. I really could do with this working to reduce the unnecessary notifications i get from using simple motion as the trigger
Thank you
Some information on my Reolink settings which may or may not help. In Settings, i have RTMP checked, and it is looking at Port 9000. RTMP is checked and looking at Port 1935. HTTP is checked and looking at Port 80. HTTPS is checked and looking at Port 443. RTSP is checked and looking at Port 554, and within that ONVIF is checked and looking at Port 8000. However, if I go into Network Settings, under HTTPS, it has two empty boxes for Certificate and Keyfile. Could this be an issue? Given my lack of computer literacy, i really don’t know what i am looking for
I think it would be helpful with some more information.
Can you confirm that you are using the Reolink integration and that you have all entities in HA?
Do other entities work? Depending on your camera model (which you may also want to list ) you may have switch for flood light, switch for siren etc. Can you control these and observe that ay flood light is indeed turned on and off when you use the switch in HA?
You also need to be more clear on your person entity.
You write : The “person” entity exists within HA, and it does show updates when i stand in from of the camera. The problem is that the status never changes from off, even when the entity says it has changed. Or it is does change, it is so brief I don’t see it happen
What do you mean by status not changing but entity does? Is status not the state of the entity? You can use the Activity log to check how and if entities changes - that way you can catch even brief changes or look into what happened in the past.
I assume you also have a Reolink app somewhere. On your mobile device or on your computer. Does that app properly catch person detections etc?
Hi Robert
Yes I am using the Reolink integration, and I appear to have all the entities in HA. I have a number of cameras - a couple of which do not support people / vehicles detection, but most do. I am using a combination of the 823A PTZ, a couple of the original Duo cameras, and some simple spot cameras - sorry I cannot remember the model numbers. All are connected to a Reolink NVR. The “person” entity , as shown in the Dev Tools for one of the ptz cameras is shown as binary_sensor.front.door.ptz.person. Apologies for not being sure which of the above are"." and which are"" but I am playing around with a theme that makes some of this hard to read. In terms of what I see, if I trigger this sensor, it shows in Dev Tools that it updated at xyz time and changed at xyz time, however what it shows me when i trigger it, is that it continues to show “off” as the state - never changing, even if the note next to the attributes shows that it changed. I just never see if change. If I look at the Reolink app, when i trigger people detection by walking in front of the camera, it does indicate a person is detected - it shows an icon of a man running. Not sure if this answers your questions, so feel free to come back to me if not, or if you need any more information
What does your History log say for the entity?
Robert
I see two errors: first is “error while executing automation xxx: required key not provided @data [‘media_player’]” and the second one is at the same time stamp, "error executing script. Invalid data for call service at pos 5, required key not provided…(same as above). I will try to copy the automation so you can see it, although I am not sure how to format it correctly here:
alias: Front Door Motion Notification with Camera Stream
description: Sends notification and live stream when person or vehicle detected
triggers:
- entity_id: binary_sensor.front_door_ptz_person
from: "off"
to: "on"
trigger: state
- entity_id: binary_sensor.front_door_ptz_vehicle
from: "off"
to: "on"
trigger: state
actions:
- action: notify.mobile_app_mike_iphone_2
data:
message: Motion at the Front Door!
data:
push:
sound: default
actions:
- action: URI
title: View Live Feed
uri: /dashboard-home/cameras
- action: notify.mobile_app_ipad
data:
message: Motion at the Front Door!
data:
push:
sound: default
actions:
- action: URI
title: View Live Feed
uri: /dashboard-home/cameras
- action: notify.mobile_app_emily_s_iphone
data:
message: Motion at the Front Door!
data:
push:
sound: default
actions:
- action: URI
title: View Live Feed
uri: /dashboard-home/cameras
- action: input_select.select_option
target:
entity_id: input_select.active_camera
data:
option: front_door_ptz
- action: camera.play_stream
target:
entity_id: camera.front_door_ptz_fluent
- delay: "00:00:01"
- delay: "00:02:00"
mode: single
You will see, I think, that this uses an input select to chose which camera to stream. This is because chatGPT said i had to put each camera into a picture entity card on a dashboard, and the input select is supposed to chose whichever one is “active” - defined by being the most recent to see the camera.person entity change from off to on. Given that the camera.person or camera.vehicle entities don’t seem to ever show as anything other than off, this is all part of the problem.
I am not at all used to all of this, and have used chatgpt a lot, which may well be one of the root causes of my issue, but ultimately if i can get the camera.person entity to change from off to on, I suspect that will address most of the problem. It looks like i cannot get the yaml for the helper, but basically it is called “active camera”, which takes a list of my cameras, and looks at which one fired the most recently. I have a list of template sensors for each camera - one example follows:
# binary_sensors.yaml
# Template binary sensors for all cameras
# --- Front Door PTZ ---
- platform: template
sensors:
front_door_ptz_person:
friendly_name: "Front Door Person"
value_template: "{{ is_state('binary_sensor.front_door_ptz_person_raw', 'on') }}"
front_door_ptz_vehicle:
friendly_name: "Front Door Vehicle"
value_template: "{{ is_state('binary_sensor.front_door_ptz_vehicle_raw', 'on') }}"
This may well be messed up, but the automation does run (it picks up on the fact that there was motion detected, not person detected) - it just does not pick up an active camera when the notification arrives at my phone.
I am sorry this is long, but I am trying to get as much information as I can in case it helps
Ok. One thing at the time…
From your initial question I was under the impression that you had problems getting “accurate” person detection from your Reolink camera into HA.
What do I mean by accurate person detection?
Accurate person detection from your Reolink camera in this context is a binary sensor in HA that reflects the status of what your Reolink camera (Reolink Camera) detect with respect to detecting people. In other words - the binary sensor related to person detection should get positive whenever a person is detected and turn negative when a person is no longer detected. Positive would typically be the binary sensor going from off to on.
Do you think that your HA sensor accurately reflect the state that you Reolink App reports? That is why I asked about the history log of your binary sensor. Do you know how to look at this history? Example; Settings - Devices & services; Reolink and select the person sensor. (I attached an example from my setup)
Once you determine that is OK then we can move forward with what automations is doing
I did not know you could do that ! I was only looking at Dev Tools, Entity States, (which never changed as far as I could see) And the good news is that your way shows that the “person” entities do change in those logs. So I guess the issue is really how I have set up the automations. ChatGPT daid I had to put the camera feeds into picture entity cards, in a separate view, then select the “active” camera to show in the notification through the input select. So I guess this is the part that is failing. Is there a better way to get the camera feed into the notification ? I would prefer not to put every camera into it’s own view, but if that is required so that I can point each camera to a different URI, I will just have to live with it. I also would really like the notification to only trigger if it is specifically a person or vehicle - at the moment it just triggers (without the camera feed) on any motion.
Can’t say that I’m on expert on this.
Rather than using ChatGPT I would suggest reading the HA documentation for the Reolink integration. It does include a tutorial on doing some of the things you are trying to do.
