Update main script to work again. Last updates to refactor were not tested enough. This is better. Also increased the interval because latency can cause light flickering if it alternates too much. Added logging information useful for troubleshooting results.