Welcome to Tesla Motors Club
Discuss Tesla's Model S, Model 3, Model X, Model Y, Cybertruck, Roadster and More.
Register

EVmote App

This site may earn commission on affiliate links.
So I was finishing up the time ranges for charging reminders. I wanted to share a little bit about how complex it is to make things simple, because I constantly run into this at work and on my side projects, and I'm always fascinated by it!

Let's take charing reminders. We can describe the requirement in a single sentence: "When I forget to plug my car in, email me a reminder".

Easy, right?

First we need to know where the car is supposed to be plugged in so we don't remind you every time you park at the grocery store. So we need a list of locations from the user. Simple enough.
Now whenever we park, we do a series of checks:
1) Is the car parked.
2) Is it within 30 meters of one of the charging locations stored for this user.
3) Schedule a task for five minutes from now that:
3a) Checks if the car is still parked
3b) Checks if it's still within 30 meters of the location
3c) Checks if we're within the time range that we want a reminder
3d) Checks if it's plugged in
3e) Sends the email reminder

Simple enough, right? Let's zoom in on 3c.

If you only want to get reminders between 6pm and 10pm, we let you specify that. The hard part about that is timezones. The server runs on UTC time (i.e. London). If you're in California, 6pm for you is 1am for the server (GMT -7). And remember, it's the server that's emailing you.
One might think that you can just do the math and tell the server that you really want reminders when the server get to 1am. The problem is that next weekend, California will be 8 hours behind GMT because daylight savings time is ending. Ugh.
Add to that the complexity that some timezones only move up 30 minutes during daylight savings time. Some are 15 minutes ahead. Some places, like Arizona, don't have daylight savings time AT ALL!

So to make this "simple" check work, we actually need to send the local time AND the name of the timezone to the server. It's not enough to send the timezone offset in minutes - we actually need to know the NAME of the timezone. Then on the server we can calculate (every single time) what local time you wanted to be alerted, look at the timezone we have stored, and do the math.

There are some libraries that make this a little bit easier, but nothing that works together very well between a web browser (or all six web browsers that are popular) and a server.

Timezones are a programmer's worst nightmare!
 
Last edited:

I think #24 is my favorite.

The way humans interpret time is so intuitive to us and SO hard to put down in rules.
For example, for charging reminders:
If you want reminders when you park your car between 4pm and 6am, you just KNOW that means overnight and spans two different days. That's surprisingly hard to account for and requires two opposite sets of logic.

*sigh*
 
Hi Ryan,

It appears to me that the car needs to "awake" for it to accept the "automation" HTTP/REST commands. Am I right?

Thanks, Antonio

That's probably correct. I haven't tested that yet, and my car is always on. If the are ifttt commands that were ignored by your car, send me your email address, the command, and the approximate time. I can take a look in the logs.

Thanks!
Ryan
 
I thought I set up a charging reminder yesterday evening to let me know if I'm not plugged in between 10pm and 2am. I received a nice email at 9:53am: "Hi, It's your car. You forgot to plug me in just now. Do you mind coming back out and charging me so I'll be ready next time we go somewhere?".

I thought I set up the reminder from 22:00 to 02:00, but maybe not.
I went back to the website to double check what I had done wrong and can't seem to find how to edit existing reminders. The automation page drop down says "No Reminders Found".

Scott
 
I thought I set up a charging reminder yesterday evening to let me know if I'm not plugged in between 10pm and 2am. I received a nice email at 9:53am: "Hi, It's your car. You forgot to plug me in just now. Do you mind coming back out and charging me so I'll be ready next time we go somewhere?".

I thought I set up the reminder from 22:00 to 02:00, but maybe not.
I went back to the website to double check what I had done wrong and can't seem to find how to edit existing reminders. The automation page drop down says "No Reminders Found".

Scott

Hi Scott,
I just took a look at your account. I see it sent you a message at 9:53. The reason you got the reminder outside of your preferred time range is because the time ranges aren't "hooked up" yet. It's just "for show" right now. I'll have them working later today.
I also see that at 10:05, your only charging location was deleted. It's possible that it's a bug while I was messing around with charging reminders last night.

Can you set your charging reminder again and save the times you want? Then, if you could log out and log back in to make sure it's still there, that would be AWESOME.

Thanks!
Ryan
 
Hi all,
I've deployed the changes for charging reminder times. If you already have reminders setup and want to limit the times during the day that you get reminders, you can do so on the new Automation page.
Most of ya'll have asked for this because you don't plug your car in during daytime trips to the store, etc., but you want to be reminded when you forget to plug in after 5pm.

If you've been messing around with reminders the last couple of days, you might want to delete and re-create your reminders now that everything is final.

Let me know how it works!
Ryan
 
Two things..

When I was running steaming API and REST API queries from my system long ago, when I set the dashboard option to turn off remote app access my computer would be blocked from Tesla's servers. Is there a quick option in evMote to shut off access to the car? I don't want to see your systems get blocked.

Is there a way I just havent seen yet to download the raw data from a trip? I used to keep the CSV running all the time from the car just to record as much data as possible. Can I get that from evMote?
 
Yep same here.

That's strange. The logs look like they were a little light for trips yesterday, but there were definitely trips being recorded for most users.
I'll take a deeper dive and see if I see anything weird from the Tesla servers. Sometimes, the Tesla servers just go down - they aren't the most reliable service in the world.

Are your trips today working again?

Thanks,
Ryan
 
It worked again today.

That's strange. The logs look like they were a little light for trips yesterday, but there were definitely trips being recorded for most users.
I'll take a deeper dive and see if I see anything weird from the Tesla servers. Sometimes, the Tesla servers just go down - they aren't the most reliable service in the world.

Are your trips today working again?

Thanks,
Ryan