We have moved at community.getvera.com

Author Topic: openLuup : device variables and timestamp  (Read 4101 times)

Offline akbooer

  • Moderator
  • Master Member
  • *****
  • Posts: 6387
  • Karma: +291/-70
  • "Less is more"
Re: openLuup : device variables and timestamp
« Reply #15 on: February 12, 2016, 01:40:02 pm »
Oh, well done!  This would explain why I never saw it, because I am not using lighttpd!
3x Vera Lite-UI5/Edge-UI7, 25x Fibaro, 23x TKB, 9x MiniMote, 2x NorthQ Power, 2x Netatmo, 1x Foscam FI9831P, 9x Philips Hue,
Razberry, MySensors Arduino, HomeWave, AltUI, AltHue, DataYours, Grafana, openLuup, ZWay, ZeroBrane Studio.

Offline vosmont

  • Beta Testers
  • Hero Member
  • *****
  • Posts: 687
  • Karma: +60/-8
Re: openLuup : device variables and timestamp
« Reply #16 on: February 29, 2016, 04:11:24 am »
it seems that the timestamp of the last update of a device variable is not stored ?
After a reload, "luup.variable_get" doesn't return the right timestamp, for a value that has changed before the restart (seems to be the timestamp of the reload).

I've just discovered that the Vera works the same.
Code: [Select]
local value, timestamp = luup.variable_get("urn:micasaverde-com:serviceId:SecuritySensor1", "Tripped", 205)
will give the most recent tripped or the last luup reload.
arrr !!!! (will have to change some internal things in my plugins :()

Offline akbooer

  • Moderator
  • Master Member
  • *****
  • Posts: 6387
  • Karma: +291/-70
  • "Less is more"
Re: openLuup : device variables and timestamp
« Reply #17 on: February 29, 2016, 05:02:46 am »
Yes, that's true.  I checked back in November when you raised the issue.  There is nowhere in the user_data.json file where that information is persisted.  This is why some devices (power meter, for example) have their own device variable to save it explicitly.

Sorry I didn't feed this back at the time, but you didn't press the issue then!
3x Vera Lite-UI5/Edge-UI7, 25x Fibaro, 23x TKB, 9x MiniMote, 2x NorthQ Power, 2x Netatmo, 1x Foscam FI9831P, 9x Philips Hue,
Razberry, MySensors Arduino, HomeWave, AltUI, AltHue, DataYours, Grafana, openLuup, ZWay, ZeroBrane Studio.