A simple re-fuel calculator example based on the can.fuel.volume
parameter:
{
"intervals_ttl": 31536000,
"update_delay": 1,
"update_period": 86400,
"messages_source": {
"source": "device"
},
"validate_message": "can.fuel.volume",
"validate_interval": "fuel.delta>3",
"name": "Refuel",
"selectors": [
{
"expression": "#can.fuel.volume<can.fuel.volume",
"max_inactive": 90,
"max_messages_time_diff": 1800,
"merge_message_before": true,
"method": "boolean",
"min_duration": 30,
"name": "fuel increased",
"type": "expression"
}
],
"intervals_rotate": 0,
"counters": [
{
"method": "first",
"name": "fuel.before",
"parameter": "can.fuel.volume",
"type": "parameter"
},
{
"method": "last",
"name": "fuel.after",
"parameter": "can.fuel.volume",
"type": "parameter"
},
{
"expression": "fuel.after-fuel.before",
"name": "fuel.delta",
"type": "interval"
},
{
"method": "first",
"name": "position.latitude",
"type": "parameter"
},
{
"method": "first",
"name": "position.longitude",
"type": "parameter"
},
{
"method": "first",
"name": "can.vehicle.mileage",
"type": "parameter"
}
],
"timezone": "UTC"
}