spitzlbergerj / MMM-TeslaLogger

Module for MagicMirror showing data from the Teslalogger or teslamate subscribed to via MQTT
GNU Affero General Public License v3.0
5 stars 3 forks source link

Display alignment and units #14

Closed mvrlogins closed 4 years ago

mvrlogins commented 4 years ago

I'm using your module, thanks.

A few issues

Screenshot of Firefox (21-05-2020, 19-13-52)

My config.js data for the module -

{ module: 'MMM-TeslaLogger', position: 'top_right', header: 'Tesla', config: { mqttServerAddress: '10.0.1.182', mqttServerPort: '1883', // mqttServerUser: '', // mqttServerPassword: '', mqttTopics: [ "Tesla", "teslamate/cars/1/+", ], logging: false, localeStr: 'en-GB', maxAgeSeconds: 36000, style: "image" } },

spitzlbergerj commented 4 years ago

Hi,

i have just tested this with my config. It looks like this:

image

But I don't have a teslamate running, I have TeslaLogger. But this should not have any influence on the display ... should ...

And a second test with language "en":

image

and there it is ...

As a quick solution please change the file /home/pi/MagicMirror/modules/MMM-TeslaLogger/translations/en.json

...
"STATUS":"from:",
...

The software version of teslamate should actually be adopted correctly. But as I said, I don't have teslamate running and therefore can't test it very well.

Can you send/write down a teslamate MQTT telegram with the software version? Then I can test this manually?

How does teslamete transmit the value for the odometer? Are these miles or km?

If the value is transmitted as miles, then set in the config

unitOdometer: "m",

and also unitSpeed, unitTrip_distance

If the value is transmitted as km, then the conversion is currently not possible via config. Then you would have to change the code accordingly. I could write you where exactly what is to be exchanged.

But I plan to change the structure of the config at some point anyway, so that such conversions are possible via the config. But it will take me a while to get to that.

Many greetings

Sepp

mvrlogins commented 4 years ago

Thanks for the reply

The edit to en.json did fix the alignment.

The version data from Teslamate is sent as follows : teslamate/cars/1/version = 2020.16.2.1

FYI, the version number displays correctly while using "lines" instead of "image"

Teslamate transmits the odometer in km.

I'm happy to change the code myself so would appreciate a note from you on what is to be changed.

Thanks very much.

spitzlbergerj commented 4 years ago

Hi, i have now added a parameter for converting the odometer to miles. Just set calcToMiles to true in the config.

I have also changed the version string for style image. please test it. Thanks

mvrlogins commented 4 years ago

Hi, i have now added a parameter for converting the odometer to miles. Just set calcToMiles to true in the config.

I have also changed the version string for style image. please test it. Thanks

Thanks. The conversion works properly.

The version number does not. Like I said before, the version number displays correctly while using "lines" instead of "image"

spitzlbergerj commented 4 years ago

Hi, i have tried to recreate this again and again. it always works for me and i can't find any errors in the code. The code lines for the mode "lines" and "images" are now practically identical for the version. And as I said, for me both representations work without problems.

But I have no teslamate running, as I have posted here several times before. As long as nobody provides me with the MQTT telegrams from teslamate with the included version number, I cannot really test this way.

My explanation at the moment is that teslamate transfers the version number differently and that this in combination with the mode image is a problem.

But as I said, for this I would need the MQTT telegrams.

i have also implemented a lot of loggings. you can activate them in the config via logging:true. Then you should be able to see in the browser console what it fails.

Please, please, send me either the MQTT telegrams from teslamate or the logging from the browser and possibly also from node logging.

Then I will gladly try to find the error.