Internet of Things (IoT) applications are naturally dynamic in that unexpected changes and failures may occur on smart devices, on network connection and interaction between the devices, or in the environment where they are situated. To maintain the robustness of IoT applications, smart devices should be able to adapt the way they operate upon changes and failures. However, the adaptive capability of smart devices may cause IoT applications to exhibit unpredictable behavior at runtime, and thus the adaptive behaviors should be implemented in a simulated environment before they are realized in the actual environment. This paper proposes a programming language extended from AgentSpeak(L) for implementing adaptive smart devices as multiagent systems. To easily implement adaptive behavior, the programming language should allow the separation of adaptive capabilities and core functionalities. Such feature has not been supported by existing agent-oriented programming languages that tend to mix the two. The case study demonstrates that the proposed language improves maintainability of the programs compared to that of AgentSpeak(L).