AnsweredAssumed Answered

Filter PI Web API Results by Time of Day?

Question asked by MattSidor on May 1, 2018
Latest reply on May 2, 2018 by MattSidor

Is it possible to filter the Interpolated Stream results for a given Web ID by time of day?

 

e.g. only return values between given startTime and endTime, at given interval, that occur between 7:00 AM and 11:00 PM each day

 

This is an example query URL for one month of data (January 2018) at 1-hour interval that does not filter the results by time of day:

https://some-pi-server.com/piwebapi/streams/[some-web-id]/interpolated?startTime=2018-01-01&endTime=2018-01-31&interval=1h

Can this URL be modified to only return results between 7:00 AM and 11:00 PM each day? Or, is there another query URL that can accomplish the same thing?

Bonus related question: can I filter the results to only return weekdays? (i.e. exclude any results that fall on a Saturday or Sunday)

Outcomes