Auto turnoff is challenging. If the inverter draws 75W idleing you will have to have a sensor that only turns on when maybe 100w is asked for.
I don't think this can simply be added to the inverter input wiring?
Doing some math, 75w at 48v = 1.5A idle current.
15A for 10 hours of darkness.
A simple option would add a power relay in the inverter input that can switch 100A. If my math is correct 4000W is 89A at 48v.
The relay can be switched via a wired or inexpensive wireless switch.
Ebay or Banggood sells 12v coil 100-150A power relays. Use a regulator to drop 48v to 12v. The relay coil draws maybe 1/4A 250 ma. When energized.
The power relay would simply be installed in series with the + inverter input wire.
These power relays come with connection typebolts with nuts to accept cable lugs.
The relay coil sw would switch power to the Buck regulator set for 12v output from the 48v battery. When the sw is off, no current would be drawn for the relay coil control.
Another option is to use the voltage from one 12v in the bank for the 12v relay coil voltage source eliminating the regulator.
Typical 100A power 12v relay.
https://www.ebay.com/itm/282068085904
48v in:12v out adjustable regulator
https://www.ebay.com/itm/171247024835