Help with IPPING diagnostic

Good afternoon, I need some advice. I want to attach ping diagnostics to the device page. I made the following settings in the config

- label: "'Ping Diagnostic'"
  parameter: InternetGatewayDevice.IPPingDiagnostics
  type: "'parameter-list'"
  parameters:
    - label: "'Status'"
      parameter: InternetGatewayDevice.IPPingDiagnostics.DiagnosticsState
    - label: "'Host'"
      parameter: InternetGatewayDevice.IPPingDiagnostics.Host
    - label: "'Count'"
      parameter: InternetGatewayDevice.IPPingDiagnostics.NumberOfRepetitions
    - label: "'Min'"
      parameter: InternetGatewayDevice.IPPingDiagnostics.MinimumResponseTime
    - label: "'Max'"
      parameter: InternetGatewayDevice.IPPingDiagnostics.MaximumResponseTime
    - label: "'Success'"
      parameter: InternetGatewayDevice.IPPingDiagnostics.SuccessCount

But the -label “Ping Diagnostic” was not displayed in the device page
image

And how after passing the parameter “InternetGatewayDevice.IPPingDiagnostics.DiagnosticsState” - “Requested”. Update the same tree so that the parameter switches to the “Complete” state and shows the results. Thanks in advance for any help or advice

There are two ways of accomplishing this.

Create a provision which blindly refreshes any of the diagnostic nodes you use in your environment (IPPing, UDPEcho, Download, Upload). Use a preset which listens for the 8 DIAGNOSTICS COMPLETE event to kickoff the provision. This is the easiest route.

The better approach requires a lot more work. You need to create a v-param to track which diagnostic test was initiated. Then, in the provision script, use the value of your vparam to determine which parameter to refresh. This is the approach I use.

Now I’m faced with another problem. After ping diagnostics, I want to check for SuccessCount from the declared NumberOfRepetitions. When I try to retrieve data after updating the IPPingDiagnostics branch.

let successCount = declare("InternetGatewayDevice.IPPingDiagnostics.SuccessCount", {value: now});
log('Success Count:', successCount.value[0]);

Then if the value is 0. It will show the message
image
but if it is 10 then it will be an empty string
image
But if you just put .value in the log

log('Success Count:', successCount.value);

It will be like this in the logs
image