Smart farming is rapidly revolutionizing the agricultural sector where embedded Internet of Things (IoT) devices are integrated into the field to maintain or improve the quality of products as well as increase food production. Despite the tremendous benefits, various cybersecurity threats of IoT can also be inherited by the sector. In this paper, we propose a lightweight specification-based distributed detection to identify the misbehavior of heterogeneous embedded IoT nodes efficiently and effectively in a closed-loop smart greenhouse farming system. To expand the monitoring space of a node, we exploited the Kalman-filter algorithm and simple statistical operations to obtain estimates of data. Accordingly, this enables a monitoring node to assess a target node that has distinct physical characteristics and access to natural phenomena. Along with this, we derive the behavior-rules that are specific to the target system and carefully translate these rules into a state machine diagram. Besides, we formally verify the functional correctness of the monitoring processes as well as ensure that the behavior specifications are completely covered by using the model checker tool UPPAAL. Through extensive experimental simulation using Proteus, we verify its applicability to resource-constrained embedded devices, e.g., Arduino-Uno, as well as show high accuracy in detecting misbehaving nodes while having low false alarms.