dresden-elektronik / deconz-rest-plugin

deCONZ REST-API plugin to control ZigBee devices
BSD 3-Clause "New" or "Revised" License
1.89k stars 496 forks source link

2.7.1: lastcheckin attribute in web socket notification #3869

Closed ebaauw closed 3 years ago

ebaauw commented 3 years ago

Describe the bug

I'm seeing an undocumented lastcheckin attribute in the web socket notifications, but this attribute is not exposed by the API.

Also this new (?) attribute seems to be in UTC, but doesn't end in Z.

Steps to reproduce the behavior

Run deCONZ and monitor the web socket notifications, e.g. through dc_eventlog.

Expected behavior

API and web socket notifications should be consistent.

Newly introduced date/time attributes in UTC should end with Z.

Screenshots

Dec 10 23:49:56 pi6 dc_eventlog[667]: /sensors/5/state: {"lastcheckin":"2020-12-10T22:49:56.733"}
Dec 10 23:49:56 pi6 dc_eventlog[667]: /sensors/6/state: {"lastcheckin":"2020-12-10T22:49:56.733"}
$ ph get /sensors/5
{
  "config": {
    "battery": 100,
    "on": true,
    "pending": [],
    "reachable": true
  },
  "ep": 35,
  "etag": "c30439c7e2d1b15b93861a5d8a9d02ac",
  "lastseen": "2020-12-10T22:51Z",
  "manufacturername": "Develco Products A/S",
  "modelid": "SMSZB-120",
  "name": "Smoke Detector",
  "state": {
    "fire": false,
    "lastupdated": "2020-12-10T22:50:01.462",
    "lowbattery": false,
    "test": false
  },
  "swversion": "2018-11-19 11:09",
  "type": "ZHAFire",
  "uniqueid": "00:15:bc:00:31:00:70:2a-23-0500"
}
$ ph get /sensors/6
{
  "config": {
    "offset": 0,
    "on": true,
    "reachable": true
  },
  "ep": 38,
  "etag": "1a3a2e1ebc0729df39bafacfb72529ab",
  "lastseen": "2020-12-10T22:51Z",
  "manufacturername": "Develco Products A/S",
  "modelid": "SMSZB-120",
  "name": "Temperature 6",
  "state": {
    "lastupdated": "2020-12-10T22:50:57.078",
    "temperature": 2368
  },
  "swversion": "2018-11-19 11:09",
  "type": "ZHATemperature",
  "uniqueid": "00:15:bc:00:31:00:70:2a-26-0402"
}

Environment

deCONZ Logs

Additional context

manup commented 3 years ago

Good catch, not sure yet if it's better to just make the attribute non public for now as it's only used internally to determine that the cluster is working and properly configured (bound). The timestamp refers to the last received Poll Control cluster check-in command.

github-actions[bot] commented 3 years ago

As there has not been any response in 28 days, this issue will be closed. @ OP: If this issue is solved post what fixed it for you. If it is not solved, request to get this opened again.