engineHours from API reports/summary is zero

Theerayuttu2 years ago

Why engineHours value from API (../reports/summary) is zero. but in the attributes data field already have ignition status and hours data from the gps device.

Theerayuttu2 years ago

from API response (same params with web app)

{
        "deviceId": 4,
        "deviceName": "9175153470",
        "distance": 116416.44,
        "averageSpeed": 0.18475152097225725,
        "maxSpeed": 10.09,
        "spentFuel": 0.0,
        "startOdometer": 0.0,
        "endOdometer": 116416.44,
        "startTime": "2023-04-24T05:52:21.000+00:00",
        "endTime": "2023-05-08T10:06:42.000+00:00",
        "engineHours": 0
    }

On Accumulators in Web App

Hours: 17.916666666666668

On Web App Summary Report

Device	Start Date	Distance	Average Speed	Engine Hours	Odometer Start	Odometer End	Maximum Speed	Spent Fuel
9175153470	2023-04-24	116.42 km	0.18 kn	a few seconds	0.00 km	116.42 km	10.09 kn	0.00 l
Anton Tananaev2 years ago

You have to check start and end engine hours value to see what the difference is. That's what you get in the engine hours in the summary report.

Theerayuttu2 years ago

Thank you Anton for the answer. I understand it. Now it works.

{
        "deviceId": 4,
        "deviceName": "9175153470",
        "distance": 116287.88,
        "averageSpeed": 3.562513319872027,
        "maxSpeed": 10.09,
        "spentFuel": 0.0,
        "startOdometer": 128.56,
        "endOdometer": 116416.44,
        "startTime": "2023-04-24T06:30:21.000+00:00",
        "endTime": "2023-05-08T10:06:42.000+00:00",
        "engineHours": 63451000
    }
Theerayuttu2 years ago

How can I get hours value of device? (same Accumulators) without specifying from and to date in api.

Anton Tananaev2 years ago

You can use the position API endpoint.

Theerayuttu2 years ago

That's great.
thank you again.

{
        "id": 21224,
        "attributes": {
            "alarm": "powerCut",
            "ignition": false,
            "status": 3891788799,
            "io1": "520",
            "io2": "99",
            "io3": "1610",
            "io4": "13750",
            "distance": 0.0,
            "totalDistance": 116416.44,
            "motion": false,
            "hours": 64500000
        },
        "deviceId": 4,