Break it down.
- Detect all six ping devices are OFF
- Detect all six ping devices are off for 30 seconds (I’m assuming the ping polling period is 15 seconds on the Network binding Thing, it’s 60 seconds by default so you may want to double check that)
- Tell the shelly to power off
- Tell the shelly to power off, wait a few seconds and then power back on again
If you break it down like this with incremental steps it doesn’t sound so hard.
For 1, use a Group:Switch with an “all ON then ON else OFF” aggregation function. The state of the Group will only become off when all members are off.
For 2, consider using Debounce [3.2.0;3.4.9]. The Group created in 1 will become the “raw Item” and you will create a new proxy Item which will get commanded to OFF only when the Group remains OFF for 30 seconds.
For 3 I hope you already know how to do that.
Finally, for 4 you’ll create a rule that triggers when the Proxy Item from 2 is commanded to OFF. In that rule, command the shelly to OFF, set a timer for 30 seconds or so and then command the Item back to ON.
If you want to get fancy and have it try again, in addition to commanding the shelly to ON, command the Group created in 1 to ON which should update all the ping Items to ON too. Then if they go OFF again even after the restart the whole process will kick off again and a second reboot will occur and repeat until at least one of those ping devices come back ON.