Display gateway activity level of redundant sys on a client

I try to use the following code to display gateway redundancy activity level of both gateway on a client :

Inside a 1 sec timer gateway script :

	import system
	from com.inductiveautomation.ignition.gateway import SRContext

	if SRContext.get().getRedundancyManager().isMaster():
		pathCurrentGW = "DIAG/serverM/system/ActivityLevel"
		pathPeerGW = "DIAG/serverB/system/ActivityLevel"		
	else:
		pathCurrentGW = "DIAG/serverB/system/ActivityLevel"
		pathPeerGW = "DIAG/serverM/system/ActivityLevel"		
	
	# Return : Active / Cold / Hot / Undecided / Warm 
	etat = str(SRContext.get().getRedundancyManager().getCurrentState().getActivityLevel())
	system.tag.write(pathCurrentGW,etat)
	
	etat = str(SRContext.get().getRedundancyManager().getPeerConnectionStatus().getActivityLevel())
	system.tag.write(pathPeerGW,etat)	

:scratch: It doesn’t work in all case…

It’s ok when Master is active and backup is warm,
but when I force a failover to the backup :

tag : DIAG/serverM/system/ActivityLevel display active instead of warm as in the web page !

When I restart the Master, with backup actibe, the tag DIAG/serverM/system/ActivityLevel display : undecided instead of active as in the web page ?

Any idea to correct this or another way to achieve this : displaying both gateway redundancy activity level in the client.

Maybe I am misunderstanding your issue, but why aren’t you using the ActivityLevel tag that is already in the tag browser in the Ignition Designer?

In the tag browser under System>Gateway>Redundancy>Activitylevel is where the tag is located. You can just use that tag in your project.

Connor

this issue has been solved in ignition 7.8.4.
My goal was to be able to display gateway redundancy state of both part of the redundant system : the active and the other : warm or another state.