[Backlogmanager] [FIWARE-JIRA] (HELP-14312) [fiware-stackoverflow] perseo rules, how to get average of specific time window?

Rafael Fernández (JIRA) jira-help-desk at jira.fiware.org
Thu Jun 21 16:11:00 CEST 2018


     [ https://jira.fiware.org/browse/HELP-14312?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rafael Fernández updated HELP-14312:
------------------------------------
    Status: Answered  (was: In Progress)

> [fiware-stackoverflow] perseo rules, how to get average of specific time window?
> --------------------------------------------------------------------------------
>
>                 Key: HELP-14312
>                 URL: https://jira.fiware.org/browse/HELP-14312
>             Project: Help-Desk
>          Issue Type: Monitor
>          Components: FIWARE-TECH-HELP
>            Reporter: Backlog Manager
>            Assignee: Rafael Fernández
>              Labels: cep, fiware
>
> Created question in FIWARE Q/A platform on 20-06-2018 at 13:06
> {color: red}Please, ANSWER this question AT{color} 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.



--
This message was sent by Atlassian JIRA
(v6.4.1#64016)


More information about the Backlogmanager mailing list

You can get more information about our cookies and privacy policies clicking on the following links: Privacy policy   Cookies policy