Uploaded image for project: 'Help-Desk'
  1. Help-Desk
  2. HELP-14312

FIWARE.Question.Tech.perseo rules, how to get average of specific time window?.

    Details

    • Type: Monitor
    • Status: Closed
    • Priority: Major
    • Resolution: Done
    • Affects Version/s: None
    • Fix Version/s: 2021
    • Component/s: FIWARE-TECH-HELP
    • Labels:

      Description

      Created question in FIWARE Q/A platform on 20-06-2018 at 13:06
      Please, ANSWER this question AT https://stackoverflow.com/questions/50947432/perseo-rules-how-to-get-average-of-specific-time-window

      Question:
      perseo rules, how to get average of specific time window?

      Description:
      How can I use patterns in perseo rules with time windows? I have tried many different combinations, following the directions of EsperTech Tutorials, though, none of them was successful each time I post it to perseo. Any example for time window and how to get the average of any value (e.g. temperature) during that time will be highly appreciated. Trust me, before asking I have made a ton of efforts
      One working query for me is the following:

      select *,\"temperature_range_XX-YY\" as ruleName, *, ev.temperature? as Temperature, ev.id? as Id, ev.datetime? as DateTime, ev.cid? as CID, current_timestamp as TS from pattern [every ev=iotEvent(cast(cast(temperature?,String),float)>XX or cast(cast(temperature?,String),float)<YY and type=\"sensors\")]

      Of course, this query returns only any temperature outside XX and YY range. What I need is to get an alert if temperature is outside the range for specific time and what is the average of all values during that time.

        Activity

        Hide
        backlogmanager Backlog Manager added a comment -

        2018-06-20 15:07|CREATED monitor | # answers= 0, accepted answer= False

        Show
        backlogmanager Backlog Manager added a comment - 2018-06-20 15:07|CREATED monitor | # answers= 0, accepted answer= False
        Hide
        backlogmanager Backlog Manager added a comment -

        2018-06-21 15:05|UPDATED status: transition Answer| # answers= 1, accepted answer= True

        Show
        backlogmanager Backlog Manager added a comment - 2018-06-21 15:05|UPDATED status: transition Answer| # answers= 1, accepted answer= True

          People

          • Assignee:
            rfernandez Rafael Fernández
            Reporter:
            backlogmanager Backlog Manager
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: