Creating a group to count how many offline devices there are

You don’t. You can’t do that. At least without a rule you can’t. A Group is a group of Items. Things are not Items.

There is a rule on the marketplace that will call a rule you write when a Thing goes OFFLINE. Thing Status Reporting [4.0.0.0;4.9.9.9]

You can use that to update an Item, update a bunch of Items, keep a count, restart a binding, or what ever it is you want to do in response to a Thing going OFFLINE.

Given that Things are really only something that an admin would care about, you also have the option to search for “OFFLINE” on the Settings → Things page and narrow the list down to those that are OFFLINE.

You can get a list of all the Things that are offline in a rule, In JS Scripting it’s as simple as:

var notOnline = things.getThings().filter( t => t.status != "ONLINE");