use a tool such as Home-Assistant or OpenHAB, which are open-source platforms that allow you to simulate a smart home environment and create automations using various devices and sensors
Motion or inertial sensors (e.g., accelerometer), specifically, have been widely used to recognize users' physical activities. This has opened doors for many different and interesting applications in several areas, such as health and transportation.