Program for smartphone as HTC controller - XYZ movment

As the title says - Like many others i do not have a HTC vive, so is there a way to use your phone’s gyromomenter and all that stuff to get the directional and rotational movement into unity. some app i am guessing

Your smartphone is not a replacement in any way of the Vive controller.
You will not get any good tracking data just from the acceleration data and gyro.
If positional tracking is not your target and you just need to get the sensor data into a unity instance running on another device you could build a Andorid app (in unity or some another way) and ship this sensor data over network(wireless) over to your main application.

For testing if you can work with the devies sensor data you can use the unity remote app to stream the sensor data over to your editor.