Skip to main content
Oct 31, 2018 2:53 PM UTC
Solved

Real value of property "lastConnection" lost after save thing

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.

rosharmaAnswer
Nov 12, 2018 5:16 AM UTC

yes, that's the way it works

4 replies

Nov 1, 2018 10:24 AM UTC

@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

amejia1Author
Nov 5, 2018 11:19 AM UTC

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.

rosharmaAnswer
Nov 12, 2018 5:16 AM UTC

yes, that's the way it works