Now-a-days, the Internet of Things (IoT) has generated enormous interest from industry to create distributed and innovative solutions. However, achieving this goal is a tedious task and presents several open challenges as the literature points out. One of the most complex is the IoT coordination service. Unfortunately, most research works give rarely importance to this service in their models or architectures proposals. Wherefore our current contribution deals with this open issue and proposes a solution capable of implementing advanced processes that can be based on orchestration, choreography or both mechanisms. More over and to conduct efficiently both coordination mechanisms when sharing knowledge or tasks between connected objects, we integrate smart contacts to guarantee the modalities of behavior change in the coordination mechanism. Smart contracts are a safe way to decide the coordination mechanism based on the state of the system environment. To prove our approach, we have built a technical architecture based on a multi-agent system to abstract connected objects of IoT systems, blockchain technology, and the frameworks and languages required for collaboration processes such as BPMN, BPEL and BPEL4CHOR. Carbon leakage as a case study is used for experimentation.