You returning value of original DCI in your transformation script, but if you want cumulative counter, you should return sum of current value of your dummy DCI and current value of original DCI, something like
GetDCIValue($node, dci->id) + GetDCIValue($node, $dci->id)
($dci refers to current DCI being processed).
And to reset the counter - check if last poll time for your dummy DCI is in different month, and return 0 in that case, like this:
if (strftime("%m", $dci->lastPollTime) < strftime("%m", time()))
return 0;
Best regards,
Victor
GetDCIValue($node, dci->id) + GetDCIValue($node, $dci->id)
($dci refers to current DCI being processed).
And to reset the counter - check if last poll time for your dummy DCI is in different month, and return 0 in that case, like this:
if (strftime("%m", $dci->lastPollTime) < strftime("%m", time()))
return 0;
Best regards,
Victor