common interface for mqtt and devices