Giter Site home page Giter Site logo

mmm-tesla's People

Contributors

dependabot[bot] avatar f00d4tehg0dz avatar justynr avatar mattdy avatar s-valenzuela avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

mmm-tesla's Issues

Allow different API sources

A user has requested a version of this module that can fetch data from Tessie rather than TeslaFi.

Rather than splitting the module and having to port front-end changes between two repositories, I believe it would be more beneficial to allow different API sources to feed into the same front-end code. As the Tessie and TeslaFi APIs seem very similar (based off the official Tesla one) then hopefully this should not be too difficult.

Add clarification to charge-time

The charge-time field shows values such as 'in 3 hours' while charging, which doesn't make complete sense in the context.

Add some wording beforehand so this reads 'Finished in 3 hours' or similar.

Too many configuration options

With new features such as the Google Map view, there are now an awful lot of configuration options.

It would be more user-friendly to move these down in to sub-fields, so rather than having

googleMapApiKey: "KEY",
mapZoom: "13",
mapHeight: "600",
mapWidth: "400",

We have something like

map: {
  key: "KEY",
  zoom: "13",
  height: "600",
  width: 400"
}, 

This could be done for units and battery warning values as well.

Care should be taken to make the module as backwards-compatible as possible, with full documentation on what's changed with new examples as appropriate

Unable to select visible items

I cannot figure out how to use the "items" to limit the visible data.
Where is "item" suppoest to be in the config file?

This setup is showing all available items:
{
module: "MMM-Tesla",
position: "bottom_right",
config: {
source: {
name: "tessie",
apiKey: "xxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
vin: "xxxxxxxxxxxxxxxx",
item: ['battery','range-estimated','locked','odometer'],
unitDistance: 'km'
}
}
},

Improved URL building

URL building for the TeslaFi API query and Google Maps API link are both done manually, which doesn't make for particularly readable code!

Ideally, these would be done using a URL-building library

New fields

Good morning Matt,

I haven't coded in a long time and not real familiar with GitHub so if I'm screwing up your code let me know. I was going to add a few new fields that i think might be useful. I had not intended to fork off your master code unless you would rather i not affect yours.
Next field Ill create is BatteryEx
ChargeState = Disconnected, Connected, or Scheduled
eg.
Scheduled 217 miles (90% / 90%)
Disconnected(red) 30 miles (10% / 90%)
or something to that effect.
Would you rather this fork off yours or will you be merging together into master?

Improve error handling

As of the merge #36 - there aren't any error messages shown if the Tessie/TeslaFi configuration is invalid. While an Error will be thrown within node_helper.js, there's no display of this to the end user, so they will only see the Loading... message on their display.

A better solution may be to allow the passing of error messages over the socket connection back into the module display code. Receipt of an error message would then suppress any other output from the module.

Scheduled time

Based on issue 33, it now displays a scheduled time to start charging, but it is showing "Scheduled 53 years ago"

Proper handling of metric/imperial setting

Currently there is a configuration option imperial, which isn't used anywhere.

Rather than forcing metric vs imperial everywhere, I think it would be a better option to allow separate selection for distance (miles vs kilometres) and temperature (Fahrenheit vs Celsius). These settings would then be respected across all appropriate fields, rather than having to set on a per-field basis.

Any feedback on this would be appreciated.

Configurable precision for fields

Currently, distances are rounded to the nearest 10th of a mile using parseFloat().toFixed(1)

Rather than dictate the precision, move this to a configuration option with a sensible default, and apply across all fields.

Error: Cannot find module 'aws4'

The inclusion of the MMM-Teslafi module into my config file breaks my MagicMirror which then loads without any modules on a black screen.

When I try to "npm start", I get the following error:

