1"use strict";(self.webpackChunkopenremote_docs=self.webpackChunkopenremote_docs||[]).push([["112694"],{379916(e,t,a){a.r(t),a.d(t,{metadata:()=>s,default:()=>h,frontMatter:()=>u,contentTitle:()=>m,toc:()=>d,assets:()=>p});var s=JSON.parse('{"id":"rest-api/schemas/assetdatapointnearestquery","title":"AssetDatapointNearestQuery","description":"Returns at most one numeric datapoint: the closest value at or before the requested time. Use `fromTimestamp` as a Unix-seconds timestamp at the HTTP API boundary. `toTimestamp`, `fromTime`, and `toTime` are ignored. The equality boundary is inclusive.","source":"@site/versioned_docs/version-1.31.0/rest-api/schemas/assetdatapointnearestquery.schema.mdx","sourceDirName":"rest-api/schemas","slug":"/rest-api/schemas/assetdatapointnearestquery","permalink":"/docs/rest-api/schemas/assetdatapointnearestquery","draft":false,"unlisted":false,"editUrl":null,"tags":[],"version":"1.31.0","frontMatter":{"id":"assetdatapointnearestquery","title":"AssetDatapointNearestQuery","description":"Returns at most one numeric datapoint: the closest value at or before the requested time. Use `fromTimestamp` as a Unix-seconds timestamp at the HTTP API boundary. `toTimestamp`, `fromTime`, and `toTime` are ignored. The equality boundary is inclusive.","sidebar_label":"AssetDatapointNearestQuery","hide_title":true,"hide_table_of_contents":true,"schema":true,"sample":{"fromTime":"2026-01-01T00:00:00Z","fromTimestamp":1767225600000,"toTime":"2026-01-02T00:00:00Z","toTimestamp":1767312000000,"type":"string"},"custom_edit_url":null},"sidebar":"docsSidebar","previous":{"title":"AssetDatapointLTTBQuery","permalink":"/docs/rest-api/schemas/assetdatapointlttbquery"},"next":{"title":"AssetDatapointQuery","permalink":"/docs/rest-api/schemas/assetdatapointquery"}}'),r=a(474848),i=a(28453),o=a(514349),n=a.n(o),l=a(272072);let u={id:"assetdatapointnearestquery",title:"AssetDatapointNearestQuery",description:"Returns at most one numeric datapoint: the closest value at or before the requested time. Use `fromTimestamp` as a Unix-seconds timestamp at the HTTP API boundary. `toTimestamp`, `fromTime`, and `toTime` are ignored. The equality boundary is inclusive.",sidebar_label:"AssetDatapointNearestQuery",hide_title:!0,hide_table_of_contents:!0,schema:!0,sample:{fromTime:"2026-01-01T00:00:00Z",fromTimestamp:17672256e5,toTime:"2026-01-02T00:00:00Z",toTimestamp:1767312e6,type:"string"},custom_edit_url:null},m,p={},d=[];function c(e){let t={code:"code",p:"p",...(0,i.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(l.default,{as:"h1",className:"openapi__heading",children:"AssetDatapointNearestQuery"}),"\n",(0,r.jsxs)(t.p,{children:["Returns at most one numeric datapoint: the closest value at or before the requested time. Use ",(0,r.jsx)(t.code,{children:"fromTimestamp"})," as a Unix-seconds timestamp at the HTTP API boundary. ",(0,r.jsx)(t.code,{children:"toTimestamp"}),", ",(0,r.jsx)(t.code,{children:"fromTime"}),", and ",(0,r.jsx)(t.code,{children:"toTime"})," are ignored. The equality boundary is inclusive."]}),"\n",(0,r.jsx)(n(),{...a(148121)})]})}function h(e={}){let{wrapper:t}={...(0,i.R)(),...e.components};return t?(0,r.jsx)(t,{...e,children:(0,r.jsx)(c,{...e})}):c(e)}},148121(e){e.exports=JSON.parse('{"schema":{"type":"object","allOf":[{"type":"object","description":"Polymorphic historical-datapoint query. Select `all` to return every value, `interval` to aggregate values into time buckets, `lttb` to downsample a numeric or boolean series, or `nearest` to retrieve the last value at or before a time.","discriminator":{"mapping":{"all":{"type":"object","allOf":["circular(AssetDatapointQuery)"],"description":"Returns every stored datapoint in the inclusive range, ordered from newest to oldest. Use this when the complete series is needed without aggregation or downsampling. Supports numeric, boolean, text, and JSON-compatible complex attribute values.","title":"AssetDatapointAllQuery"},"interval":{"type":"object","allOf":["circular(AssetDatapointQuery)",{"type":"object","properties":{"formula":{"type":"string","description":"Aggregation applied per bucket: `MIN`, `AVG`, and `MAX` calculate the corresponding value; `DIFFERENCE` calculates the change between the last values of consecutive buckets;
1 `COUNT` counts datapoints; `SUM` totals numeric values (or true values for booleans); `MODE` selects the most frequent value; and `MEDIAN` selects the middle value. `DIFFERENCE` is numeric only.","enum":["MIN","AVG","MAX","DIFFERENCE","COUNT","SUM","MODE","MEDIAN"]},"gapFill":{"type":"boolean","description":"When true, returns empty buckets across the requested range using time-bucket gap filling; their aggregate is generally null. When false, only buckets containing datapoints are returned. Defaults to false.","example":true},"interval":{"type":"string","description":"PostgreSQL interval literal that sets the bucket width. Include a positive amount and unit, for example `1 hour`, `5 minutes`, or `1 day`.","example":"1 hour"}}}],"description":"Aggregates numeric or boolean datapoints from the inclusive range into aligned time buckets and returns buckets in chronological order. Use this to summarize a series at a regular resolution. Numeric attributes support every formula; boolean attributes support every formula except `DIFFERENCE` and are aggregated as 1 for true and 0 for false.","required":["formula","interval"],"title":"AssetDatapointIntervalQuery"},"lttb":{"type":"object","allOf":["circular(AssetDatapointQuery)",{"type":"object","properties":{"amountOfPoints":{"type":"integer","format":"int32","description":"Requested maximum number of representative datapoints after downsampling. Fewer points are returned when the range contains fewer datapoints.","example":500}}}],"description":"Downsamples numeric or boolean datapoints from the inclusive range with the Largest-Triangle-Three-Buckets (LTTB) algorithm while preserving the series\' visual shape. Use this to reduce a large series for charts. Results are chronological; boolean values are processed as 1 for true and 0 for false. Other attribute value types are rejected.","required":["amountOfPoints"],"title":"AssetDatapointLTTBQuery"},"nearest":"circular(AssetDatapointNearestQuery)"},"propertyName":"type"},"properties":{"fromTime":{"type":"string","format":"date-time","description":"Inclusive lower range bound for `all`, `interval`, and `lttb` as an ISO local or offset date-time. A local value is interpreted in the server time zone; an offset value is converted to the server time zone. Takes precedence over `fromTimestamp` and is ignored by `nearest`.","example":"2026-01-01T00:00:00Z"},"fromTimestamp":{"type":"integer","format":"int64","description":"Inclusive lower range bound as Unix time in milliseconds for `all`, `interval`, and `lttb`; ignored when `fromTime` is supplied. For `nearest` this is instead the requested time in Unix seconds and is the only time field used.","example":1767225600000},"toTime":{"type":"string","format":"date-time","description":"Inclusive upper range bound for `all`, `interval`, and `lttb` as an ISO local or offset date-time. A local value is interpreted in the server time zone; an offset value is converted to the server time zone. Takes precedence over `toTimestamp` and is ignored by `nearest`.","example":"2026-01-02T00:00:00Z"},"toTimestamp":{"type":"integer","format":"int64","description":"Inclusive upper range bound as Unix time in milliseconds for `all`, `interval`, and `lttb`; ignored when `toTime` is supplied and not used by `nearest`.","example":1767312000000},"type":{"type":"string"}},"required":["type"],"title":"AssetDatapointQuery"}],"description":"Returns at most one numeric datapoint: the closest value at or before the requested time. Use `fromTimestamp` as a Unix-seconds timestamp at the HTTP API boundary. `toTimestamp`, `fromTime`, and `toTime` are ignored. The equality boundary is inclusive.","title":"AssetDatapointNearestQuery"},"schemaType":"response"}')}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.