@fedyn Thx for reporting back. Just in case you expect anyone to help you further with this, it is necessary to post updated code together with more info what is "not working" (here: the switch/lightning part or the DHT). You may also find some more hints in how to combine relay and non-blocking loop() starting here: https://forum.mysensors.org/post/81401 Btw.: you mentionned 2 DHT in the title of your post, but in the code, there's only one.