Yes this is because channel number in reolink app start from 1-8 and in api cgi calls from 0-7
Hi all,
I have just started to use the custom component and tried to add three reolink cameras to it. It works perfectly with RLC-422W but I cannot get any streaming data with E1 pro. As I understand from device spec RLC one has an internall webserver, E1 pro does not, but not sure does it matter.
From the logs I have managed to dig out the following information:
2020-02-04 14:16:04,053 - MainThread - custom_components.reolink_dev.ReolinkPyPi.camera - INFO - Reolink camera at IP 192.168.0.51 is not logged in
2020-02-04 14:16:04,056 - MainThread - custom_components.reolink_dev.ReolinkPyPi.camera - INFO - Reolink camera at IP 192.168.0.53 is not logged in
Moreover I have tried to use the āstockā camera solution and worked with both version of camera.
- platform: generic
name: Lobby_Low
still_image_url: "http://192.168.0.51/cgi-bin/api.cgi?cmd=Snap&channel=0&rs=wuuPhkmUCeI9WG7C&user=xxxxxx&password=yyyy"
stream_source: "rtsp://xxxxxxxx:[email protected]:554/h264Preview_01_sub"
Any idea what can be the problem? Many thanks in advance for any kind of help.
Are you specifying the protocol. In your config
Cause the custom component is written to default to the rtmp unless you specify rtsp.
And the E1 doesnāt do rtmp.
Yeah I though about it as well and set the protocol to rtsp and stream to sub, so mainly bring to the same configuration level as the āstockā solution. No luck
Hello, how does the scan_interval of the integration in the camera affect, I mean, every x seconds what the camera does? Greetings
If you specify for example a scan_interval of 10 seconds, this value will be used for the motion only.
The camera settings will be fetched every 30 seconds or higher. If the scan_interval is for example set to 60 seconds, this value will also be used for the settings.
What card did you use and how did you integrate and what are the config settings ? I have a 410 and I am about to set up same. Help appreciated.
Iām using this custom componentā¦ hereās an example of one of my card setups:
aspect_ratio: 0%
camera_image: camera.basement
entities:
- entity: binary_sensor.motion_basement
- entity: switch.camera_basement_ir_lights
title: Basement
type: picture-glance
Iām not using the FTP record toggle button.
Hi
Is that possible to get Reolink E1 (non pro) working with Home Assistant? Just need simple snapshot picture or video stream to Home Assistant.
Get Reolink E1 allready my home automation network and put static ip. Now try to figure do i get that working with Home Assistant.
Hope someone can help me with this situation.
Iām sorry but it has no rtsp support or at least I had to upgrade to pro version to work with HA
Thanks
As off March 2020 it works fine
Got mine working, had to upload the files in the editor, because when I cloned it the reolink_dev folder was inside a folder called reolink->custom_components. Itās probably user error because Iām new to GIT.
thank you so much for posting this, it saved me a lot of trouble.
but i have ran into one problem, i did my best to setup 2 cameras, but when i got things setup in the overview, all it seems to show is one of the 2 feeds, where should i start to look for troubleshooting?
both feeds show the same camera
Thank you all for the input here. Very good!
I chose to set up with Node-RED and MQTT to get motion sensors working.
The logic is that I use I stole partly from @danps flow above. Only that I added a binary_sensor in HA
platform: mqtt
name: "Camera Front Door Motion"
state_topic: "homeassistant/sensor/frontdoormotion/state"
payload_on: "1"
device_class: Motion
off_delay: 5
This is updated from MQTT with the flow above. As seen from HA it looks like this.
I also use the flow to run object detection. I run the Max Object Detector on my Raspberry Pi4 to detect if there are persons in the image captured. My next step is now to get the recordings done in Motion Eye. I think that will work better than using MotionEyes internal motion detection and I like the management of recordings in MotionEye rather than making something of my own.
Node-red flow:
[
{
"id": "899f2d57.f399f",
"type": "tab",
"label": "Camera Motion and Object Detection",
"disabled": false,
"info": ""
},
{
"id": "23af1c0b.b61054",
"type": "debug",
"z": "899f2d57.f399f",
"name": "",
"active": false,
"tosidebar": true,
"console": false,
"tostatus": false,
"complete": "true",
"x": 630,
"y": 240,
"wires": []
},
{
"id": "e1225edb.c2cfb",
"type": "object-detector",
"z": "899f2d57.f399f",
"service": "d7ee8aef.263ad8",
"method": "predict",
"passthrough": false,
"annotated_input": true,
"predict_body": "",
"predict_bodyType": "str",
"predict_threshold": "0.7",
"predict_thresholdType": "str",
"name": "",
"x": 340,
"y": 240,
"wires": [
[
"23af1c0b.b61054",
"c8ba4fb0.dc12d"
]
]
},
{
"id": "576f252c.6c9ddc",
"type": "fileinject",
"z": "899f2d57.f399f",
"name": "",
"x": 120,
"y": 240,
"wires": [
[
"e1225edb.c2cfb"
]
]
},
{
"id": "27178b23.8e4034",
"type": "camera",
"z": "899f2d57.f399f",
"name": "",
"x": 110,
"y": 300,
"wires": [
[
"e1225edb.c2cfb"
]
]
},
{
"id": "e1cfe470.1db2e8",
"type": "image",
"z": "899f2d57.f399f",
"name": "",
"width": "600",
"data": "payload",
"dataType": "msg",
"thumbnail": false,
"x": 660,
"y": 300,
"wires": []
},
{
"id": "c8ba4fb0.dc12d",
"type": "function",
"z": "899f2d57.f399f",
"name": "Extract Bounding Box Image Data",
"func": "// if the incoming message contains the annotated image\n// send it to the image output node to display\n\nmsg.payload = msg.annotatedInput;\nif (msg.payload) {\n return msg;\n}",
"outputs": 1,
"noerr": 0,
"x": 400,
"y": 300,
"wires": [
[
"e1cfe470.1db2e8"
]
]
},
{
"id": "8b5fda0a.cb5a68",
"type": "www-request",
"z": "899f2d57.f399f",
"name": "Get Motion",
"method": "GET",
"ret": "obj",
"url": "http://x.x.x.x/api.cgi?cmd=GetMdState&user=username&password=password",
"follow-redirects": true,
"persistent-http": true,
"tls": "",
"x": 270,
"y": 80,
"wires": [
[
"b06e3fe8.1010e"
]
]
},
{
"id": "b06e3fe8.1010e",
"type": "switch",
"z": "899f2d57.f399f",
"name": "Motion Detected?",
"property": "payload.0.value.state",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "1",
"vt": "num"
}
],
"checkall": "true",
"repair": false,
"outputs": 1,
"x": 450,
"y": 80,
"wires": [
[
"19ae4699.c6fe79"
]
]
},
{
"id": "2090b4b2.504f6c",
"type": "inject",
"z": "899f2d57.f399f",
"name": "Repeat",
"topic": "",
"payload": "",
"payloadType": "date",
"repeat": "1",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"x": 120,
"y": 80,
"wires": [
[
"8b5fda0a.cb5a68"
]
]
},
{
"id": "d969661b.1a8e88",
"type": "mqtt out",
"z": "899f2d57.f399f",
"name": "motion",
"topic": "homeassistant/sensor/frontdoormotion/state",
"qos": "",
"retain": "true",
"broker": "aa1e005f.60bce",
"x": 730,
"y": 80,
"wires": []
},
{
"id": "d53b0a51.a70da8",
"type": "inject",
"z": "899f2d57.f399f",
"name": "motion_trigger",
"topic": "",
"payload": "1",
"payloadType": "num",
"repeat": "",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"x": 580,
"y": 40,
"wires": [
[
"d969661b.1a8e88"
]
]
},
{
"id": "19ae4699.c6fe79",
"type": "change",
"z": "899f2d57.f399f",
"name": "1",
"rules": [
{
"t": "set",
"p": "payload",
"pt": "msg",
"to": "1",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 610,
"y": 80,
"wires": [
[
"d969661b.1a8e88"
]
]
},
{
"id": "52dd11f3.fca7e",
"type": "server-state-changed",
"z": "899f2d57.f399f",
"name": "Front Door Motion",
"server": "42bee720.8c3248",
"version": 1,
"exposeToHomeAssistant": false,
"haConfig": [
{
"property": "name",
"value": ""
},
{
"property": "icon",
"value": ""
}
],
"entityidfilter": "binary_sensor.camera_front_door_motion",
"entityidfiltertype": "exact",
"outputinitially": false,
"state_type": "str",
"haltifstate": "on",
"halt_if_type": "str",
"halt_if_compare": "is",
"outputs": 2,
"output_only_on_state_change": true,
"x": 130,
"y": 180,
"wires": [
[
"ae6cf8bb.65b548"
],
[]
]
},
{
"id": "ae6cf8bb.65b548",
"type": "www-request",
"z": "899f2d57.f399f",
"name": "Get Motion",
"method": "GET",
"ret": "bin",
"url": "http://x.x.x.x/cgi-bin/api.cgi?cmd=Snap&channel=0&rs=asdf&user=username&password=password",
"follow-redirects": true,
"persistent-http": true,
"tls": "",
"x": 330,
"y": 180,
"wires": [
[
"e1225edb.c2cfb"
]
]
},
{
"id": "d7ee8aef.263ad8",
"type": "object-detector-service",
"z": "",
"host": "http://localhost:5000",
"name": "rpi-home"
},
{
"id": "aa1e005f.60bce",
"type": "mqtt-broker",
"z": "",
"name": "localhost",
"broker": "10.0.0.10",
"port": "1883",
"tls": "ac1ef16e.4cc71",
"clientid": "",
"usetls": false,
"compatmode": false,
"keepalive": "60",
"cleansession": true,
"birthTopic": "",
"birthQos": "0",
"birthPayload": "",
"closeTopic": "",
"closeQos": "0",
"closePayload": "",
"willTopic": "",
"willQos": "0",
"willPayload": ""
},
{
"id": "42bee720.8c3248",
"type": "server",
"z": "",
"name": "Home Assistant HA",
"legacy": false,
"addon": true,
"rejectUnauthorizedCerts": true,
"ha_boolean": "y|yes|true|on|home|open",
"connectionDelay": true
},
{
"id": "ac1ef16e.4cc71",
"type": "tls-config",
"z": "",
"name": "",
"cert": "",
"key": "",
"ca": "",
"certname": "",
"keyname": "",
"caname": "",
"servername": "",
"verifyservercert": false
}
]
That looks awesome @corvy - Iāll definitely be trying the image recognition.
1 question - do you run object-detector directly on your HA computer, or in a docker container?
Also, might be worth considering, that now with the latest integration between Node-Red and HA, you can directly create and control a binary_sensor in Home Assistant, so you could skip mqtt - might be a bit quicker / simplerā¦
Hey @danps, I will look at that!
The Max Object Detector I run a docker container on HA. Since the install is quite big I have selected to ssh to the host os (on port 22222) to run the docker install. After this is done I can manage it in Portainer. If you try to install directly in portainer I think there is timeout happening.
ssh to port 22222 and run the command:
docker run -it -p 5000:5000 codait/max-object-detector:arm-arm32v7-latest
On Node-RED I installed this:
hello again @danps, very useful the Node-Red integration. Much cleaner
I added a delay node to reset the motion after 5 seconds. Works good for now. I have moved my cameras off to a separate HASS installation on an Ubuntu server to get more power and also leave it on cabled network for more stability and speed.
OK so I also took quite a bit of inspiration from your work on the motion detection @corvy!
And I wanted to make it work with multiple cameras, so this is what I came up withā¦
I wanted to use the same central flow of ācheck if thereās motion, if there is check for objects, if thereās a person, update a binary sensorā
So in the Change nodes, I set msg values to the URLs of the motion api, snap URL, and sensor name for each camera. Those then flow through the same sequence, and get separated again if a sensor needs updating.
This is cool! Could you send the JSON for this? I could use that to optimize my own flows.
Absolutely. Hereās a version for 2 cameras, but Iām sure youāll get the idea from thisā¦
[
{
"id": "2eb488fa.180818",
"type": "tab",
"label": "Flow 1",
"disabled": false,
"info": ""
},
{
"id": "a45041ed.35f15",
"type": "inject",
"z": "2eb488fa.180818",
"name": "Every second",
"topic": "",
"payload": "",
"payloadType": "date",
"repeat": "1",
"crontab": "",
"once": false,
"onceDelay": 0.1,
"x": 140,
"y": 60,
"wires": [
[
"26a92959.74a0f6"
]
]
},
{
"id": "26a92959.74a0f6",
"type": "change",
"z": "2eb488fa.180818",
"name": "",
"rules": [
{
"t": "set",
"p": "delay",
"pt": "msg",
"to": "143",
"tot": "num"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 160,
"y": 160,
"wires": [
[
"37d0f96b.1bd056"
]
]
},
{
"id": "37d0f96b.1bd056",
"type": "delay",
"z": "2eb488fa.180818",
"name": "Delay",
"pauseType": "delayv",
"timeout": "100",
"timeoutUnits": "milliseconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"x": 130,
"y": 240,
"wires": [
[
"5f13c17f.3248b",
"629ad2e8.6379ec"
]
]
},
{
"id": "629ad2e8.6379ec",
"type": "delay",
"z": "2eb488fa.180818",
"name": "Delay",
"pauseType": "delayv",
"timeout": "100",
"timeoutUnits": "milliseconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"x": 130,
"y": 300,
"wires": [
[
"82c1cdaf.94d76"
]
]
},
{
"id": "82c1cdaf.94d76",
"type": "change",
"z": "2eb488fa.180818",
"name": "Garden",
"rules": [
{
"t": "set",
"p": "motion_url",
"pt": "msg",
"to": "http://192.168.X.Y/cgi-bin/api.cgi?cmd=getmdstate&channel=0&user=****&password=****",
"tot": "str"
},
{
"t": "set",
"p": "snap_url",
"pt": "msg",
"to": "http://192.168.X.Y/cgi-bin/api.cgi?cmd=Snap&channel=0&rs=****&user=****&password=****",
"tot": "str"
},
{
"t": "set",
"p": "sensor_name",
"pt": "msg",
"to": "garden_person_detected",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 320,
"y": 300,
"wires": [
[
"61d73378.a8cb6c"
]
]
},
{
"id": "5f13c17f.3248b",
"type": "change",
"z": "2eb488fa.180818",
"name": "Garage",
"rules": [
{
"t": "set",
"p": "motion_url",
"pt": "msg",
"to": "http://192.168.X.Y/cgi-bin/api.cgi?cmd=getmdstate&channel=0&user=****&password=****",
"tot": "str"
},
{
"t": "set",
"p": "snap_url",
"pt": "msg",
"to": "http://192.168.X.Y/cgi-bin/api.cgi?cmd=Snap&channel=0&rs=****&user=****&password=****",
"tot": "str"
},
{
"t": "set",
"p": "sensor_name",
"pt": "msg",
"to": "garage_person_detected",
"tot": "str"
}
],
"action": "",
"property": "",
"from": "",
"to": "",
"reg": false,
"x": 320,
"y": 240,
"wires": [
[
"61d73378.a8cb6c"
]
]
},
{
"id": "61d73378.a8cb6c",
"type": "www-request",
"z": "2eb488fa.180818",
"name": "Get Motion",
"method": "GET",
"ret": "obj",
"url": "{{{motion_url}}}",
"follow-redirects": true,
"persistent-http": true,
"tls": "",
"x": 570,
"y": 240,
"wires": [
[
"9206eb59.f20558"
]
]
},
{
"id": "9206eb59.f20558",
"type": "switch",
"z": "2eb488fa.180818",
"name": "Motion Detected?",
"property": "payload.0.value.state",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "1",
"vt": "num"
}
],
"checkall": "true",
"repair": false,
"outputs": 1,
"x": 590,
"y": 300,
"wires": [
[
"b268d083.c07a"
]
]
},
{
"id": "b268d083.c07a",
"type": "http request",
"z": "2eb488fa.180818",
"name": "Get Image",
"method": "GET",
"ret": "bin",
"paytoqs": false,
"url": "{{{snap_url}}}",
"tls": "",
"persist": false,
"proxy": "",
"authType": "",
"x": 570,
"y": 360,
"wires": [
[
"421a36c5.a61fc8"
]
]
},
{
"id": "421a36c5.a61fc8",
"type": "object-detector",
"z": "2eb488fa.180818",
"service": "8a8868de.b3eed8",
"method": "predict",
"passthrough": false,
"annotated_input": true,
"predict_body": "",
"predict_bodyType": "str",
"predict_threshold": "0.7",
"predict_thresholdType": "str",
"name": "",
"x": 580,
"y": 420,
"wires": [
[
"54e7ef49.d5fa5"
]
]
},
{
"id": "54e7ef49.d5fa5",
"type": "switch",
"z": "2eb488fa.180818",
"name": "Person?",
"property": "payload",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "person",
"vt": "str"
}
],
"checkall": "true",
"repair": false,
"outputs": 1,
"x": 560,
"y": 480,
"wires": [
[
"42583aaa.097854"
]
]
},
{
"id": "42583aaa.097854",
"type": "switch",
"z": "2eb488fa.180818",
"name": "Which Sensor",
"property": "sensor_name",
"propertyType": "msg",
"rules": [
{
"t": "eq",
"v": "garage_person_detected",
"vt": "str"
},
{
"t": "eq",
"v": "garden_person_detected",
"vt": "str"
}
],
"checkall": "true",
"repair": false,
"outputs": 2,
"x": 780,
"y": 480,
"wires": [
[
"bcba2b54.4f31c8"
],
[
"f7298688.3d07d8"
]
]
},
{
"id": "bcba2b54.4f31c8",
"type": "ha-entity",
"z": "2eb488fa.180818",
"name": "Binary Sensor On",
"server": "a23a4d01.eeb32",
"version": 1,
"debugenabled": true,
"outputs": 1,
"entityType": "binary_sensor",
"config": [
{
"property": "name",
"value": "garage_person_detected"
},
{
"property": "device_class",
"value": "motion"
},
{
"property": "icon",
"value": ""
},
{
"property": "unit_of_measurement",
"value": ""
}
],
"state": "true",
"stateType": "bool",
"attributes": [],
"resend": true,
"outputLocation": "",
"outputLocationType": "none",
"inputOverride": "allow",
"x": 1030,
"y": 240,
"wires": [
[
"ab171eac.3fc8f"
]
]
},
{
"id": "ab171eac.3fc8f",
"type": "delay",
"z": "2eb488fa.180818",
"name": "",
"pauseType": "delay",
"timeout": "5",
"timeoutUnits": "seconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"x": 1220,
"y": 240,
"wires": [
[
"726798cc.22e5f8"
]
]
},
{
"id": "726798cc.22e5f8",
"type": "ha-entity",
"z": "2eb488fa.180818",
"name": "Binary Sensor Off",
"server": "a23a4d01.eeb32",
"version": 1,
"debugenabled": false,
"outputs": 1,
"entityType": "binary_sensor",
"config": [
{
"property": "name",
"value": "garage_person_detected"
},
{
"property": "device_class",
"value": "motion"
},
{
"property": "icon",
"value": ""
},
{
"property": "unit_of_measurement",
"value": ""
}
],
"state": "false",
"stateType": "bool",
"attributes": [],
"resend": true,
"outputLocation": "",
"outputLocationType": "none",
"inputOverride": "allow",
"x": 1410,
"y": 240,
"wires": [
[]
]
},
{
"id": "c5abfe39.f07df",
"type": "ha-entity",
"z": "2eb488fa.180818",
"name": "Binary Sensor Off",
"server": "a23a4d01.eeb32",
"version": 1,
"debugenabled": false,
"outputs": 1,
"entityType": "binary_sensor",
"config": [
{
"property": "name",
"value": "garden_person_detected"
},
{
"property": "device_class",
"value": "motion"
},
{
"property": "icon",
"value": ""
},
{
"property": "unit_of_measurement",
"value": ""
}
],
"state": "false",
"stateType": "bool",
"attributes": [],
"resend": true,
"outputLocation": "",
"outputLocationType": "none",
"inputOverride": "allow",
"x": 1410,
"y": 300,
"wires": [
[]
]
},
{
"id": "76983983.317108",
"type": "delay",
"z": "2eb488fa.180818",
"name": "",
"pauseType": "delay",
"timeout": "5",
"timeoutUnits": "seconds",
"rate": "1",
"nbRateUnits": "1",
"rateUnits": "second",
"randomFirst": "1",
"randomLast": "5",
"randomUnits": "seconds",
"drop": false,
"x": 1220,
"y": 300,
"wires": [
[
"c5abfe39.f07df"
]
]
},
{
"id": "f7298688.3d07d8",
"type": "ha-entity",
"z": "2eb488fa.180818",
"name": "Binary Sensor On",
"server": "a23a4d01.eeb32",
"version": 1,
"debugenabled": false,
"outputs": 1,
"entityType": "binary_sensor",
"config": [
{
"property": "name",
"value": "garden_person_detected"
},
{
"property": "device_class",
"value": "motion"
},
{
"property": "icon",
"value": ""
},
{
"property": "unit_of_measurement",
"value": ""
}
],
"state": "true",
"stateType": "bool",
"attributes": [],
"resend": true,
"outputLocation": "",
"outputLocationType": "none",
"inputOverride": "allow",
"x": 1030,
"y": 300,
"wires": [
[
"76983983.317108"
]
]
},
{
"id": "8a8868de.b3eed8",
"type": "object-detector-service",
"z": "",
"host": "https://max-object-detector.max.us-south.containers.appdomain.cloud",
"name": "cloud"
},
{
"id": "a23a4d01.eeb32",
"type": "server",
"z": "",
"name": "Home Assistant"
}
]