Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BRAVO! Working on my Synology NAS in minutes! #78

Closed
natrlhy opened this issue Aug 6, 2019 · 26 comments
Closed

BRAVO! Working on my Synology NAS in minutes! #78

natrlhy opened this issue Aug 6, 2019 · 26 comments

Comments

@natrlhy
Copy link

natrlhy commented Aug 6, 2019

This is by far no issue at all. I just wanted to say THANK YOU for an awesome project! I, too have a Synology NAS server. I followed these steps to get it working QUICKLY:

  1. On Synology NAS server, install the Docker Package
  2. SSH to the Synology NAS and sudo -i (root)
  3. cd /volume1/@docker
  4. Create the docker-compose.yml file and configure your settings.
    I modified the VIRTUAL_HOST= to point to the IP of my NAS and TZ=America\Los Angeles
    Set the password for the DATABASE_PASS parameter
  5. Save the file
  6. Run docker-compose up -d (looked around in the other issues and this -d option was very helpful)

Within minutes, I went to http://mynasip:4000 and entered my mytesla credentials. Then went to http://mynasip:3000 and boom! Grafana was up and running, too!

I really appreciate how slick this is and how easy it was to setup!

Is upgrading as easy as:

docker-compose pull and restart with docker-compose up -d again? Or do I have to shutdown the instances first then run a docker-compose pull command?

Looking forward to more features if more come along! Maybe this can rival teslafi.com ;) Seems like it has most everything already

@ilkkao
Copy link

ilkkao commented Aug 6, 2019

I'm also a fan. Architecture is really nice. Postgress is stable. Standard grafana instead of homegrown UI is also a great choice!

@AmpManNC
Copy link

AmpManNC commented Aug 6, 2019

Sounds cool. I'd like to get this running on my Synology NAS, but I'm a complete Newb at this - did you have to install/config grafana, PostgreSQL, etc first, or do the commands above do it all?

Thanks!

@natrlhy
Copy link
Author

natrlhy commented Aug 6, 2019

@AmpManNC it’s as easy as the steps I mentioned. Google for how to install Docker and if you don’t have SSH enabled on your Synology. I created the docker-compose.yml file on my PC first then copied it to my Synology. Then I used SSH to move it to the folder I mentioned. Then just follow the rest! I was up and running in 10 minutes

@AmpManNC
Copy link

AmpManNC commented Aug 6, 2019

Thanks! Will give it a go...

@natrlhy
Copy link
Author

natrlhy commented Aug 6, 2019

I got a bash shell on my grafana docker and see the time is UTC. I'm wondering if it didn't take my TZ=America\Los Angeles (I do have a space in the .yml file, too). How do I go about changing the TZ now that things are up and running?

@normalfaults
Copy link

I think you'll need a _ in between Los_Angeles ...

@natrlhy
Copy link
Author

natrlhy commented Aug 6, 2019

Ok, I've made that change. Do I just stop the container and restart it?
How do all the containers work together? Is it best to stop them all and start them all again in a certain order?
Capture

@scottismyname
Copy link

You can do that or you can restart it from the shell.

@natrlhy
Copy link
Author

natrlhy commented Aug 6, 2019

How are you restarting it from the shell? When I go into the default shell it's already running and pressing enter doesn't do anything
Capture

@scottismyname
Copy link

By shell, I mean from ssh, not from the UI.

docker-compose restart

@natrlhy
Copy link
Author

natrlhy commented Aug 6, 2019

Gotcha! A one-hitter-quitter restart of all images... makes sense...

grafana@f9afbdd81bb8:/usr/share/grafana$ date
Tue Aug 6 18:05:40 UTC 2019

doesn't seem to re-read the docker-compose.yml file with any TZ changes...

@adriankumpf
Copy link
Collaborator

adriankumpf commented Aug 6, 2019

@natrlhy Awesome, thanks!

docker-compose pull and restart with docker-compose up -d again? Or do I have to shutdown the instances first then run a docker-compose pull command?

Yes, upgrading should be as easy as running docker-compose up -d again if the new images were previously pulled.

At some point, a version 2.0 will be released which will include some breaking changes e.g. removal / introduction of environment variables. But that won't happen until it's really necessary.

grafana@f9afbdd81bb8:/usr/share/grafana$ date
Tue Aug 6 18:05:40 UTC 2019

doesn't seem to re-read the docker-compose.yml file with any TZ changes...

I think changes to the environment require docker-compose down && docker-compose up -d

@scottismyname
Copy link

Good to know @adriankumpf . I was under the impression that a simple restart would do it, but I guess not!

@adriankumpf
Copy link
Collaborator

adriankumpf commented Aug 6, 2019

