This work consists of a multi-objective mixed-integer linear programming model for defining optimized schedules of components in a grid-connected microgrid. The microgrid includes a hydrogen energy system consisting of an alkaline electrolyzer, hydrogen cylinder bundles and a fuel cell for energy storage. Local generation is provided from photovoltaic panels, and the load is given by a fixed load profile combined with a flexible electrical load, which is a battery electric vehicle. The electrolyzer has ramp-up constraints which are modeled explicitly. The objective function includes, besides operational costs and an environmental indicator, a representation of peak power costs, thus leading to an overall peak load reduction under optimized operation. The model is used both for controlling a microgrid in a field trial set-up deployed in South-West Germany and for simulating the microgrid operation for defined period, thus allowing for economic system evaluation. Results from defined sample runs show that the energy storage is primarily used for trimming the peak of electricity drawn from the public grid and is not solely operated with excess power. The flexible demand operation also helps keeping the peak at its possible minimum.