In the case of a washing machine, it turns out that it is better to check that the stimulation occurred in ANY axis.
I wrote a script to implement this using rules. It works much better than the original motion detection included in the driver.
My suggestion is that there should be, for example, a checkbox toggling between ANY/ALL axes.
Below is a proposition of the driver part _P045_MPU6050.ino for a function that executes ANY instead of ALL axes.
Code: Select all
boolean thresexceed = false; // changed from true to false
uint8_t count = 0; // Counter to check if not all thresholdvalues are set to 0 or disabled
for (uint8_t i = 0; i < 3; i++)
{
// for each axis:
if (PCONFIG(i + 2) != 0) { // not disabled, check threshold
if (P045_data->_axis[i][2] > PCONFIG(i + 2)) { thresexceed = true; } // changed < to > and false to true
} else { count++; } // If disabled count + 1
}
// the line below is not necessary now
if (count == 3) { thresexceed = false; } // If we counted to three, all three axis are disabled.
// If ANY (not all) enabled thresholds are exceeded the increase the counter
if (thresexceed) { PCONFIG_LONG(0)++; }