@michlb1982
A couple of things, you put the device to sleep so while it's asleep, it won't respond to the commands to change the relays. Since you are combining relays and sensors, you need to keep the unit awake and find a different way to send the sensor data occasionally. For the relay status, read the comments in the sketch. You are saving the relay state and then reading that on startup. You can eliminate all of that code and just set the relay to off in the setup section.
Cheers
Al
@Zwer2k my expectations seem correct. I created a bug report that also includes a rudimentary workaround.
https://github.com/mysensors/MySensors/issues/1496#issue-968399284