With the gradual increase in the degree of factory production of edible fungi, automated control of the growth environment of edible fungi is particularly important. This paper utilizes the advantages of electrical automation technology to monitor the growth environment of edible fungi and regulate the environmental parameters of edible fungi factory production. Combined with the working principle of automation control systems, the fuzzy PID control algorithm is used to optimize the automatic control of edible mushroom factory production. By controlling and regulating the temperature and humidity of the growth environment of edible fungi, you can differentiate the automatic growth environment of edible fungi. Using fuzzy PID control technology to regulate the environmental conditions required for the growth and development process of PU Mushroom 1, we compared the seasonal mushroom production of PU Mushroom 1 with the mushroom production after applying the control system of the edible fungus growth environment. We compared the growth of the control area and the application area in terms of the rate of infection by stray bacteria at the mycelium stage of the almond abalone mushroom. The indoor temperature profile of the edible mushroom production environment controlled by fuzzy PID changed gradually, and the difference in temperature between day and night was reduced by 4.41°C compared to that outside. Regulating the opening of the greenhouse roller shutter prevented the indoor humidity from rising rapidly with the increase of outdoor moisture, which played a good role in humidity reduction. After applying the edible mushroom growth environment control system, the average yield of fresh mushrooms was 322.377g/bag, which was 33.7% higher than that of seasonal mushroom production. It shows that the application of automatic control technology for edible mushroom factory production can accurately assess and regulate the temperature, humidity, and other environmental conditions during the growth and development of edible mushrooms, which can promote the production capacity of edible mushrooms.