![Thanks for your replies. Actually, the problem is to trigger the pulse of the relay with the function "delay". It is working but sometimes during the "delay" function, the gateway has not received the information of the first pulse yet. So, the second pulse "digital write..." will not work. I will have to press several times. It is a coding optimization i think.
For the status i have used a ACS712 sensor to know if the light is on or off.
i attached for you the electrical diagram of the "standard" impulse relay on a french house installation which is located in the main board in the garage. Push button are connected. This relay is trigger with 2 quick pulses when you press the push button, then the light will turn on or off. To insert Mysensors project to this original electricall installation i directly connected the mysensors Node with an NO NC relay directly on the same wires than the push button. From the gateway, i trigger the relay with 2 pulses.
[image: 1535352299463-telerupteur.jpg]