kea777 wrote:
Sometimes it works as it should, and sometimes it doesn't. I wrote to the DELL forum, and they replied that the problem was with macos...
https://www.dell.com/community/en/conversations/monitors/u3225qe-mac-mini-m4-problem-with-turning-off-computer-monitor-stays-on/69e9db2d8406b515d9532440
I would tend to agree with the response you got in the Dell forum, namely that because the monitor shuts down when you manually shut down the Mac (e.g. specify Shut Down in the Apple menu), the monitor is working as intended.
So why isn't your pmset command working? This article actually suggests some possible reasons:
Schedule your Mac to turn on or off in Terminal - Apple Support
"Your Mac must be awake and you must be logged in for it to shut down at the scheduled time. If you’re not logged in or if your Mac is in sleep, it won’t shut down.
...
If you have any documents open with unsaved changes, your Mac might not go to sleep or shut down when scheduled."
Might any of the above apply to your situation? It seems that certain processes, if running, might prevent shutdown. When you are present, this is not an issue because the system queries the user and based on the response, may continue with the shutdown, but with an automated command, this might not work as intended.
Also, do you have an automated turn on command as well? It seems that with two such pmset commands, only one will be retained unless they both appear on the SAME Terminal command line:
sudo pmset repeat poweron MTWRFSU 7:00:00 shutdown MTWRFSU 19:00:00
turns on at 7am and shuts down at 7pm.