Use Pir motion sensor from GrovePi to Grove hat

Hello there,
I have a program using Pir motion sensor on GrovePi coming from grovepi library and I want to use it on Grove hat, can someone help me to “convert” my script to Grove hat compatibility ?

on the wiki I note that pir sensor need to be plugged on pin 12 (gpio) instead of digital plug.
I tried to reuse the script but its more complex.

I simply use this lines :

import time
import grovepi
pir_sensor = 8

while True:
# Sense motion, usually human, within the target range
if grovepi.digitalRead(pir_sensor):
print ‘Motion Detected’
print ‘-’

Thank you in advance