LogoLogo
  • Welcome to the MOOST platform user manual
  • Platform Manual
    • Login
      • Forgot Password
    • Notifications
    • Rules
      • Rule Configurator
        • Data graph
        • Datasets
        • Condition
        • Streak
        • Message
        • Settings
        • Rule Simulator
        • Early Adopter
        • Command
      • Rule Language
        • Syntax
        • Data Types
        • Data Structures
        • Functions
          • AVG
          • COUNT
          • DISTINCT
          • EVAL
          • FILTER
          • GROUP_BY_DEVICE
          • GROUP_BY_TIME
          • MAX
          • MIN
          • POSITION
          • REVERSE
          • SORT
          • SUBSET
          • SUM
        • Operations
          • Plus
          • Minus
          • Multiply
          • Divide
          • Negate
          • Less Than
          • Less or Equal
          • Equal
          • Not Equal
          • Greater or Equal
          • Greater
          • AND
          • OR
          • NOT
          • Format
          • Attribute Accessor
        • Examples
    • Events
    • Buildings
      • Household Profile
    • User Profile
    • Billing Portal
      • Payment Method
      • Update Payment Address
      • Invoices
      • Terminate Subscription
    • Context Services
      • Weather Forecast
      • Solar Production Forecast
      • Power Consumption Forecast
      • Power Generation Forecast
    • Support Center
  • Technical Integration
    • Cloud-to-Cloud Integration
      • Platform On-boarding
      • Configure Notification Settings
        • Receive Notifications
          • iOS Notification Handling
      • MOOST API Integration
        • Request Access Token
        • Synchronize Buildings and Devices
          • Device Types
        • Add Events
          • Event Types
            • Device Status
            • Charging Modes
            • Switch State
        • Notifications and Interactions
          • Return Notification Interaction
  • Best Practices
    • FAQ
    • User Acceptance Testing
  • Policies
    • Security Policy
    • Privacy Policy
Powered by GitBook

© 2025 MOOST AG

On this page
  • Description
  • GROUP_BY_TIME(Vector<Event>, Scalar<Timespan>)
  • GROUP_BY_TIME(Vector<Event>, Scalar<Timespan>, Scalar<Time>)
  • Examples
Export as PDF
  1. Platform Manual
  2. Rules
  3. Rule Language
  4. Functions

GROUP_BY_TIME

Description

Converts vector to a grouped vector, by gouping by timespans, so that we have a list of events per timespan. The timespan either is fixed on the latest event, or can be fixed on another time if specified.

GROUP_BY_TIME(Vector<Event>, Scalar<Timespan>)

GROUP_BY_TIME(vector: Vector<Event>, timespan: Scalar<Timespan>): GroupedVector<Time,Event>

Groups the events in the given vector in spans defined by timespan, starting from the latest event.

Parameters

Parameter
Description

vector

A vector of type Event

timespan

A timespan in which the events should be grouped

Returns

A GroupedVector of type <Time, Event>.

GROUP_BY_TIME(Vector<Event>, Scalar<Timespan>, Scalar<Time>)

GROUP_BY_TIME(vector: Vector<Event>, timespan: Scalar<Timespan>, time: Scalar<Time>): GroupedVector<Time,Event>

Group the vector in the given timespans starting at the given time.

Parameters

Parameter
Description

vector

A vector of type Event

timespan

A timespan in which the events should be grouped

time

The time form which we want to start grouping.

Returns

A GroupedVector of type <Time, Event>.

Examples

Group events in 1h spans starting from latest event

GROUP_BY_TIME($GridPowerConsumption, 1h)

Group events in 1d spans on full day spans (i.e. 00:00-23:59)

GROUP_BY_TIME($Produced, 1d, lastZeroHour)
PreviousGROUP_BY_DEVICENextMAX

Last updated 1 year ago