I've found a possible solution, but it's not working properly. I found this bash script on linux
if fping -c 1 -t 5 ISP1-IP &> /dev/null
then
echo 1
else
echo 0
fi
fping is similar to ping, but fit for scripts. -c 1 makes it send a unique ping and -t 5 makes it timeout in 5ms. ISP1-IP is an IP on ISP1's intranet that's the closest to me.
Pinging this IP through ISP1 is much quicker than through ISP2. If RV340 sends this ping from WAN1 it succeeds and if sent from WAN2 it fails. This way I can create some monitoring.
The problem is that RV340 is always using WAN1 for all pings. This makes the same code for ISP2's IP to always go through ISP1, and always fail.
I double checked and WAN > Mult-WAN has WAN1 and WAN2 both with precedence 1 and percentage 50%. Why are all pings going through WAN1, even when WAN2 is closer?