This is almost certainly constitutional.
The 4th Amendment does not prohibit routine administrative inspects for health and safety purposes at reasonable hours with advanced notice, although it an owner objects, this must be formalized with an "administrative warrant" granted as a matter of course pursuant to an overall municipal inspection plan, without the need to show probable cause.
For example, this 2012 law review article explains that:
[T]he government conducts thousands of administrative searches every
day. None of these searches requires either probable cause or a search
warrant. Instead, courts evaluating administrative searches need only
balance the government's interest in conducting the search against the
degree of intrusion on the affected individual's privacy to determine
whether the search is reasonable. This reasonableness balancing is
very deferential to the government, and the resulting searches are
almost always deemed reasonable. As a result, the administrative
search exception functions as an enormously broad license for the
government to conduct searches free from constitutional limitation.
Some of the leading U.S. Supreme Court cases on point are explored here:
"[T]he Supreme Court until recently employed a reasonableness test for such searches without requiring either a warrant or probable cause in the absence of a warrant. See, e.g., Abel v. United States, 362 U.S. 217 (1960); Frank v. Maryland, 359 U.S. 360 (1959); Oklahoma Press Pub. Co. v. Walling, 327 U.S. 186 (1946). . . .
"But, in 1967, the Court in two cases held that administrative inspections to detect building code violations must be undertaken pursuant to warrant if the occupant objects. 'We may agree that a routine inspection of the physical condition of private property is a less hostile intrusion than the typical policeman’s search for the fruits and instrumentalities of crime.'" Camara v. Municipal Court, 387 U.S. 523, 530 (1967) (home). See also See v. City of Seattle, 387 U.S. 541 (1967) (commercial warehouse). . . .
"In Donovan v. Dewey, [452 U.S. 594 (1981)] however, the Court . . . appeared to permit extensive governmental inspection of commercial property without a warrant."
Also, while most property owners would consent to inspection, when they do not, even if an administrative warrant in order to inspect sites where consent was refused, this administrative warrant can be issued on more lenient grounds than a criminal search warrant:
Administrative warrants issued on the basis of less than probable
cause but only on a showing that a specific business had been chosen
for inspection on the basis of a general administrative plan would
suffice. Even without a necessity for probable cause, the requirement
would assure the interposition of a neutral officer to establish that
the inspection was reasonable and was properly authorized. 436 U.S. at
321, 323. The dissenters objected that the warrant clause was being
constitutionally diluted. Id. at 325. Administrative warrants were
approved also in Camara v. Municipal Court, 387 U.S. 523, 538
(1967). Previously, one of the reasons given for finding
administrative and noncriminal inspections not covered by the Fourth
Amendment was the fact that the warrant clause would be as rigorously
applied to them as to criminal searches and seizures. Frank v.
Maryland, 359 U.S. 360, 373 (1959).
Basically, even if the owner does not consent, an administrative warrant to do a building inspection is available to building inspectors making routine inspections as a matter of course.
In the usual case, where the owner either scheduled the inspection personally, or does not object upon receiving notice, the consent requirement is met, and the tenant's lease almost certainly authorizes the owner to demand that the tenant consent.
At most, if the ordinance was found to be unconstitutional, it could be swiftly and easily amended by the township's governing body to clarify that if the owner does not consent that the local government inspector may obtain a warrant for the scheduled date as a matter of course in a township administrative court created for that purpose or some other local court, rendering any challenge to the ordinance moot without meaningfully vindicating any protections against having a rental property searched by building inspectors.
Also, if the tenant is required by the terms of the tenant's lease to consent if the landlord consents, then the tenant would not have standing to raise this issue in court.