Skip to content

getCurrentDataPoints

Get the latest value for one or more tags.

getCurrentDataPoints(tags, output="json")

  • tags (str | list[str])
  • output (str): json (default), df, raw, string
  • tags: Tag name or list of tags to read the latest values from.
  • output: Output format selector.
value = hm.getCurrentDataPoints("DEMO_02TI301.PV")

Output:

{
"timestamp": "2024-01-01T12:00:00Z",
"value": 38.1,
"status": "OK"
}
values = hm.getCurrentDataPoints(["DEMO_02TI301.PV", "DEMO_02TI201.PV"])

Output:

{
"DEMO_02TI301.PV": {
"timestamp": "2024-01-01T12:00:00Z",
"value": 38.1,
"status": "OK"
},
"DEMO_02TI201.PV": {
"timestamp": "2024-01-01T12:00:00Z",
"value": 42.0,
"status": "OK"
}
}
latest = hm.getCurrentDataPoints("DEMO_02TI301.PV", output="df")

Output (df):

DEMO_02TI301.PV
2024-01-01 12:00:00 38.1
latest_df = hm.getCurrentDataPoints(
["DEMO_02TI301.PV", "DEMO_02TI201.PV"],
output="df",
)

Output (df):

DEMO_02TI301.PV DEMO_02TI201.PV
2024-01-01 12:00:00 38.1 42.0
raw = hm.getCurrentDataPoints("DEMO_02TI301.PV", output="raw")

Output:

{
"results": {
"DEMO_02TI301.PV": {
"dataPoint": { "timestamp": 1704110400000, "value": 38.1, "status": "OK" }
}
}
}
raw = hm.getCurrentDataPoints(
["DEMO_02TI301.PV", "DEMO_02TI201.PV"],
output="raw",
)

Output:

{
"results": {
"DEMO_02TI301.PV": {
"dataPoint": { "timestamp": 1704110400000, "value": 38.1, "status": "OK" }
},
"DEMO_02TI201.PV": {
"dataPoint": { "timestamp": 1704110400000, "value": 42.0, "status": "OK" }
}
}
}