But the state shown is vibration_sensor, which does not make sense.
What I can do in order to display state as On (vibration detected) or Off (vibration clear) mentioned in vibration device class of Binary sensor - Home Assistant?
Well first off all; You created a template sensor, but what you want is a template binary_sensor. But I don’t think the battery sensor has the value vibration_detected (yes/no). Does the event_id change when the sensor detects vibrations??