Demand charges can be specified in the grid component. Demand charges are determined by multiplying the peak usage in a month by the demand charge specified under the "Rate schedule". If you have two (or more) demand charges specified during a month, those will be independently calculated and summed for the month based on the peak usage for each rate period.
Demand charges in HOMER do not impact the dispatch decisions during simulation.
If you use Real time prices (i.e. import a text file that contains both Price and Sellback rates), demand charges must be specified in the Rate schedule.