Skip to main content
12-Amethyst
October 31, 2018
Solved

Real value of property "lastConnection" lost after save thing

  • October 31, 2018
  • 4 replies
  • 2016 views

Hello,

 

I use the value of the "lastConnection" property to display the date of the last connection of the device to server. The problem is that when i save the Thing after a modification of a script in the ThingTemplate the value of the "lastConnection"  gets updated with the current date (I'm losing the date which the equipment  is really connected).

Is it normal?

 

Thank you.

Best answer by rosharma

yes, that's the way it works

4 replies

16-Pearl
November 1, 2018

@amejia1 : definitely this is bound to happen as you put the entity to edit mode the entity will lost connection and once again you save the entity the connection is created thereby updating the last connection with current date/time -- ideally this is the way it shall work

if connection is made and it never breaks then last connection date would never get changed , it would remain the same as it was the first time and if connection breaks due to any interruption then ideally the last connection date should be updated

amejia112-AmethystAuthor
12-Amethyst
November 5, 2018

Hello @rosharma,

 

If I understand correctly I should avoid saving (edit) the Thingtemplate  used by our things if the solution is already used by our customers because all the instances (things) of the ThingTemplate, will lose information about the last connection.

 

Thank you.

rosharma16-PearlAnswer
16-Pearl
November 12, 2018

yes, that's the way it works