Restart a thing if connection is lost or if no new data within xx seconds

I don’t know how to do that in Blockly, but in RulesDSL it’s something like this.

Note that this is an OH3 example, and may have changed somewhat in OH4.

I recommend disabling/enabling on a schedule so that you’re being proactive. Then it’s a simple CRON rule that doesn’t care about the actual status of the thing.