autodetect type of device in config