OBJECTION! Where did this process come from?

According to newspaper articles (NY Times) if one Representative and one Senator object to a state’s electoral votes during the counting of them, each house is to go back to their respective chamber and debate whether to sustain the objection, debate limited to two hours.

Where did this objection business come from? Not from the Constitution as I read it! I find nothing related to this - only that the President of the Senate is to count the electoral votes submitted in the presence of the Senate and the House. No provision for objections or two-hour debates. (Article II as modified by Amendment XII).

Electoral Count Act of 1887.

Which was enacted after the disputed election of 1876. They needed some procedures to avoid the mess that basically overturned the election results.