project Utilities / zepp_to_influxdb avatar

utilities/zepp_to_influxdb#6: SpO2 Click Event



Issue Information

Issue Type: issue
Status: closed
Reported By: btasker
Assigned To: btasker

Milestone: v0.4
Created: 08-Aug-23 12:20



Description

When I was working on blood oxygen levels (#2) I could see that there was a click type event, but didn't have any examples of it in order to be able to implement support.

Whilst looking at some other stuff yesterday I observed an event

{
  "items": [
    {
      "userId": "<redacted>",
      "eventType": "blood_oxygen",
      "subType": "click",
      "timestamp": 1691081164000,
      "timezone": "Europe/London",
      "extra": "{\"appName\":\"com.huami.midong\",\"deviceId\":\"<redacted>\",\"deviceSource\":256,\"isAuto\":false,\"sn\":\"<redacted>\",\"spo2\":94,\"spo2History\":[93,94,4,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],\"timezone\":\"Europe/London\",\"timestamp\":1691081164000}"
    }
  ]
}

So the format is pretty much the same as for osa_event. The primary difference, though, is that spo2History list

There are 60 entries in that list - could that be a minute per hour? Or is that maybe the history of manual reads?



Issue Links

Toggle State Changes

Activity


assigned to @btasker

I've just triggered another manual read to see if that turns up as a click event (and if it does, whether we get an extra entry in that list).

Either way, we can extract the other data from the format

I've not had another click event show up in the feed yet. But, the timestamp on the one in the description does line up with when I clicked measure in #2

Will build based on what we have.

I'm going to skip spo2_history for now - at least until we understand what it is (which will probably require a second example for comparison).

That means we're adding a simple series

Fields:

  • spo2_level (float)

Tags

  • blood_event : manual_read
verified

mentioned in commit 8dceade9f937a986ab3cfaa7966a5114dd35ec78

Commit: 8dceade9f937a986ab3cfaa7966a5114dd35ec78 
Author: B Tasker                            
                            
Date: 2023-08-08T18:08:51.000+01:00 

Message

Record SPO2 level from click events (utilities/zepp_to_influxdb#6)

The event does also have a spo2_history attribute, but it's not currently understood what the meaning/granularity of this is, so it's not being captured

+20 -0 (20 lines changed)

marked this issue as related to #2