I am fairly new to HomeAssistant, so i obviously need some help, please bare with me.
I have 6 cameras connected to my Synology Surveillance Station and I am running HomeAssistant as a DSM service (not in a VM, not in a docker, plain and simple DSM service). They’re not the best, not the cheapest/worst either (the cameras).
My problem is that every once in a while, 2 of my cameras stop working (mainly after the main router reboots - usually i reboot it manually, or after a power cut, when the cameras reboot faster than the router itself).
To ease my life and spare myself from crawling to their power adapters, i added 2 IKEA Tradfri control outlets on these cameras, and i restart the power on these cameras when i detect that they no longer work. Manual on/off from IKEA app or from HAS works just fine.
Now, i would like to take it to the next level: when the NAS Surveillance Station looses contact with the RTSP stream, i would like to know if it is possible to trigger the power outlet off/on automatically if the connection is lost for more than 1-3 minutes, of course, allowing the camera to restart (about 60-90 sec).
If it is possible, may i get a bit of guidance how to do this?
Environment:
DSM : 7.1-42661 update 4 (currently latest available for my DS1621+ NAS)
HA package: Home Assistant Core Version 2021.9.7.15