Add a failure state for each relay to prevent repeated errors

Also, a bouncetime was added for the event detection