I have decided to vote to close this and to radically update the other question, where I expect an answer.
As the error was Error org.freedesktop.DBus.Error.UnknownMethod: No such method 'Suspend'
, after the comment made by Nick Sillito under this question linking to this answer, I have modified the script in what I expect to be a rather barbaric manner (I'm CL-illiterate myself); I've simply replaced this entire part:
dbus-send --system --print-reply --dest="org.freedesktop.UPower" /org/freedesktop/UPower org.freedesktop.UPower.Suspend
with
systemctl suspend
As indicated in the comment made by wjandreea: sleep 10
or a similar value shouldn't be removed (as I initially did); without that line, the modified script will use more power because instead of running every 10 seconds, it will as fast as possible -- upwards of several dozen times per second.
At this point he system goes to sleep when going above the level set in the line
max="+75.0"
As I want a higher value, 82, the script I use is:
#!/bin/bash
while true; do
val=$(sensors | awk '/temp1/ {print $2}')
max="+82.0"
if [[ "$val" > "$max" ]]; then
systemctl suspend
fi
sleep 10
clear
sensors
done
exit 0