Welcome to Tesla Motors Club
Discuss Tesla's Model S, Model 3, Model X, Model Y, Cybertruck, Roadster and More.
Register

iOS Widget for TeslaFi/Teslamate/TeslaLogger via Scriptable

This site may earn commission on affiliate links.
Can't get this to work for me, installed via docker, it's in the docker-compose.yml and it installed on running up.

I've tried both the dashboard and the tm URL in the parameters, but still get "Error on line 845:10: TypeError: null is not an object (evaluating 'json.response')

It may seem really stupid, but I did it so...

Have you added the teslamate_mqtt_api: details to the teslamate docker-compose.yaml or created a new docker container?

At first, I created a new one by mistake and got the same error as you.

The teslamate_mqtt_api: details must be added to the teslamate yaml file.
 
It may seem really stupid, but I did it so...

Have you added the teslamate_mqtt_api: details to the teslamate docker-compose.yaml or created a new docker container?

At first, I created a new one by mistake and got the same error as you.

The teslamate_mqtt_api: details must be added to the teslamate yaml file.

All added to the same docker-compose, when I run docker ps I can see it's running too :)
 
From the error you posted earlier it sounds like you’re trying https? Try with just http? Are you referring to the correct port in the url?

Hard to say for sure without seeing the url you are trying, but you probably shouldn’t post that publicly. Can you dm me the url?

The http suggestion has made a difference of sorts, if I view that in my browser I see the JSON response, the widget still comes up with the following error though:

E017152E-C587-4D26-AF44-3F595D1AB15A.jpeg
 
Is there a way to change it to show miles instead of KM @Landro ?
From the GitHub (prior to auto detecting TeslaFi’s unit config)

You can add the factor * 1.609 in the script and you have the range in km. It will look so

if (show_range_est) {
batteryCurrentCharge = Math.floor(items.est_battery_range * 1.609)+units

I imagine you could alter the TeslaFi detect part to detect TeslaMate’s config to auto change with some sort of IF statement.
 
From the GitHub (prior to auto detecting TeslaFi’s unit config)



I imagine you could alter the TeslaFi detect part to detect TeslaMate’s config to auto change with some sort of IF statement.

Thanks @CMc1 - I’m not a code expert by any stretch, but I think from my quick look at Landro’s code in Git that it determines KM for the output, as that’s what also shows up in the JSON
 
  • Like
Reactions: DaveW
Teslamate only stores km - see MQTT in imperial units? · Discussion #230 · adriankumpf/teslamate. So it'll require a slight code change too convert it. Shouldn't be to difficult. I can take a look tomorrow.

Id forgotten about that, Thomas on the TeslaMate Users Facebook group came up with this amendment to the js file.


if (this.distance_label == "km"){
// convert battery_range to imperial
this.battery_range *= 0.62137;
this.est_battery_range *= 0.62137;
this.distance_label = "mi"