ESPHome 2026.11.0-dev
Loading...
Searching...
No Matches
esphome::motion Namespace Reference

Data Structures

class  CalibrateHeadingAction
 
class  CalibrateLevelAction
 
struct  CalibrationPref
 
class  MotionBinarySensor
 
class  MotionComponent
 
struct  MotionData
 
class  MotionEvent
 

Enumerations

enum  MotionBinarySensorType : uint8_t { MOTION_BINARY_SENSOR_FACE_UP = 0 , MOTION_BINARY_SENSOR_FACE_DOWN , MOTION_BINARY_SENSOR_FREE_FALL , MOTION_BINARY_SENSOR_MOVING }
 

Functions

 ESPHOME_LOG_TAG (TAG, "motion.binary_sensor")
 
 PROGMEM_STRING_TABLE (MotionBinarySensorTypeNames, "face_up", "face_down", "free_fall", "moving", "unknown")
 
 ESPHOME_LOG_TAG (TAG, "motion.event")
 
 ESPHOME_LOG_TAG (TAG, "motion")
 
float orientation_degrees (const MotionData &data, float flat_threshold)
 Compute the device's in-plane orientation from the gravity vector.
 

Variables

struct esphome::motion::CalibrationPref PACKED
 

Enumeration Type Documentation

◆ MotionBinarySensorType

Enumerator
MOTION_BINARY_SENSOR_FACE_UP 
MOTION_BINARY_SENSOR_FACE_DOWN 
MOTION_BINARY_SENSOR_FREE_FALL 
MOTION_BINARY_SENSOR_MOVING 

Definition at line 9 of file motion_binary_sensor.h.

Function Documentation

◆ ESPHOME_LOG_TAG() [1/3]

esphome::motion::ESPHOME_LOG_TAG ( TAG ,
"motion"  )

◆ ESPHOME_LOG_TAG() [2/3]

esphome::motion::ESPHOME_LOG_TAG ( TAG ,
"motion.binary_sensor"  )

◆ ESPHOME_LOG_TAG() [3/3]

esphome::motion::ESPHOME_LOG_TAG ( TAG ,
"motion.event"  )

◆ orientation_degrees()

float esphome::motion::orientation_degrees ( const MotionData & data,
float flat_threshold )
inline

Compute the device's in-plane orientation from the gravity vector.

Returns NAN when the device is flat (lying face up or face down), i.e. when the horizontal component of gravity, normalised by the total acceleration, is below flat_threshold (the sine of the minimum tilt angle). Otherwise returns the rotation snapped to the nearest of 0, 90, 180 or 270 degrees, derived from the direction of the horizontal gravity component.

Definition at line 33 of file motion_component.h.

◆ PROGMEM_STRING_TABLE()

esphome::motion::PROGMEM_STRING_TABLE ( MotionBinarySensorTypeNames ,
"face_up" ,
"face_down" ,
"free_fall" ,
"moving" ,
"unknown"  )

Variable Documentation

◆ PACKED

struct esphome::motion::CalibrationPref esphome::motion::PACKED