     bpresence = false;
   }
 
-  if (!bpresence && ir_data.ac_presence_mode == 1)
+  if (!bpresence && (ir_data.ac_presence_mode == 1))
   {
     Serial.println("[IR] -----> AC Power Down");
     lgWhisen.power_down();

      if (ir_data.ac_temp != root["ac_temp"])
      {
        ir_data.ac_temp = root["ac_temp"];
        if (ir_data.ac_mode == 1)
        {
          ir_data.haveData = true;
        }
      }
    }

    if (root.containsKey("ac_mode"))

  JsonObject& root = jsonBuffer.createObject();
  root["ac_mode"]           = ir_data.ac_mode;
  root["ac_temp"]           = ir_data.ac_temp;
  root["ac_flow"]           = ir_data.ac_flow;  
  root["cur_temp"]          = temperature * 0.01;
  root["cur_humi"]          = humidity;
  root["presence"]          = uint8_t(bpresence);
