We consider online optimization with binary decision variables and convex loss functions. We design a new algorithm, binary online gradient descent (bOG}), and bound its expected dynamic regret. The bound is sublinear in time and linear in the cumulative variation of the relaxed, continuous round optima. We apply bOGD to demand response with thermostatically controlled loads, in which binary constraints model discrete on/off settings. We also model uncertainty and varying load availability, which depend on temperature deadbands, lock-out of cooling units and manual overrides. We test the performance of bOGD in several simulations based on demand response.