We propose a solar sensor-based smart farm system to provide high monitoring quality while preserving sensor energy in the presence of adversarial attacks. Since solar sensors are attached to cows to monitor their health under varying weather conditions, ensuring that the system provides energy-adaptive, high-quality monitoring services is critical. Further, the smart farm system should be robust against diverse adversarial attacks that will disrupt its monitoring quality. We use deep reinforcement learning (DRL) to identify the optimal policy for maximizing monitoring quality and prolonging the systemâ\euro™s lifetime while maintaining sufficient energy. We introduce transfer learning (TR) into the DRL process to achieve fast learning by DRL without experiencing a cold start problem. In addition, we develop an uncertainty-aware anomaly data detection method to filter out deceptive data caused by adversarial attacks. Via extensive comparative performance analysis conducted in our experiments based on real datasets, we demonstrate the superior performance of TL-based DRL strategies over other competitive counterparts regarding system lifetime, monitoring quality, learning convergence time, and energy consumption.