Hello as always I want to help the community by sharing my configuration for the cheap Chinse security systems. I got this SANNCE 4CH 1080P HD XPOE from Alliexpress
Step 1 (This is assuming your DVR is up and working normally outside HA)
Log in to your DVR and enable RSTP (change de default port if you want)
Create new user for HA in your DVR
Step2 (you can skip it if you think DVR config is good)
Test the stream in VLC
rtsp://ADDRESS:PORT/user=USER&password=PASSWORD&channel=1&stream=0.sdp?real_stream–rtp-caching=100
ADDRESS <— change to DVR IP
PORT <---- PORT of RTSP
USER <— change to user name used to access the DVR
PASS <— change to your password
channel=1 <— used to rotate all 4 channels
example: rtsp://192.168.0.100:554/user=admin&password=123456&channel=1&stream=0.sdp?real_stream–rtp-caching=100
Step3 (if all is good in step2)
Add generic camera to HA configuration.yaml
I do not know the still image URL of the DVR so I just added an image in the “www” folder in HA, I use the live view anyway.
camera:
- platform: generic
name: test cam
still_image_url: "https://127.0.0.1:443/www/img/camera-pictogram.jpg"
stream_source: "rtsp://192.168.0.100:554/user=admin&password=123456&channel=1&stream=0.sdp?real_stream--rtp-caching=100"
verify_ssl: false
username: "USER"
password: "PASS"
authentication: digest
After that save and restart HA or reload only the generic camera entity from config, build your Lovelace using the picture entity
PS
For some reason my tests did not work if the username created in the DVR is short or simple, but might be just my luck.