Gotcha! A one-hitter-quitter restart of all images... makes sense...

grafana@f9afbdd81bb8:/usr/share/grafana$ date
Tue Aug 6 18:05:40 UTC 2019

doesn't seem to re-read the docker-compose.yml file with any TZ changes...

Now that I've thought about it, you don't necessarily need to set the timezone for the grafana container. The web interface will show you the date based on your current browser settings.

@natrlhy
Copy link
Author

natrlhy commented Aug 6, 2019

Now that I've thought about it, you don't necessarily need to set the timezone for the grafana container. The web interface will show you the dates based on your current browser settings.

docker-compose down && docker-compose up -d didn't change the TZ either as the container still sees UTC.

Good to know! Thanks!

@AmpManNC
Copy link

AmpManNC commented Aug 7, 2019

@natrlhy - Thanks for your help on this. I got it working on my DS218plus, and it's pretty slick.

Have you managed to get the Tasker/"PUT" solution working, to handle the situation where you resume driving the car while TeslaMate is in its 21 minute allow-the-car-to-fall-asleep mode?

I've looked through various Synology help pages regarding allowing app access from the internet for needs such as this, but am a bit befuddled about how to go about it...

@natrlhy
Copy link
Author

natrlhy commented Aug 7, 2019

@AmpManNC glad it helped! It is really slick for us n00bs :)

With Synology you can configure it to run scripts through it's Task Scheduler, but that's more for static times. We are also discussing such things with regards to the data gap stuff here

@adriankumpf adriankumpf pinned this issue Aug 12, 2019
@bahree
Copy link

bahree commented Aug 12, 2019

Sorry for the dumb question - but to get this going, I don't need to clone the repo or install the DB, etc separately - just have the docker yaml file and then kick it off?

@normalfaults
Copy link

normalfaults commented Aug 13, 2019 via email

@bahree
Copy link

bahree commented Aug 13, 2019

Oh yes of course - sorry, I should have outlined that.

@normalfaults
Copy link

normalfaults commented Aug 13, 2019 via email

@IMgoRt
Copy link

IMgoRt commented Aug 13, 2019

Then the answer to your question is yes :) Nirmal Mehta

On Aug 12, 2019, at 9:40 PM, Amit Bahree @.***> wrote: Oh yes of course - sorry, I should have outlined that. — You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.

Technically the answer is - no, you don't need to clone the repo or install the DBs, etc. you just need to run the docker.yml having edited it for your environment ;-)

@natrlhy
Copy link
Author

natrlhy commented Aug 13, 2019

Correct, modify the docker-compose.yml file to your liking and run docker-compose up -d. That's it. It will create the 4 containers it needs to run everything.

@eoren1
Copy link

eoren1 commented Nov 6, 2019

@natrlhy - I think I'm missing something obvious. I copied your steps but feel like I'm not doing one thing to make this work. This is on a Synology DS918+ by the way

This is by far no issue at all. I just wanted to say THANK YOU for an awesome project! I, too have a Synology NAS server. I followed these steps to get it working QUICKLY:

On Synology NAS server, install the Docker Package
Okay. Docker installed and have it working with other apps (sab, sonarr). I assume you don't mean to install the teslamate image found in the Synology Docker registry

SSH to the Synology NAS and sudo -i (root) then cd /volume1/@docker
Okay. Now I have a prompt

Create the docker-compose.yml file and configure your settings.
I modified the VIRTUAL_HOST= to point to the IP of my NAS and TZ=America\Los Angeles
Set the password for the DATABASE_PASS parameter
Save the file

I did this with TextEdit on a Mac which added a rtf to the end (I removed the extra extension when I moved the file to the Synology folder)
Here is where I am stuck - where and how exactly do you move this file? Also, do you need to copy any of the files in this GitHub project as well? I tried doing that into the Docker/teslamate-master folder but it didn't work - got error messages when I tried to run the app using the "docker-compose up -d" in line 1, column 1 of docker-compose

@baylanger
Copy link
Contributor

Before asking for help, I'll try to help :)

{noformat}
TZ=America\Los Angeles
{noformat}

I believe it should be :

{noformat}
America/Los_Angeles
{noformat}

/ not \

@baylanger
Copy link
Contributor

baylanger commented Jan 14, 2020

On my Synology, from the simple docker-compose file, I left it as-is. When teslamate comes up I get messages saying role 'teslamate' doesn't exist, etc. I am unclear how to fix this, I thought teslamate at boot would be able to access the db and create roles/schema.

I tried the advanced one and same thing.

Any help is welcome.

Thank you for documenting this.

@adriankumpf adriankumpf unpinned this issue Apr 19, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants