This paper presents a unified model for home energy management. The proposed model optimizes the cogeneration of wind, solar, and battery storage units. The introduced tool considers electric and hydrogen vehicles and provides optimal charging pattern for them. The water electrolyze is also modeled to produced breathable oxygen and hydrogen from water. As well, the load modeling options such as adjustable and interruptible loads are included in the planning in order to increase the flexibility and adeptness of the proposed energy management system. The uncertainties of wind and solar powers are included resulting in a stochastic programming. The proposed stochastic optimization problem is mathematically expressed as a mixed integer linear programming and solved by GAMS software. The problem minimizes cost of energy consumption in the building subject to the operational constraints of wind unit, solar panel, battery system, loads, electric-hydrogen vehicles, and electricity grid. The proposed test building is studied under two states including connected to the electrical grid and disconnected from the gird (i.e., islanding mode or NetZero energy home). The impacts of the proposed planning on the environmental pollution are also considered and simulated. The results verify that the proposed strategy can successfully utilize wind-solar-battery units to supply the load, charging the electric-hydrogen vehicles, and reduction of the pollution. As well, it is demonstrated that the operation of the home under islanding mode is completely different from the connected state.