The observed loss of biodiversity calls to create a general theory of ecological physics for better understanding of the events. Due to the inseparable mutuality of organism and environment, ecological physics should combine biophysics (physics of organisms) and environmental physics. We guess that a general theory of ecological physics should include as an abstract physical description of an ecosystem and a tool for its transparent ("white box") modelling. Such a theory should have a system of basic axioms. Here we demonstrate that logical cellular automata allow to create transparent models of ecosystems. The system of basic axioms of the general theory of ecological physics performs the role of the cellular automata rules. We believe that such a transparent mathematical modelling from the first principles is very promising not only for the ecology, but also for modelling of any complex dynamic systems. deterministic inference of white-box models. Here we introduce a physics-based semantics (ontology) of our ecosystem models. Further, we transform this semantics to a set of axiomatic cellular automata rules. An elementary object of our models is a micro ecosystem. This is the basic ideal "self-moving" object of our models. Autonomous dynamics of this object is characterized by a set of states, and the diagram of their sequential change in accordance with the principles of the extreme. Following Tansley, we consider individuals with their ''special environment, with which they form one physical system'' [1]. A microhabitat is the intrinsic part of environmental resources of one individual and it contains all necessary resources for its life. It is an intrinsic part of all environmental resources and conditions per one individual. The high-grade (''fresh'') energy flow of solar radiation provides an individual's life in a microhabitat. The flow of lowered-grade (''used-up'') energy which is produced during an individual's life goes into the cold space and also provides the conditions for an individual's life in a microhabitat. A living organism is not able to function without the heat output to a ''refrigerator''. Ultimately, the cold space performs a role of the refrigerator. A working cycle of a micro ecosystem's processes represents a closed circle, which includes occupation of a microhabitat by an individual and restoration of used resources after an individual's death. A micro eco-system, includes a single microhabitat and is able to provide a single accommodation of one individual, but it cannot provide its propagation. This is due to the fact that after an individual's death, its microhabitat goes into a regeneration (refractory) state, which is not suitable for immediate occupation. A minimal ecosystem, providing a possibility of vegetative propagation of an individual, must consist of two microhabitats. In our models vegetative propagation is carried out due to resources of an individual's microhabitat by placing a finished vegetative primordium of a descendant in a free microhabitat of an indiv...