Smart #1 API / Smart Home Integration

  • Noch eine Idee: Irgendwelche besonderen Sonderzeichen im Passwort? Zum Beispiel ein , oder ein ;

    sorry I forgot I had to change my script too because of special characters in the password! I should have shared it and forgot:


    see the change I made here:


    see if adding those

    encodeURIComponent(userName) and encodeURIComponent(password) fixes your issue. My API user password was starting with a '&' and it didn't like that at all.

  • Bin dieses Wochenende unterwegs und habe wenig Zeit. Habe die Anleitung aktualisiert und die hashes Datei direkt in der raw Version verlinkt. Die Dateigröße muss exakt 60 KB betragen, sonst funktioniert es nicht.


    chriscat

    Thanks for your PRs. I already reviewed, approved and merged two of them.
    The behaviour with more than one car sound strange. The api endpoint that returns the car data has the vin explicitly in the URL, so I assume it should just work with different vins. There is no direct connection between the Hello Smart App and the widget script. The only connection is that controlling the car (lock/unlock, air condition etc.) only works if your digital key in the app is connected. But login and data is completely unrelated. Maybe the implemented something in a strange way on their side of the api.


    Could you maybe debug it a little, put your credentials directly in the script and check it with different vins? Basically it's just one api call inside the getCarInfo() method. The result of it is already logged on the console (huge json response). I only have one car so I can't double check.

  • Could you maybe debug it a little, put your credentials directly in the script and check it with different vins? Basically it's just one api call inside the getCarInfo() method. The result of it is already logged on the console (huge json response). I only have one car so I can't double check.

    The other day, I already tried everything I could think of. But today the test was even simpler:


    1. The widget works for Car A, I confirm it by going in scriptable and run it.

    2. I go to hello smart, which is showing Car A and I change to look at Car B

    3. I go back to scriptable and run the same script for Car A and it fails with following consol logs


    Code
    2023-11-18 14:09:09: Found apiAccessToken.
    2023-11-18 14:09:09: Signing api request with hmac *********
    2023-11-18 14:09:10: status code: 200
    2023-11-18 14:09:10: {"data":null,"code":"8160","httpStatus":"OK","success":false,"hint":null,"sessionId":"***********","message":"Currently no permission to operate"}


    4. I go back to hello smart and switch to car A

    5. The widget works again perfectly

  • chriscat
    Thanks, I think this already helps me to understand the problem. I'll try to implement a possible way to fix this behaviour. It's obviously a permission thing.


    I'll try to implement a possible fix and will come back to you if that's ok (for testing).

  • chriscat
    Thanks, I think this already helps me to understand the problem. I'll try to implement a possible way to fix this behaviour. It's obviously a permission thing.


    I'll try to implement a possible fix and will come back to you if that's ok (for testing).

    i suspect something like that but you might need a proxy to look at it happening when you change car.


    I could share one car with you so you can try. I am moving house. I can’t help with a proxy for now.


    in addition to support for multiple cars, it could also improve the reliability if we understand this authorisation.

    I think I needed to login again in hello smart for a user to work via API. When the user hasn’t been used for a little while . but it takes a while to reproduce. It could be related


    Of course I can help with testing the possible solution when you think you get one. That would make the whole thing easier than one user per car

  • Hi marco79cgn, mega Projekt, 1000 dank dafür. Ich hab das Projekt geforked und mal ne Farbwahl für den kleinen smart im Widget gebastelt.

    Modellnummer als vierter Parameter in den widget-einstellungen. Ist das interessant? Ich weiß, nichts dolles, aber zum reinarbeiten ganz nett.

    Bin in github-kollaberation nicht superfit, wenn Du die Veränderung in den masterbranch aufnehmen willst, schreibe mir doch kurz, wie ich das am besten anstelle.IMG_1189.png

    Smart #1 Premium grün seit 18.08.23, Kona electric am 23.11. zurück zu ALD gebracht.

  • Was ich interessant finde in meinem Widget steht auch 13°C drin in der App 19°C würde wetten es stimmt beides nicht. Die 13°C kommen aber so mit im Output als liegt es nicht am Widget oder am Script.
    Dazu gleich eine blöde Frage ließe sich der die Nachkomma (Punkt) mit anzeigen also 13.1°C ?? Daran lässt sich eher ableiten wie ob das Widget aktualisiert! ^^

    Premium Meta Black Metallic uni - Interieur: Touch

    Bestellt: 12.März 2023 - Übernommen: 05.04.2023 :love:

    Auslieferort: Köln -- OS: 1.3.2 -- 20.33.10.23423.40436

  • So? Will hier aber keine eigenen downloadlink einrichten. Das ist Marcos Werk, der könnte das ja integrieren.

    Ja so wäre es fein! Aber du hast völlig Recht. War auch eigentlich an Marco gerichtet. Aber sieht gut aus, auch mit der Farbe!


    Danke an alle die hier so toll entwickeln!

    Premium Meta Black Metallic uni - Interieur: Touch

    Bestellt: 12.März 2023 - Übernommen: 05.04.2023 :love:

    Auslieferort: Köln -- OS: 1.3.2 -- 20.33.10.23423.40436

  • Für alle die Probleme mit der hashes.js Datei haben.

    Nutzt den Link aus der Readme.md also Startseite bei GitHub und nicht den Download der File im Source Code Bereich.

    Das hat bei mir das Problem gelöst.

    Danke noch einmal an Marco für das Widget!IMG_4296.jpg

    Smart #1 Premium (Black Outside / White Inside) seit dem 16.06.2023

    Smart EQ ForTwo Cabrio (all Black) seit dem 24.03.2023

    ==> All in on BEV & smart


    Vorher: Skoda Kodiaq L&K TDIs , 2017 und 2020