Have you tried ifttt, looks like it does what you want (that device "Fan" is a smart plug).
that could work, triggering ifttt is a faff from shortcuts now, but should work
@rogan started
London Fixed Gear and Single-Speed is a community of predominantly fixed gear and single-speed cyclists in and around London, UK.
This site is supported almost exclusively by donations. Please consider donating a small amount regularly.
Have you tried ifttt, looks like it does what you want (that device "Fan" is a smart plug).