speedtest-tracker: Result in API response is not calculated in Mbps or Gbps in version 0.16.x

Describe the bug Result in API response is not calculated in Mbps or Gbps in version 0.16.x but showing in bps

To Reproduce Steps to reproduce the behaviour:

  1. Install version 0.16.x
  2. Schedule a speedtest
  3. GET /api/speedtest/latest
  4. Download and Upload speed are in bps

Expected behavior It should show rounded results in Mbps or Gbps with 2 decimal values

Environment (please complete the following information):

  • OS: Docker
  • Architecture: arm64
  • Browser: Chrome
  • Version 0.16.3

API response v0.16.3 shows

{"message":"ok","data":{"id":1,"ping":264.839,"download":126109704,"upload":62118624}

v0.15.5 shows (Expected)

{"message":"ok","data":{"id":1,"ping":264.839,"download":126.1096,"upload":62.1184}

Screenshot image

Logs N/A

Additional context Systems like Organizr etc do not calculate results but relies on what is provided within API

About this issue

  • Original URL
  • State: closed
  • Created 4 months ago
  • Reactions: 1
  • Comments: 19 (4 by maintainers)

Most upvoted comments

Same when pulling the api data via Homepage. Result should say Mbit/s instead of Tbit/s. IMG_20240220_071538.jpg

{"message":"ok","data":{"id":3,"ping":19.816,"download":"47622752","upload":"10820928"} 

#1182 incoming in v0.16.4 which will fix the calc for Speedtest Tracker dashboards and tables. This isn’t going to fix Homepage or Heimdall widgets as an fyi. Will have to circle back around to that later tonight.

@MartynKeigher can you open a new issue and document how you added it to your StreamDeck?

I’d love to do the same on mine and then can get that into the docs.

Same issue using Heimdall:

image

Although I certainly would not mind if that were the real speed. 😊

@alexjustesen thank you for fixing this image

working again, thank you very much @alexjustesen

Screenshot 2024-02-21 at 12 35 14

Just pulled the latest lscr.io image, ran a test and now working as expected! Thanks 👍🏼

image

curl 192.168.0.5:8081/api/speedtest/latest
{"message":"ok","data":{"id":22,"ping":8.929,"download":829.68,"upload":250.39,"server_id":XXXXX,"server_host":"<REDACTED>","server_name":"Frontier","url":"<REDACTED>","scheduled":true,"failed":false,"created_at":"2024-02-21T12:00:22.000000+00:00","updated_at":"2024-02-21T12:00:22.000000+00:00"}}

@mannbadal can you link me the source for the Organizr widget so I can add it to my tests?

@alexjustesen here is the link to speedtest in organizr https://github.com/causefx/Organizr/blob/v2-master/api/homepage/speedtest.php

@Christophe999s had no idea you could do a custom widget like that.

You can even do more…

         - field:
            data: server_name
           label: Server
           format: text

image

Wow - I missed that someone else already reported this, before logging my own ticket (#1186). My use case is StreamDeck. 😉

image

I can assure ya, it looks much nicer when it’s just ### Mbps.

Same issue with Api report on Homepage !

For a quick fix you can use the custom API. You can add this in your services.yaml Just replace http://speedtest with your own url

widget:
    type: customapi
    url: http://speedtest/api/speedtest/latest
    refreshInterval: 60000
    method: GET
    mappings:
        - field:
            data: download
          label: Download
          format: number
          scale: 1/1000000
          suffix: Mbps
        - field:
            data: upload
          label: Upload
          format: number
          scale: 1/1000000
          suffix: Mbps
        - field:
            data: ping
          label: ms
          format: float