`pi@raspberrypi:~/MagicMirror $ npm start

[email protected] start
DISPLAY="${DISPLAY:=:0}" ./node_modules/.bin/electron js/electron.js

[15.02.2022 13:17.02.243] [LOG] Starting MagicMirror: v2.18.0
[15.02.2022 13:17.02.279] [LOG] Loading config ...
[15.02.2022 13:17.02.296] [LOG] Loading module helpers ...
[15.02.2022 13:17.02.307] [LOG] No helper found for module: alert.
[15.02.2022 13:17.02.401] [LOG] Initializing new module helper ...
[15.02.2022 13:17.02.416] [LOG] Module helper loaded: updatenotification
[15.02.2022 13:17.02.419] [LOG] No helper found for module: clock.
[15.02.2022 13:17.02.677] [ERROR] WARNING! Could not load config file. Starting with default configuration. Error found: Error: Cannot find module 'aws4'
Require stack:

  • /home/pi/MagicMirror/node_modules/request/request.js
  • /home/pi/MagicMirror/node_modules/request/index.js
  • /home/pi/MagicMirror/modules/MMM-TeslaFi/node_helper.js
  • /home/pi/MagicMirror/js/app.js
  • /home/pi/MagicMirror/js/electron.js
  • /home/pi/MagicMirror/node_modules/electron/dist/resources/default_app.asar/main.js

[15.02.2022 13:17.02.682] [LOG] Loading module helpers ...
[15.02.2022 13:17.02.685] [LOG] No helper found for module: alert.
[15.02.2022 13:17.02.688] [LOG] Initializing new module helper ...
[15.02.2022 13:17.02.690] [LOG] Module helper loaded: updatenotification
[15.02.2022 13:17.02.697] [LOG] No helper found for module: clock.
[15.02.2022 13:17.02.725] [ERROR] App threw an error during load
[15.02.2022 13:17.02.737] [ERROR] Error: Cannot find module 'aws4'
Require stack:

  • /home/pi/MagicMirror/node_modules/request/request.js
  • /home/pi/MagicMirror/node_modules/request/index.js
  • /home/pi/MagicMirror/modules/MMM-TeslaFi/node_helper.js
  • /home/pi/MagicMirror/js/app.js
  • /home/pi/MagicMirror/js/electron.js
  • /home/pi/MagicMirror/node_modules/electron/dist/resources/default_app.asar/main.js
  • at Module._resolveFilename (node:internal/modules/cjs/loader:940:15)
    at Function.n._resolveFilename (node:electron/js2c/browser_init:249:1128)
    at Function.Module._resolveFilename (/home/pi/MagicMirror/node_modules/module-alias/index.js:49:29)
    at Module._load (node:internal/modules/cjs/loader:785:27)
    at Function.c._load (node:electron/js2c/asar_bundle:5:13331)
    at Module.require (node:internal/modules/cjs/loader:1012:19)
    at require (node:internal/modules/cjs/helpers:94:18)
    at Object. (/home/pi/MagicMirror/node_modules/request/request.js:10:12)
    at Module._compile (node:internal/modules/cjs/loader:1116:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1169:10)
    [15.02.2022 13:17.02.745] [ERROR] Whoops! There was an uncaught exception...
    [15.02.2022 13:17.02.784] [ERROR] Error: Cannot find module 'aws4'
    Require stack:
  • /home/pi/MagicMirror/node_modules/request/request.js
  • /home/pi/MagicMirror/node_modules/request/index.js
  • /home/pi/MagicMirror/modules/MMM-TeslaFi/node_helper.js
  • /home/pi/MagicMirror/js/app.js
  • /home/pi/MagicMirror/js/electron.js
  • /home/pi/MagicMirror/node_modules/electron/dist/resources/default_app.asar/main.js
  • at Module._resolveFilename (node:internal/modules/cjs/loader:940:15)
    at Function.n._resolveFilename (node:electron/js2c/browser_init:249:1128)
    at Function.Module._resolveFilename (/home/pi/MagicMirror/node_modules/module-alias/index.js:49:29)
    at Module._load (node:internal/modules/cjs/loader:785:27)
    at Function.c._load (node:electron/js2c/asar_bundle:5:13331)
    at Module.require (node:internal/modules/cjs/loader:1012:19)
    at require (node:internal/modules/cjs/helpers:94:18)
    at Object. (/home/pi/MagicMirror/node_modules/request/request.js:10:12)
    at Module._compile (node:internal/modules/cjs/loader:1116:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1169:10) {
    code: 'MODULE_NOT_FOUND',
    requireStack: [
    '/home/pi/MagicMirror/node_modules/request/request.js',
    '/home/pi/MagicMirror/node_modules/request/index.js',
    '/home/pi/MagicMirror/modules/MMM-TeslaFi/node_helper.js',
    '/home/pi/MagicMirror/js/app.js',
    '/home/pi/MagicMirror/js/electron.js',
    '/home/pi/MagicMirror/node_modules/electron/dist/resources/default_app.asar/main.js',
    undefined
    ]
    }
    [15.02.2022 13:17.02.806] [ERROR] MagicMirror will not quit, but it might be a good idea to check why this happened. Maybe no internet connection?
    [15.02.2022 13:17.02.811] [ERROR] If you think this really is an issue, please open an issue on GitHub: https://github.com/MichMich/MagicMirror/issues
    [15.02.2022 13:17.03.608] [LOG] Launching application.
    [12452:0215/131705.049525:ERROR:viz_main_impl.cc(161)] Exiting GPU process due to errors during initialization
    [12475:0215/131705.574120:ERROR:sandbox_linux.cc(376)] InitializeSandbox() called with multiple threads in process gpu-process.
    `

Is this still working for everyone?

Separate DOM refresh from data gathering

Currently, the DOM (what's displayed to the user) is only refreshed when fresh data is successfully gathered from TeslaFi.

Arguably, it would be better to refresh this more often (once a minute by default?) so that the times displayed (such as data-time) are accurate even when new data hasn't arrived for a while.

The data fetching can then be done in a separate loop so DOM updates aren't blocked by it.

Stuck on loading

Module stays on loading… the past 2 days
I haven’t changed anything on my config and my TeslaFi token is still valid.

De-TeslaFi the module

As of #36, we now have the ability to use different sources to gather data into the module. However, the module is still named MMM-TeslaFi and a lot of the code refers to this specifically.

Updates required:

  • Change module name
  • Rename module files
  • Modify code in main JS class to not refer to TeslaFi
  • Update README
  • Update module listing here

Module does not load on recent versions of MagicMirror

As in #30 - on recent versions of MagicMirror core an error is shown every time MMM-TeslaFi attempts to refresh the DOM - "module tries to update the DOM without being displayed"

It appears that a recent version of the MagicMirror core has added module.data as a protected variable - MMM-TeslaFi currently uses this to hold the incoming data from TeslaFi.

Should be a simple fix of just renaming the variable

Direct Tesla integration

Now that additional API sources are available as per #36 - investigate adding a direct Tesla API integration

TeslaFi items removal

Not able to remove/edit which items appear while using TeslaFi api in new update. When using items or apicommand in config, all data points still appear.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.