@gohan hmmmm. Well problem with this is, that I will need to redo this everytime I purge the config of my MySensor network within homeassistant, and I know that will happen almost each time I add a Node, so on the long run this will be annoying.
I found another suuuper hacky solution.
Within the NodeManager.cpp
I edited the onLoop function of the underlying SensorDigitalOutput. This is the method the SensorRelay inherits from.
void SensorDigitalOutput::onLoop() {
// set the value to -1 so to avoid reporting to the gateway during loop
//_value_int = -1;
//_last_value_int = -1;
// if a safeguard is set, check if it is time for it
if (_safeguard_timer->isRunning()) {
// update the timer
_safeguard_timer->update();
// if the time is over, turn the output off
if (_safeguard_timer->isOver()) setStatus(OFF);
}
}
I commented out the _value_int = -1;
and the _last_value_int = -1;
. Now it reporst the reading once upon a node start. I guess setTrackLastValue
is set to true somewhere.
Maybe it possible to add another method to the SnesorDigitalOutput, that allows to toggle these -1 settings in the loop.