Get Default tagprovider in Perspective project

Hi all,

I need to add filters to my alarm lists in a Perspective sessions. I would like to add source as a filter. This would work with Vision, but not perspective. Any ideas on how to get this variable? Thanks.

provider = "*"+system.tag.read("[System]Client/System/DefaultTagProvider").value+"*"
return len(system.alarm.queryStatus(state=["ActiveUnacked"],source=provider))

Answering myself:

system.tag.getConfiguration() will give you the tag provider, but it needs to be processed further to get only the tagprovider info.

Wouldn’t your first Script Transform loop for EVERY tag? There’s no guarantee of getting the default provider if you also have others.

Bit unsure if we follow? It has been tested on gateways with multiple providers.

The docs led me to believe getConfiguration() expected arguments, but it looks like we default back to the default provider of the project when running in the Perspective context.

Your script can actually be “simplified” a bit, and contained in one transform:

project_default_provider = '*' + str(system.tag.getConfiguration()[0]['path']).lstrip('[').rstrip(']') + '*'
return len(system.alarm.queryStatus(state=['ActiveUnacked'], source=[project_default_provider]))
1 Like

Thanks for the input. :slight_smile: