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

        Transition Time In Source Status Execution Times Last Executer Last Execution Date
        Open Open In Progress In Progress
        23h 58m 1 Backlog Manager 21/Jun/18 3:05 PM
        In Progress In Progress Answered Answered
        1h 4m 1 Rafael Fernández 21/Jun/18 4:10 PM
        Answered Answered Closed Closed
        8s 1 Rafael Fernández 21/Jun/18 4:10 PM

          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: