@blacey You are right. I don't use eighter NRF24 or RFM69. I have domoticz server and esp with relay connected only. All I want to do is switch on or off my relay connected to esp pin from domoticz. It works for me. I can see that domoticz sends comands to my ESP. I can see that receive function on esp side is executed every time I click on domoticz side. My only problem is "esp restart issue". I would like to ask domoticz for actual status (is it on or off) in esp setup() function to set my relay connected to esp module. Now you know my requirements. If you think my code works but I do it in not a proper way please correct me. If you know how to ask domoticz for device actual status please help me.