Comments (6)
OK - I added it to the docker-compose file for Teslamate and that did the trick! Thanks. I'll document this and submit a pull request to help others out. Quick one - does this work historically or is it only point in time forward?
from teslamateagile.
Hi Drew, I've just responded to your posts on the TMC forum but I'll summarize it here for others who may run into this issue.
The connection string contains Server, Database, User Id and Password, these correspond to the DATABASE_HOST
, DATABASE_NAME
DATABASE_USER
and DATABASE_PASS
env variables respectively set in TeslaMate / Grafana and must match in order for this to work.
Using the default TeslaMate docker setup from their documentation your connection string would be:
ConnectionStrings__TeslaMate=Server=database;Port=5432;Database=teslamate;User Id=teslamate;Password=secret;
Would it be useful to support the same env variables as TeslaMate / Grafana as an alternate configuration? I think perhaps that would make it clearer for people to know what to put in them
from teslamateagile.
Thanks for the quick reply. I've updated it to:
ConnectionStrings__TeslaMate=Server=database;Port=5432;Database=teslamate;User Id=teslamate;Password=secret;
TeslaMate__UpdateIntervalSeconds=300
TeslaMate__GeofenceId=1
TeslaMate__Phases=1
Octopus__RegionCode=J
But it's still giving the same error. I checked the Docker compose file and the connection string values match those used by TeslaMate itself so I know they are correct as that's still working.
fail: Microsoft.EntityFrameworkCore.Database.Connection[20004]
An error occurred using the connection to database 'teslamate' on server 'tcp://database:5432'.
fail: Microsoft.EntityFrameworkCore.Query[10100]
An exception occurred while iterating over the results of a query for context type 'TeslaMateAgile.Data.TeslaMate.TeslaMateDbContext'.
System.Net.Internals.SocketExceptionFactory+ExtendedSocketException (00000005, 0xFFFDFFFF): Name or service not known
at System.Net.Dns.InternalGetHostByName(String hostName)
at System.Net.Dns.ResolveCallback(Object context)
--- End of stack trace from previous location where exception was thrown ---
from teslamateagile.
Ah just done some reading on the docker default network mode and looks like hostname lookup only works if you put teslamate inside the docker-compose.yml with the other services. You could try that, or you can lookup the ip address using sudo docker ps
to find the container name of the database then sudo docker inspect --format '{{ .NetworkSettings.IPAddress }}' container_name_here
and then put that in there.
Let me know how it goes! I'm currently running TeslaMateAgile myself on top of Kubernetes so the networking abstraction is a little different to the normal Docker one that I imagine most TeslaMate users are doing and I would like to improve the documentation for this
from teslamateagile.
Perfect, yes if you could document about adding it to the TeslaMate docker-compose in particular that would be very useful to others I think, and yes it does work historically too, it calculates the cost for any charges within your geofence with no cost set (null value). Might also be worth documenting that too as I've had a few questions of that nature 🤣
from teslamateagile.
I went ahead and updated the app to support the same env variables as TeslaMate itself and added instructions on how to add it to docker-compose so don't worry about that documentation
from teslamateagile.
Related Issues (20)
- Costs not calculated after upgrade to 1.8.0 HOT 6
- Specifying an invalid GeofenceID does not throw errors HOT 4
- Configured geofence 'Home' (id: 1) has a cost per unit set which will prevent TeslaMateAgile from working properly HOT 5
- Entsoe transparency API provider support HOT 4
- Very short top-up charges don't get costed. HOT 5
- Some Crashing Entries HOT 5
- Provider feature request : EDF Tempo French Provider HOT 2
- Error calculating costs with Tibber provider HOT 3
- Feature Request: Octopus Intelligent HOT 7
- UTC time issue HOT 4
- Multiple providers? HOT 2
- Feature request? Generic input of dynamic pricing HOT 2
- Calculation fails when the end time of a charge is very close to the beginning of the hour HOT 3
- Unable to calculate cost of some charges HOT 11
- Create REST endpoint to get price at specific datetime HOT 3
- Failed to update prices - System.ArgumentException: totalHours HOT 6
- Failed to calculate charging cost / energy for charging process HOT 6
- Enhancement / Feature Upgrade - integration of EMS evcc HOT 2
- Unable to download docker image HOT 2
- Feature request - Make available in Home Assitant hassio HOT 15
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from teslamateagile.