@sultan-y
To get the PIR sensor working with MM on the currently latest Raspberry PI OS Bullseye you can use /usr/bin/vcgencmd display_power 0/1 instead of using the tvservice command (I run it in a script started by crontab at reboot).
I also
added /usr/bin/xrandr -display :0.0 --auto before the vcgencmd command added user Pi to the gpio group: sudo usermod -a -G gpio pi, and I added XAUTHORITY=/home/pi/.Xauthority here: sudo vi /etc/environmentMy mirror uses a DVI to HMI output, but using xrandr and XAUTHORITY as above solved the issues I had.
Btw, I use
/usr/bin/chvt 6 /usr/bin/chvt 7after the /usr/bin/vcgencmd display_power 1 command, but that was used prior to using Bullseye as well.