Dear Tali,
Thanks for quick answer. Your suggestion was very logical. We wanted to execute step by step.
Unfortunately the first average EPA doesn’t work. It always gives the last received value. We found some other mysterious settings what we cannot decide. We tried some combinations but unsuccessfully. We used shorter period, 10 sec.
I send you our settings maybe you find immediately the wrong one.
Thanks for your help:
Zora
Setting Json:
{"epn":{"events":[{"name":"SensorContextUpdate","createdDate":"Wed Aug 05 2015","attributes":[
{"name":"entityId","type":"String","dimension":"0"}
,
{"name":"entityType","type":"String","dimension":"0"}
,
{"name":"Id","type":"String","dimension":"0"}
,
{"name":"MeasureDate","type":"String","dimension":"0"}
,
{"name":"Value","type":"String","dimension":"0"}
]},{"name":"AvgMeasureEvent","createdDate":"Tue Nov 17 2015","attributes":[
{"name":"Certainty","type":"Double","defaultValue":"1","dimension":0,"description":"The certainty that this event happen (value between 0 to 1)"}
,
{"name":"OccurrenceTime","type":"Date","dimension":0,"description":"No value means it equals the event detection time, other option is to use one of the defined distribution functions with parameters"}
,
{"name":"ExpirationTime","type":"Date","dimension":0}
,
{"name":"Cost","type":"Double","dimension":0,"description":"The cost of this event occurrence. Negative if this is an opportunity"}
,
{"name":"Duration","type":"Double","defaultValue":"0","dimension":0,"description":"Used in case the this event occur within an interval"}
,
{"name":"Average","type":"Double","dimension":"0"}
]}],"epas":[{"name":"AvgMeasureEPA","createdDate":"Tue Nov 17 2015","epaType":"Aggregate","context":"AvgMeasureContext","inputEvents":[
{"name":"SensorContextUpdate","consumptionPolicy":"Reuse","instanceSelectionPolicy":"First"}
],"computedVariables":[
{"name":"AvgMeasure","aggregationType":"Average","SensorContextUpdate":"StringToDouble(SensorContextUpdate.Value)"}
],"evaluationPolicy":"Immediate","cardinalityPolicy":"Single","internalSegmentation":[],"derivedEvents":[{"name":"AvgMeasureEvent","reportParticipants":false,"expressions":{"Duration":"0","Average":"AvgMeasure"}}]}],"contexts":{"temporal":[
{"name":"AvgMeasureContext","createdDate":"Tue Nov 17 2015","type":"SlidingTimeWindow","atStartup":true,"neverEnding":true,"duration":10000,"slidingPeriod":10000,"initiators":[],"terminators":[]}
],"segmentation":[],"composite":[]},"consumers":[{"name":"AvgMeasureConsumer","createdDate":"Tue Nov 17 2015","type":"File","properties":[
{"name":"filename","value":"AvgMeasure.csv"}
,
{"name":"formatter","value":"tag"}
,
{"name":"delimiter","value":";"}
,
{"name":"tagDataSeparator","value":"="}
,
{"name":"SendingDelay","value":"1"}
,
{"name":"dateFormat","value":"dd/MM/yyyy-HH:mm:ss"}
],"events":[
{"name":"AvgMeasureEvent"}
]}],"producers":[],"name":"AvgMeasure"}}
User inferface:
[cid:image002.png@01D1213A.6566A2E0]
[cid:image003.png@01D1213A.6566A2E0]
[cid:image004.png@01D1213A.6566A2E0]
[cid:image005.png@01D1213A.6566A2E0]
[cid:image006.png@01D1213A.6566A2E0]
[cid:image007.png@01D1213A.6566A2E0]
[cid:image008.png@01D1213A.6566A2E0]
[cid:image009.png@01D1213A.6566A2E0]
Message 1:
<notifyContextRequest>
<subscriptionId>5502d5ca984d98db424f19ae</subscriptionId>
<originator>localhost</originator>
<contextResponseList>
<contextElementResponse>
<contextElement>
<entityId type="Sensor" isPattern="false">
<id>101</id>
</entityId>
<contextAttributeList>
<contextAttribute>
<name>Id</name>
<type>String</type>
<contextValue>102</contextValue>
</contextAttribute>
<contextAttribute>
<name>MeasureDate</name>
<type>Date</type>
<contextValue>2015.11.17 10:32:58</contextValue>
</contextAttribute>
<contextAttribute>
<name>Value</name>
<type>String</type>
<contextValue>65.1</contextValue>
</contextAttribute>
</contextAttributeList>
</contextElement>
<statusCode>
<code>200</code>
<reasonPhrase>OK</reasonPhrase>
</statusCode>
</contextElementResponse>
</contextResponseList>
</notifyContextRequest>
Message 2:
<notifyContextRequest>
<subscriptionId>5502d5ca984d98db424f19ae</subscriptionId>
<originator>localhost</originator>
<contextResponseList>
<contextElementResponse>
<contextElement>
<entityId type="Sensor" isPattern="false">
<id>101</id>
</entityId>
<contextAttributeList>
<contextAttribute>
<name>Id</name>
<type>String</type>
<contextValue>102</contextValue>
</contextAttribute>
<contextAttribute>
<name>MeasureDate</name>
<type>Date</type>
<contextValue>2015.11.17 10:32:58</contextValue>
</contextAttribute>
<contextAttribute>
<name>Value</name>
<type>String</type>
<contextValue>75.1</contextValue>
</contextAttribute>
</contextAttributeList>
</contextElement>
<statusCode>
<code>200</code>
<reasonPhrase>OK</reasonPhrase>
</statusCode>
</contextElementResponse>
</contextResponseList>
</notifyContextRequest>
Result (server log):
[cid:image001.png@01D1213A.019644A0]
Dear Zora,
This issue is assigned to the GE Owner for you support.
Kind regards,
Manuel