The wrong devices are being switched on and off