EXHIBIT (23) (a) Consent of Independent Registered Public Accounting Firm We consent to the reference to our firm under the caption "Experts" in the Registration Statement on Form S-3 and the related Prospectus of CMS Energy Corporation and to the incorporation by reference therein of our reports dated March 7, 2005, with respect to the consolidated financial statements of CMS Energy Corporation, CMS Energy Corporation management's assessment of the effectiveness of internal control over financial reporting, and the effectiveness of internal control over financial reporting of CMS Energy Corporation, included in its Annual Report (Form 10-K) for the year ended December 31, 2004, and the related financial statement schedule of CMS Energy Corporation included therein, filed with the Securities and Exchange Commission. /s/ Ernst & Young LLP Detroit, Michigan June 2, 2005