Sonos plugin hang

Hello,
After fiew days, my Ikea sonos hang and no sound will be produced any more
In this cas, the state is “unavailable”
I make a script that send me an mail and I will restart H.A.

Is that a way to correct this behaviour !

Is that possible to restart the plugin by a script ?

Is that possible to restart H.A with a script ?

Thanks for your help.