Temperature does not trigger the rule

Example of this kind of thing. It’s not the only way to do it.

if (hour >= 7 && hour <= 23 )

You probably want some curly brackets associated with that, if it is supposed to control the following block of code.

  if (hour >= 7 && hour <= 23 ) {
      // lines of code
  }