Amazfish Custom Script

I did follow this Description (Scroll down to “Button Actions”) but i´m not sure where to place exactly the harbour-amazfish-script.sh Script:

I try:
defaultuser/
defaultuser/scripts/
./local/share/habour-amazfish/
./local/share/habour-amazfish/habour-amazfish/

I did chmod read and execute every group to the harbour-amazfish-script.sh file.

And of course the Button-Action for 4 presses is assigned to Custom-Script inside the Amazfit-App.

Btw. very good App, now under Sailfish OS my Amazfit GTS is finally working rock solid and did send a Donation for the good work!

3 Likes

Yes, GTR2 runs very well with SFOS 4.5.0.19.
According to the instructions, the script should be stored in defaultuser/ .
Does the custom script work for you?
Which buttons on the GTR2 have to be pressed and are there still settings to be made on the clock?

On the GTR1:
Yes, the custom-script works for me. Name must be “harbour-amazfish-script.sh”.
Only the Main-Button on Top with the Red Mark/Ring is configurable, no need to made Settings on the Clock. When pressing more than one time fast that event is transfered to the Phone where Amazfish-App catch the signal and did custom commands.

There are also these docs How To update AGPS · piggz/harbour-amazfish Wiki · GitHub

1 Like

There’s a typo on the side:

Create a script harbour-amazfish.script.sh with the following content

. instead of -

fixed, thanks.v much

Yes thank you!
It also works for me now: Button with the red ring.
It’s a bit confusing as the first press opens the menu. The script is loaded anyway.
For testing, I press 2x for the browser and press 3x to start the time recording. My harbor-amazfish-script.sh looks like this right now:

#!/bin/sh
if [ "$1" == "2" ]; then
    /usr/bin/sailfish-browser
fi;

if [ "$1" == "3" ]; then
    /usr/bin/harbour-workinghourstracker
fi;

Thanks for your quick help, for me this is solved!

2 Likes

Am I halucinating or has the Application settings button actions config disappeared? Amazfish 2.1.3. SFOS 4.5.0.19. Amazfit Bip S. Xperia 10II

Anybody got a suggestion to check? Thanks!

I added the script. It appears to run or at least start to run when I triple tap the red button. I get an app message saying AGPS, Uploading files …

Howevere the watch also disconnects from the phone then reconnects. When I open the Workout app on the watch I get a message telling me to open the app to update AGPS.

I presume I dont need to use the token python tool as I have used the harbour-amazfish-script.sh script

Have I missed something?

i would debug the script by running it directly on the command line if you can… make sure the huami-token script is downloaded, and works correctly, and can login to your account and download the file

Ah ha so I do need to use the token python tool.

Second thoughts. Is this not included in the script from number 2 here? How To update AGPS · piggz/harbour-amazfish Wiki · GitHub

I’ve tried running from the command line by typing sh harbour-amazfish-script.sh which returns me to a blank command line, [defaultuser@Xperia10III ~]$.

I cannot find a file called /home/defaultuser/gps_uihh.bin, which makes me think the script isn’t running correctly.

I’ve use the login details which I have for the Zepp app which I have used on my Android phone in the past to download the AGPS updates.

The script was copied from here How To update AGPS · piggz/harbour-amazfish Wiki · GitHub with amazfish in place of , my email address in place of and my password in place of .

I also tried moving -g from after method to be after the password.

I have a similar or exactly the same problem.

But first I got
harbour-amazfish-script.sh: line 5: syntax error: unexpected newline

I am confused about what to exchange and for what in line 4. There is .
Should <> be left as they are or removed?

When I leave them, I receive the error above “unexpected newline”.

When I remove them I get a blank response in terminal.

Whenever I try pressing the button three times the watch is disconnected.

@piggz Any help well appreciated.

Thanks!

The <> need to be removed. (It would also be good if you use double quotes around at least the password, in case it has any weird characters).

To test manually, you need to pass parameter 3, e.g../script.sh 3 or it won’t do anything.

1 Like

I finally set it (almost) right, and it started downloading and everything. Then I received this error message:

method return time=1709102793.554901 sender=:1.11444 → destina
tion=:1.11457 serial=395 reply_serial=2
method return time=1709102793.569946 sender=:1.11444 → destina
tion=:1.11458 serial=396 reply_serial=2
string “”
Error org.freedesktop.DBus.Error.NoReply: Message recipient disconnected from message bus without replying
Error org.freedesktop.DBus.Error.ServiceUnknown: The name uk.co.piggz.amazfish was not provided by any .service files

Do you have amazfish running and connected?

Yes, but it gets disconnected every time I run the script.

The only reaction in the app is that the watch disconnects at the time when the watch says “AGPS uploading files”.

Where is the .sh file supposed to be located? In defaultuser as stated above?

Should method, email and password all be in " double qoutes?

Thanks!

Does anyone know?

@nephros
@piggz

The script is in /home/defaultuser, and you do not need to quote the username and password

It is downloaded and I get a response that seems to tell me it is working.

It can login, it seems, but how do I try to download the file using it? I run this command:

python3 huami_token.py --method amazfit --email youemail@example.com --password your_password --bt_keys

And I get a reply similar to this:

python3 huami_token.py --method amazfit --email my_email --password password
–bt_keys
Getting access token with amazfit login method…
Token: [‘UaFHW53RJVYwqXaa7ncPQ’]
Logging in…
Logged in! User id: 1234567890
Getting linked wearables…
±---------------------------------------------------------------------+
| ID | ACT | MAC | auth_key |
|-----±----±------------------±-------------------------------------|
| 0 | 1 | AB:CD:EF:12:34:56 | 0xa3c10e34e5c14637eea6b9efc06106 |
±---------------------------------------------------------------------+
Logged out.

How do I try if that script can download the file? Can I?

Ok, so that is correct, then. The Huami-token has created its own folder called just that. Is that correct?

What happens is that the watch disconnects itself just when “Uploading files…” starts. Any thoughts about what could be wrong?

My error message is the following:

Seems like I and @AlanBreen has the same problem. (?)