Templates only return strings. No way around this. Your best option is to comma separate the result so you can easily parse it if you want to use it in other areas.
I understand the template will return a string, I don’t think that is the issue here. It just needs to return how many UI browser windows are open. It’s only for display in the UI.
This is the line that isn’t working.
It returns 0. I have verified there is a sensor with this attribute so it should return at least 1. I believe the issue here is that “type” isn’t one of the normal state object attributes (name, domain, entity_id etc.) It works as expected if I test for an entity_id or any of the normal state attributes instead of any of the “extra” attributes defined by browser_mod.