Default values for virtual pins persist after being changed

Good day everyone.

I have found that if I create a datastream within a template (Virtual Pin), I can synchronise with the default value on the remote device.

If I change the default value, the original value persists. For example the value synchronised with the remote device does not change.

The only way I can update the default value is to delete the datastream and recreate it with a new stream.

The issue appears to be server side because if I create a label in the web dashboard and read the virtual pin, the original value also persists.

Q. Am I making a silly mistake or is this a bug?

Cheers
Graham

How did you configure your datastream ?
also, posting the sketch might help.

You appear to need a data invalidation rule set-up (in Advanced within the template) to cause the default value to be displayed within the datastreams view for the device.

I don’t know if this is a bug, or whether it’s this way by design I suspect the latter.

Pete.

Hi Pete.
Thank you for your reply.

You would think that your suggested bypass would work, however it still reports the original default value. I suspect that the 1st / original default value provided to the server is never overwritten once it has been set.

I get that defaults usually don’t change so in 99% of cases the behaviour is OK, but it doesn’t help if you need to change it.
Cheers
Graham

Okay, it seems that you need to do “Erase Latest Value” for the device datastream before changing the default value, and the stuff said about data invalidation before was incorrect.

Pete.

2 Likes

@GDay that’s by design. And Pete’s workaround is correct.

This is done because when devices are connected and received default value they are considered as “setup and working”. The new “default value” should not affect them, because they already have some state that is considered to be correct. Applying a new default value may be undesired. The new default value will be applied only for newly connected devices.

In other words - the default value is used only during the initial device connection (or when the device is reconfigured, reset to the defaults).

Thank you Dmitry & Pete.

Its good to understand the rational. I agree that applying a new default value may be undesired.

Thank you
Graham