How to get all items that are linked to OFFLINE things (to be used in widgets)

Create a topic in the Marketplace → Rule Template category and follow the instructions of the post. Look at other posts for how to format your code so it looks like a rule template and how to define and use properties. There is also How to write a rule template which I think is still up to date.