Skip to content

Sync setup fails with unclear "unsupported protocol scheme" error #4

Open

Description

@mifarse

When trying to configure using the example settings, an unclear error occurs:

sync_alex_zepp:
  from: zepp/xiaomi alex@gmail.com xiaomi-password
  to: garmin alex@gmail.com garmin-password

Error message:

2025/08/18 11:33:27 scaleconnect version 0.3.0
2025/08/18 11:33:27 sync_alex_zepp: load data error: Get "": unsupported protocol scheme ""

Expected behavior: logs should show the connection attempt and the result of authentication (success or failure), not just the unclear error.

Activity

  1. AlexxIT commented on Aug 18, 2025

    @AlexxIT
    Owner

    Yes, you're right. I spent most of my energy on the functionality.

  2. self-assigned this
    on Aug 18, 2025
  3. nemetila commented on Aug 31, 2025

    @nemetila

    Hi,
    I have the same problem with xiaomi home (scale s400). Probably xiaomi account login requires 2FA?

  4. AlexxIT commented on Sep 2, 2025

    @AlexxIT
    Owner

    Yes. You right. It's about 2FA. Do you have Home Assistant?

  5. nemetila commented on Sep 3, 2025

    @nemetila

    Yes, I have HA.

  6. AlexxIT commented on Sep 3, 2025

    @AlexxIT
    Owner

    Well.

    1. You can install and setup this integration: https://github.com/AlexxIT/XiaomiGateway3
    2. Goto /config/.storage/core.config_entries and copy token
    3. Paste token to scaleconnect.json (change your username):
    {"xiaomi:alex@gmail.com":"...token..."}
  7. nemetila commented on Sep 3, 2025

    @nemetila

    Thank you. It is OK now.

  8. AlexxIT commented on Sep 4, 2025

    @AlexxIT
    Owner

    When I have time, I will transfer this functionality to scaleconnect. But the problem is that the app doesn't have a GUI.

  9. henrikmaurin commented on Oct 6, 2025

    @henrikmaurin

    I have tried the steps mentioned here, but I get a 401. I really dont know how to troubleshoot further.

    scaleconnect-1  | 2025/10/06 12:10:23 scaleconnect version 0.4.1
    scaleconnect-1  | 2025/10/06 12:10:25 sync_henrik_xiaomihome: load data error: 401 Unauthorized
    

    scaleconnect.yaml

    sync_henrik_xiaomihome:
      from: xiaomihome henrik@mydomain.se MySupersecretpassword de yunmai.scales.ms104
      to: csv henrik_xiaomihome.csv
      expr:
        Weight: 'User == "Henrik" ? Weight : 0'
    

    scaleconnect.json
    {"xiaomi:henrik@mydomain.se":"1234567890abcdef1234567890abcdef"}

    Edit - really having trouble formatting the file contents in this comment. But I beleive the yaml is correctly indented

  10. henrikmaurin commented on Oct 6, 2025

    @henrikmaurin

    Ok, Now I found the problem.
    By reinstalling XiaomiGateway3 integration I found out I had been looking at the wrong config line/token
    the correct token is much longer than in my example

  11. albertofralbe commented on Oct 13, 2025

    @albertofralbe

    Well.

    1. You can install and setup this integration: https://github.com/AlexxIT/XiaomiGateway3
    2. Goto /config/.storage/core.config_entries and copy token
    3. Paste token to scaleconnect.json (change your username):

    {"xiaomi:alex@gmail.com":"...token..."}

    Done all of this but still getting the original error, how can I fix it?

  12. AlexxIT commented on Oct 13, 2025

    @AlexxIT
    Owner

    The file name may be invalid. Or the contents. Or the token may be invalid. It must be very long with colons inside.

  13. albertofralbe commented on Oct 14, 2025

    @albertofralbe

    Solved, for anyone else who may have done the same mistake:
    In order to find the correct token, you need to search for "xiaomi" inside the /config/.storage/core.config_entries file.

    Thanks @AlexxIT

  14. Tozapid commented on Oct 26, 2025

    @Tozapid

    Hello @AlexxIT,
    I have the same error, but it looks like it is not about 2FA, as I don't have it

    Scale: Mi Body Composition Scale 2 (XMTZC05HM)

    Error in logs

    2025/10/26 11:28:39 scaleconnect version 0.4.1
    2025/10/26 11:28:40 sync_zepp: load data error: Get "": unsupported protocol scheme ""
    

    scaleconnect.yaml

    sync_zepp:
      from: zepp/xiaomi zepp@email.com password
      to: csv zepp.csv
    

    P.s.

    • I have ~500 records on this Zepp account
    • This Zepp account is not connected to the Xiaomi account
    • I tested your app on another Zepp account with just 20 records, and it's working fine

    Can you please add a debug log level?

  15. 2 remaining items

  16. menashe21 commented on Dec 20, 2025

    @menashe21

    Well.

    1. You can install and setup this integration: https://github.com/AlexxIT/XiaomiGateway3
    2. Goto /config/.storage/core.config_entries and copy token
    3. Paste token to scaleconnect.json (change your username):

    {"xiaomi:alex@gmail.com":"...token..."}

    Done all of this but still getting the original error, how can I fix it?

    Can you please add a doc for this?
    It is unclear how to do it...

  17. AlexxIT commented on Jan 8, 2026

    @AlexxIT
    Owner

    I added support for receiving Xiaomi token to my other application - go2rtc.
    Perhaps it will be easier for someone to get a token through it.
    There is no time to make changes to this application yet.

    https://github.com/AlexxIT/go2rtc/blob/master/internal/xiaomi/README.md

  18. gerpetya commented on Jan 26, 2026

    @gerpetya

    @nemetila Did you use the token or the ble token for the s400 scale? Do you have a gateway? I tried to set this up, but with no success. I have the tokens, create the json file, but I receive 401.

  19. AlexxIT commented on Jan 26, 2026

    @AlexxIT
    Owner

    A device token is needed for a local connection to the device. This isn't the case with this app.
    This app works with the cloud. It requires a cloud token.

  20. gerpetya commented on Jan 26, 2026

    @gerpetya

    Thanks, sorry, I totally got confused by the Xiaomi cloud token extractor. Now it works with the XiaomiGateway3 token.

  21. Vittt2008 commented on Jan 27, 2026

    @Vittt2008

    I entered via go2rtc, and I'm still not sure how to get a token.
    I see the config was created in the format

    xiaomi:
      "1527839602": V1:9d...TA=
    

    I know that "1527839602" - is my account id, I also believe V1:9d...TA= is a token, but if I update SmartScaleConnect config, I still get the same error.

    1. Could you send the whole config in this case?
    2. Should I specify a password in the config?
    3. Should I use the account number or email?
    4. Should I use prefix {"xiaomi:alex@gmail.com":"...token..."}

    I tried multiple options, and all of them returned the same error

  22. AlexxIT commented on Jan 28, 2026

    @AlexxIT
    Owner

    {"xiaomi:email":"1527839602:V1:9d...TA="}

  23. Vittt2008 commented on Jan 28, 2026

    @Vittt2008

    Unfortunately, it still doesn't work.
    Is it correct?

    sync_xiaomihome:
      from: xiaomihome {"xiaomi:myemail@gmail.com":"1234567890:V1:9d...TA="} MyPassword es yunmai.scales.ms104
      to: json all_users_xiaomihome.json
    

    I'm using es because I'm based in Spain, but I tried de,ru,cn, the result is still the same.
    Did I do anything wrong?

  24. AlexxIT commented on Jan 28, 2026

    @AlexxIT
    Owner

    No. It was example of scaleconnect.json file content.

  25. akostmOR commented on Feb 4, 2026

    @akostmOR

    Hi @AlexxIT ,

    I try to export to csv my records from the xiaomi home app with this command.

    sync1:
      from: xiaomihome email@gmail.com password cn yunmai.scales.ms104
      to: csv my_weight.csv
    

    I have 2FA enabled, so I created a scaleconnect.json next to he yaml config, which has a content:

    {"xiaomi:email@gmail.com":"V1:9d....GM="}
    

    When I try to run the app on my mac I've got this error:

    ❯ ./scaleconnect
    2026/02/04 11:33:31 scaleconnect version 0.4.1
    2026/02/04 11:33:35 sync1: load data error: 400 Bad Request
    

    Can you help what can cause this error?

  26. AlexxIT commented on Feb 4, 2026

    @AlexxIT
    Owner

    @akostmOR are you sure you should use cn server? You have euro scales. They should not work with the Chinese server.

  27. akostmOR commented on Feb 4, 2026

    @akostmOR

    @AlexxIT I'm using the MiHome app with the Vevs mod. In the app I'm logged in to the CN server and I can see and use the scale.
    When I try to change the region to de or the type of the scale here in this tool, I always get load data error: 401 Unauthorized instead of the original 400, so I think the cn part is correct.

  28. AlexxIT commented on Feb 4, 2026

    @AlexxIT
    Owner

    I suggested that it would be vevs mode. There was already such a user, but I don’t remember how it ended.

    You may not be able to access data for your scales. You may only be able to access data for your user. Check docs for this.

  29. xiaotuzi01 commented on Oct 24, 2026

    @xiaotuzi01

    Hi @AlexxIT,
    First of all, thank you for this awesome project!
    I am trying to sync data from my Mijia Body Composition Scale S400 (yunmai.scales.ms103). The container starts, and authentication seems to be successful, but then it immediately crashes with a runtime panic.

    Environment:

    • Docker Image: alexxit/smartscaleconnect:latest (version 0.4.2)
    • Scale Model: Mijia Body Composition Scale S400 (yunmai.scales.ms103)
    • Region: China (cn)

    2026/10/24 03:37:54 scaleconnect version 0.4.2
    panic: runtime error: index out of range [3] with length 2

  30. AlexxIT commented on Oct 24, 2026

    @AlexxIT
    Owner

    @xiaotuzi01 More detailed error text is needed. It usually includes the section of code where the error occurred.
    You probably have an incorrect configuration file with the wrong number of parameters.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    ⌂ 换网址