Analytics builder: Get event data for counter

Hi Johannes,

When you are using the specifically defined event type c8y_ElevatorStop, you don’t need to use the extract property block. You’ll specify the value ‘c8y_ElevatorStop’ for ‘Event Type’ parameter in the input block. This block would produce output only when matching event type is received. So you can directly connect it to the Counter block. For example:


When you are using a common type, can you provide the exact format you are using? I am assuming that the format for the event would look something like following?

{
    "source": {
        "id": "130597"
    },
    "type": "c8y_DataType",
    "text": "stop",
    "STOP": { 
        "unit": "Pa", 
        "value": -18541.6015625 
    },
    "time": "2021-12-01T17:03:14.000+02:00"
}

For this, you need to specify the “STOP” as the property name in the Extract Property block as it is the top level property. Then you can connect the output to Counter block. If the “STOP” property is missing from the event, then Extract Property block will not generate the output, giving you the desired behavior. For example:



Let me know if it doesn’t work.