Octave Edge Action JavaScript - changing "dh://util/counter/value" odd behaviour

Hi

Ideally I’d have liked a volatile system key, value store - maybe using something like Datahub.write(path,data, 0) but I couldn’t see a way to implement this within an edge action event handler .

I guess that a virtual resource is the method I should use and reorder the implementation so that event handler returns sets the data.

Looking a bit further into this I think it’s likely that virtual resources created from an edge action are volatile. No sure if creating /virtual/config (non-volatile) entries from a edge action is possible.

Anyway - I came across some odd behaviour when I was attempting to use the system counter function as a state machine by setting it’s value on exit from the event handler

image

function(event) {
	var gauge =      [0x01, 0x0B, 0x00, 0x00,   50 ];

	var arrayToCheck = gauge;

	console.log(event);
	console.log(event.value);

	if(event.value > 5)
	{
		return {
			"dh://usp/write": [{"data": arrayToCheck}],
			"dh://util/counter/value": [0]
		}
	}
	else
	{
		return {
			"dh://usp/write": [{"data": arrayToCheck}]
		}
	}
}

However the console produces this

image

But the GUI shows this

image

Any ideas what is happening?

Thanks in advance

John

Hi John,
Can you include your device id so I can investigate a bit further?

Hi David

Thanks

d5db0157f43cdca9ed7dfd2f9

Kind regards

John