Have you looked at the relay with button example sketch? Then look also here https://forum.mysensors.org/topic/1703/relay-with-switch/4 You don't have to to read relay status because you are controlling it, so whenever you are doing the digitalwrite just set the relaystate with the same value