Grain charges in a dusty plasma are determined by the random currents from the ambient plasma and vary with the local conditions. The charge on a slowly moving grain will be close to the locally determined equilibrium, given for zero net current to the grain. For a steady electrostatic structure (e.g., solitary wave, double layer) integrals of motion for grains with varying charge can then be found. (These integrals reduce to the total energy if the charge is constant, but in general the electrostatic term becomes an integral of the grain charge with respect to the potential.) Steady state solutions of Vlasov's equation are piecewise given by arbitrary functions of these integrals of motion. A generalised Sagdeev (Classical) potential can be found, which is, to within an added constant, equal to minus the sum of the total particle pressures (including that of the grains). This extends the well known equivalence found for conventional plasmas and dusty plasmas with constant grain charges. The analysis of dust acoustic solitary waves is modified by additional terms proportional to potential derivatives of the charge. A grain size distribution may be incorporated. The second derivative of the Sagdeev potential (leading to the generalised Bohm condition) is then given in terms of the same effective distribution function as found for linear electrostatic modes. Comparisons are made with several analyses of nonlinear electrostatic structures including dynamical charging.