Notification on specific error or increase the retry attempts

I have a switchbot that seems to be working fine most of the time. However sometimes, when HA trigger the script, it’s not able to connect to it (it’s a bit far from my NUC) and I get

2021-05-11 10:51:35 WARNING (SyncWorker_45) [switchbot] Cannot connect to Switchbot. Retrying (remaining: 3)...
2021-05-11 10:51:37 WARNING (SyncWorker_45) [switchbot] Error talking to Switchbot.
2021-05-11 10:51:37 WARNING (SyncWorker_45) [switchbot] Cannot connect to Switchbot. Retrying (remaining: 2)...
2021-05-11 10:51:38 WARNING (SyncWorker_45) [switchbot] Error talking to Switchbot.
2021-05-11 10:51:38 WARNING (SyncWorker_45) [switchbot] Cannot connect to Switchbot. Retrying (remaining: 1)...
2021-05-11 10:51:40 WARNING (SyncWorker_45) [switchbot] Error talking to Switchbot.
2021-05-11 10:51:40 ERROR (SyncWorker_45) [switchbot] Switchbot communication failed. Stopping trying

How can I get a notification on my smartphone when this happens or increase how many times HA tries to send the command?