I think i solved it by replacing the tripped code with this modificed code from
https://codebender.cc/example/MySensor/BinarySwitchSleepSensor#BinarySwitchSleepSensor.ino
{
uint8_t value;
static uint8_t sentValue=2;
// Short delay to allow buttons to properly settle
sleep(5);
value = digitalRead(BUTTON_PIN);
if (value != sentValue) {
// Value has changed from last transmission, send the updated value
send(msg.set(value==HIGH ? 1 : 0));
sentValue = value;
}