First version using mqtt
Offline state handling