No history: "Missing required key: sources"

Possibly related to Generic Temperature Sensor No History, although the error I get is different.

I’ve configured a Lumi magnet sensor (Aqara MCCGQ11LM, shown as “LUMI - lumi.sensor_magnet.aq2 in the app), and it works flawlessly, except that when I click to show the history, no history data is displayed.

Logs:

  • after I open the sensor in the app (no problems so far):
 I | LogEngine: Running query: "SELECT * FROM discrete.\"state-{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}-closed\" WHERE time >= 1702640889826ms AND time <= 1702917369826ms ORDER BY time DESC"
 I | LogEngine: start QDateTime(2023-12-15 12:48:09.826 CET Qt::LocalTime) end QDateTime(2023-12-18 17:36:09.826 CET Qt::LocalTime)
 I | LogEngine: Request: QUrl("http://127.0.0.1:8086/query?db=nymea&q=SELECT * FROM discrete.%22state-%7Bxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx%7D-closed%22 WHERE time %3E%3D 1702640889826ms AND time %3C%3D 1702917369826ms ORDER BY time DESC&epoch=ms") QMap()
 I | LogEngine: Reply {
    "results": [
        {
            "series": [
                {
                    "columns": [
                        "time",
                        "closed"
                    ],
                    "name": "state-{xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}-closed",
                    "values": [
                        [
                            1702821491061,
                            true
                        ],
                        [
                            1702821483565,
                            false
                        ],
                        […]
                    ]
                }
            ],
            "statement_id": 0
        }
    ]
}
  • When I open the history chart:
 W | JsonRpc: JSON RPC parameter verification failed for method "Logging.GetLogEntries"
 W | JsonRpc: "Missing required key: sources" in "Logging.GetLogEntries, param sources"
 W | JsonRpc: Call params: {
    "limit": 1000,
    "offset": 0,
    "thingIds": [
        "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
    ],
    "typeIds": [
        "yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy",
        "zzzzzzzz-zzzz-zzzz-zzzz-zzzzzzzzzzzz"
    ]
}

 W | JsonRpc: JSON RPC parameter verification failed for method "Logging.GetLogEntries"
 W | JsonRpc: "Missing required key: sources" in "Logging.GetLogEntries, param sources"
 W | JsonRpc: Call params: {
    "limit": 1000,
    "offset": 0,
    "thingIds": [
        "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
    ],
    "typeIds": [
        "yyyyyyyy-yyyy-yyyy-yyyy-yyyyyyyyyyyy"
    ]
}

Any idea why?

This looks like it’s trying to fetch logs using the old api… Could you please explain exactly from where/how you’re opening the chart?

I’m opening the chart in nymea:app:

  • iOS version: 1.8.25 (Qt version: 5.15.12)
  • macOS version: 1.8.25 (Qt version 5.15.9)

The nymea:core server runs in a Raspberry Pi 4 and was installed with the Raspberry Pi Imager. The server version is 1.8.3+202308171425~bullseye+rpi1.

From the main view, I simply choose a sensor and then touch/click on the upper-right icon (circled in red):

The chart turns out to be empty and the debug interface logs the errors.

FWIW, I’ve tried the latest macOS beta (v1.8.32) to the same results.

Oh, I see, the signal strength icon… Good catch.

Are there other ways to access the history data or a history chart?

You can see them by opening the details for a thing, then press on any state which will open a menu from the side with a button to open the logs for that particular state

1 Like

Finally I’ve managed to fix this one. Thanks for the report

1 Like