Hi,
Referring to these discuss post and help link should give you the direction.
https://erpnext.com/docs/user/manual/en/human-resources/auto-attendance