What is the power logic for drawing electricity from the grid in AC manual charging mode?

What is the power logic for drawing electricity from the grid in AC manual charging mode?

AC charging power (drawing from the home grid) = Battery charging power set in the App (not exceeding 3000W) + Off-grid socket output power. The total of the two shall not exceed 3680W.