The generic things don’t support the battery interface and it’s not really an option to add that, given that most use cases for them won’t support that. So it would leave users with a non working battery icon.
You could achieve this by creating a plugin though. You could create your custom generic things with battery states (and whatever else you’d desire). The plugin code would not really need to do anything this way. Just return ok in setupThing() and a one-liner in executeAction() to store the values.
Of course, depending on your programming skills, you could directly connect to mqtt from there and not need the nymea script any more at all. This way it could even evolve into a proper openzwave plugin eventually.