Home automation friendly finite state machine