Maybe will be useful for someone:
System: Hyperion.NG running on Raspberry Pi 3 b+, Raspbian OS, USB capture device
Problem: if USB graber is plugged off and then again plugged in, then the hyperion does not get video signal and ambilight does not work.
Solution Idea: restart aitomatically hyperion service if USB graber plugged in. Use udev for that...
1) Make new udev rule:
1.1) Execute command:
1.2) In the nano editor insert the rule line like this (eventually you need to change the device name /dev/video0):
1.3) Use Ctrl+X, Y, Enter to save and exit the editor
2) Reload rules using command:
If something doies not work, an additional RUN can be added to the rule line to check if it is executed on plug:
In this case the whole rule is like this:
Each time the rule triggers, a new line will be added to the file /tmp/udev-debug.log. You can read this file to check if the rule has triggered.
Hyperion can also be stopped if usb grabber is unplugged, it reduces prozessor load. For that add second line to the USB-video.rules file:
Note: this way hyperion deamon is started as root. You might need to configure hyperion again, if you have used and configured it as pi user before.