We propose hereabove two examples of programmes to be modified to adapt them to your uses. The comments indicate what can be changed to personalise them.
The first example allows you to create a lock using 3-axis sensors: acceleration, acceleration without taking into account gravity, rotation speed or magnetic field.
The second example uses 1-axis sensors: pressure, light (Attention, some phones, especially iPhones, do not allow access to this last sensor, and only top-of-the-range smartphones will have all these sensors).
In these examples, the experiment is first launched with the triangular button at the top right, and the secret code is unlocked by holding the smartphone for 2 seconds vertically (1st code) or by lighting it strongly at more than 300 lux for 2 seconds (2nd code). See video.
Edit the files in a text editor (such as the Windows notepad or a program editor). It is possible to set the duration of the manipulation to be carried out, the direction in the case of a 3-axis sensor and the thresholds (e.g. illuminance higher than 1000 lux or lower than 200 lux), the secret code revealed by the application, etc.
However, these example programmes only allow simple handling. It is not possible to link two tests (telephone vertically for 1s then horizontally for 1s) and it is not possible to combine conditions (telephone vertically and light off). Basic programming in XML and reading the Phyphox documentation will allow the most motivated people to do this.