mattdy / mmm-tesla Goto Github PK
View Code? Open in Web Editor NEWThis project forked from f00d4tehg0dz/mmm-teslafi
MagicMirror Module for displaying Tesla data
License: MIT License
This project forked from f00d4tehg0dz/mmm-teslafi
MagicMirror Module for displaying Tesla data
License: MIT License
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.
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'
}
}
},
Now that additional API sources are available as per #36 - investigate adding a direct Tesla API integration
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.
Module shows locked even when car is unlocked. Verified TeslaFi API was showing unlocked also.
As per https://github.blog/changelog/2022-09-22-github-actions-all-actions-will-begin-running-on-node16-instead-of-node12/ - we cannot rely on Node.js 12 for much longer.
Suspect that PR #48 may be failing as a result of the outdated version in use.
If you do not define an 'apiCommand' for the TeslaFi integration, then the default value of 'lastGood' is not currently applied, meaning we can get data back from TeslaFi that is filled with null
values.
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.
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
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?
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
Connected "item" shows "scheduled invalid date"
Is this a bug or did I miss a setting in config for this to work?
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:
TeslaFi doesn't always return a proper value for charging_state
, which causes us to show 'null' for the value of power-connected
Based on issue 33, it now displays a scheduled time to start charging, but it is showing "Scheduled 53 years ago"
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.
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:
[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:
Is this still working for everyone?
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
Just as the description says, the "Items" array will not be read by the app to change, add or remove the items that are displayed.
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.
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.
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.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.