Speak EV - Electric Car Forums banner

1 - 20 of 88 Posts

·
Registered
Joined
·
226 Posts
Discussion Starter · #1 · (Edited)
EDIT: my version stopped working due to changes in Nissan's API, please see post 68 of this thread for @jwilf 's fixed and improved version!

I got a Google home for Christmas and thought it would be good if you could say things like:

OK Google, heat up the car
OK Google, cool down the car
OK Google, turn off the car


So I made a web service that makes it easy to set up using IFTTT (if this then that). Here's a video of it followed by instructions on how to get it working.


How to set it up
  1. Log into your IFTTT account (sign up for one if you don't have one)
  2. Go to applets and click 'new applet'
  3. Click 'this' to set the 'this' part of 'if this then that', ie the trigger
  4. Select Google Assistant as the trigger, and select 'say a simple phrase' on the second screen
  5. Your phrase here can be whatever you choose, as can the response, but fill it in something like this:

    Then press 'create trigger'
  6. Now click 'that' to select the action, and select Webhooks as the action, and click 'make a web request'
  7. Now we need to fill in the URL, putting in your carwings username and password accordingly:
    Code:
    https://o5jlkbjchl.execute-api.eu-west-1.amazonaws.com/prod/LeafStartHeat?username=YOURUSERNAME&password=YOURPASSWORD&region=NE&command=heat
    Also you can change the command (where it says 'heat') to 'cool' or 'off' instead to cool the car or cancel the climate control.
    NB if you are not in Europe you also need to change the 'region' to either NNA (USA) or NCI (Canada)
  8. Now click 'create action' and then 'finish' and you're all done
  9. Repeat the steps to create the commands for cooling the car and cancelling the climate control as required
  10. No more logging into the crappy carwings app :)
Some notes:
  • A limitation is that the Google Home will respond with the canned response irrespective of the success or failure of the API call
  • It takes around 30 seconds for the car to respond
  • The web service is hosted on my Amazon AWS account, I reserve the right to remove this at any time if it starts costing too much, but chances are it'll all be within the free tier so no worries
  • Once set up it means you can use the same commands on Google Assistant on your Android phone too which is nice for when you're away from home
Note: as you can see you are passing your username and password to the web service I wrote. You have my word that I only use these to forward on to the Nissan servers, nothing more. If you're uncomfortable with this please don't proceed. I take no responsibility for any data breaches you have as a result of using this service.
 

·
Registered
Joined
·
20 Posts
I know you mean well, and well done on doing this, but you do need to be careful of data protection and you can't absolve yourself of responsibility for any data breaches. GDPR comes into force in May and tightens up the rules further.
 

·
Registered
Joined
·
226 Posts
Discussion Starter · #3 ·
I know you mean well, and well done on doing this, but you do need to be careful of data protection and you can't absolve yourself of responsibility for any data breaches. GDPR comes into force in May and tightens up the rules further.
I thought since I wasn't storing anything and simply passing through the params there would be no GDPR implications (or at least demonstrating compliance would be trivial). But you're right it's probably not a can of worms I want to open so I've removed the URL from my post.
 

·
Registered
Joined
·
642 Posts
Excellent work Mark. Although my car doesn't support pre-heating through a web service (maybe with OVMS 3 it will), having just got a Google Mini I'd not thought of using IFTTT to activate a URL. Now I'm looking at all the things I can do through a URL that I can control with the Google Mini.
Thank you.
 

·
Registered
Joined
·
226 Posts
Discussion Starter · #6 ·

·
Registered
Joined
·
2 Posts
set up AWS API gateway with the following parameters being passed through:
  • Username
  • Password
  • Command
  • Region
Ok any clues as to how to do this? And what should the Webhooks URL look like - could you give a dummy example.

Sorry, not used AWS before.
 

·
Registered
Joined
·
226 Posts
Discussion Starter · #8 ·
set up AWS API gateway with the following parameters being passed through:
  • Username
  • Password
  • Command
  • Region
Ok any clues as to how to do this? And what should the Webhooks URL look like - could you give a dummy example.

Sorry, not used AWS before.
Have you already set up the lambda function? If so, API gateway is just another AWS service like lambda. So in AWS console press services then API gateway.
 

·
Registered
Joined
·
757 Posts
AWS is Amazon Web Services. I'm guessing the vast majority of people on here have no idea of this side of Amazon's business nor how to even interact with it.
 

·
Registered
Joined
·
226 Posts
Discussion Starter · #12 ·
It should work for a Danish one... Have you double checked you are calling the API right? And that the params are being passed through to the lambda function right?
 

·
Registered
Joined
·
48 Posts
Guys is there any way someone can post an idiot-level step-by-step guide to getting this deployed? I am at the stage where I have set-up the AWS Lambda function but have no idea what to do next...
 

·
Registered
Joined
·
57 Posts
I work in data protection and unless there is personally identifiable information being passed then this won't have anything to do with GDPR. If there is then you need explicit consent.
 

·
Registered
Joined
·
2 Posts
Okay, so I tried and followed all the instructions, but it didn't work.
I'm wondering two things. Did Nissan change something when they updated the app? Or, am I doing the wrong password? There is a username and password for Nissan connect and a username and password for carwings. Which one should I use? Thanks!
 

·
Registered
Joined
·
226 Posts
Discussion Starter · #17 ·
Okay, so I tried and followed all the instructions, but it didn't work.
I'm wondering two things. Did Nissan change something when they updated the app? Or, am I doing the wrong password? There is a username and password for Nissan connect and a username and password for carwings. Which one should I use? Thanks!
Hi I can confirm it is still working. The username password combination you need to use is the carwings one.

Make sure the URL you put into IFTTT is correct, this is where you are most likely to be going wrong. Try the URL you are using in your web browser to see what it tells you. If you've got the URL right you'll see:

Code:
"Preheat command sent"
And the car will start warming up! Or if you've got the URL wrong you'll see:

Code:
500 could not send preheat command
Once you've got the URL right you can put that into your IFTTT command.
 

·
Registered
Joined
·
418 Posts
@Mark Timms this is brilliant, thanks! I've got it working from the URL but it's not doing anything through the IFTTT applet.

What should I be entering for the options when it asks for Method (GET, POST, PUT etc)? It says Content Type and Body are optional so I've left those as default.
 
1 - 20 of 88 Posts
Top