MySensors usb gateway

I’m pretty sure that I saw a topic about my problem in here but can’t find it enymore.
Anyway, I have MySensors gateway (Adruino Mega2560) connected to my RPi via USB which controles my SSR-relays and wall buttons (light contol). It works pretty smooth with one exception. When I try to turn on/off one of lights in Hass dashboard, it’s state doesn’t change, but it works perfectly when I use wall button. Its probably code issue. Since I’m not a programer at all, I really need your help guys.

code
https://pastebin.com/embed_js/agcrirAN