For years, I have used a GY-521 sensor on an ESPHome device to monitor my laundry. The code has used a custom component which I copied the code from somewhere…but it’s identical to the one posted here:
I just updated my ESPHome instance and now in order to update this device I understand I have to switch to an external component. I have no idea how to do that, nor franky, no interest. But I see there is a built in component here:
I have spent hours today trying to use that component in an equivalent manner, yet I get no data from the sensor, and my derivative sensors all return nan. Is it compatible with the GY-521, specifically, this one?
I had an idea to use the accelerometer in my m5 atom device as a vibration sensor so I could tell if my generator was running or not.
Since you have this on a dryer, I am guessing that you are probably doing something similar. If so, you probably don’t really care about the gyro. You really probably don’t need to know where in 3-space your dryer is. You just need to know if it is moving or not.
The calculations you are doing are probably excessive and probably should be done more frequently to get a better answer.
Mine gets the raw values from the accelerometers more frequently, but uses the raw numbers and compares to the last value. If it exceeds a settable threshold it increments a counter. Every settable period for the vibration sensor, it returns the counter and the resets it.
This seems to work pretty well for both my generator and my HPWH, but with different thresholds. In my generator it can sense when I open the cover, but not when I just walk by it.