cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Reading property values from Remote Thing

Amethyst

Reading property values from Remote Thing

We are setting up an edge device using the Java SDK. Some of the values we want to read are counters - for example cumulative running hours. During startup or reboot of the edge device we would like to read the last value stored in the cloud and continue the counter from there. However, after initialisation it seems that the Virtual Thing automatically sets the value in the cloud to 0.

Is there any way to avoid that this happens?

We have used a bound Virtual Thing and annotations to define the Thing properties

@ThingworxPropertyDefinition(name="Counter",     

    description="The desired temperature",

    baseType="NUMBER",

    aspects={"dataChangeType:NEVER",

              "dataChangeThreshold:0",

              "cacheTime:0",

              "isPersistent:TRUE",

              "isReadOnly:FALSE",

              "pushType:VALUE"})

Immediately after this.initializeFromAnnotations();


The following returns 0 : this.getCurrentPropertyValue("Counter").getStringValue()

I have tried a few combinations of pushType settings but was not successful so far.

Many thanks in advance for your help!

Erik

2 REPLIES 2

Re: Reading property values from Remote Thing

I believe this article will help you: https://support.ptc.com/appserver/cs/view/solution.jsp?n=CS254674

Good luck!

Highlighted

Re: Reading property values from Remote Thing

Try keeping the property persistent.