This paper describes an approach aiming to automatically transform a model depicting a high level physical behavior into two different optimized building energy management application models. Basically, each application requires specific formalism and information therefore it is necessary to rewrite an initial physical behavior model to obtain application models. Up to now, these two application models should be rewritten manually, which is representing an significant work and possibly a source of error. In order to automatize this process, the MDE approach seems to be an appropriate solution. This paper presents core specifications of transformation of hinge model into application models. To illustrate this approach, transformations into both an acausal anticipative model based on a mixed integer linear programming problem and a nonlinear causal model for fast simulated annealing optimization are shown. These models are used for energy management of a smart building platform named "Monitoring and Habitat Intelligent" PREDIS in Grenoble, France.