11 LOG_EVENT(
"",
"Motion Event",
this);
14 " Cooldown: %" PRIu32
" ms",
19 float ax = data.acceleration[X_AXIS];
20 float ay = data.acceleration[Y_AXIS];
21 float az = data.acceleration[Z_AXIS];
22 if (std::isnan(ax) || std::isnan(ay) || std::isnan(az)) {
34 float dy = ay - this->last_accel_[1];
35 float dz = az - this->last_accel_[2];
36 float jerk_mag = std::sqrt(dx * dx + dy * dy + dz * dz);
uint32_t IRAM_ATTR HOT get_loop_component_start_time() const
Get the cached time in milliseconds from when the current component started its loop execution.
void trigger(const char *event_type)
Trigger an event; the type is matched against the configured types by string compare.
void process_motion_data(const MotionData &data)
uint32_t last_trigger_time_
void dump_config() override
ESPHOME_LOG_TAG(TAG, "motion.binary_sensor")
Application App
Global storage of Application pointer - only one Application can exist.