Vehicle command support isn’t as extensive as the current Tesla binding, see Developer Documentation (Vehicles) - Teslascope but Charge Start/Stop is supported (but not documented). The Teslascope developer also has plans to expand the API.
Teslascope does require a nominal subscription, but it’s likely/possible that use of the Tesla API will also be non-free.
I’ll post a link here once I’ve fleshed out support for more items, then will start adding support for commands. My main need is starting climate support and charging start/stop.
I’ve now added pretty much all the channels from the ‘Tesla’ binding that exist in Teslascope. I’m now extracting all that information from the json returned by teslascope, I just need to add the code to update the values into the channels.
Currently, this is read-only - no commands are supported. Over the coming days, I’ll add support for the commands that Teslascope support, ie those described at Developer Documentation (Vehicles) - Teslascope + stop/start charge.
Make sure your api_key is entered correctly in the config. I got bitten in testing as double clicking it to ‘copy’ missed the part after the hyphen. I’ll work on adding some code to catch the error returned by Teslascope and give something a bit more useful than a Json error.
Also if you can enable trace logging and post me the log I can see what’s happening.
It should now catch and report the return code returned by Teslascope.
Apologies to anyone who has already installed and has this running, I renamed some channel names to bring them into line with the OpenHAB naming conventions.
The update was helpful… It makes me realis that I needed to hit save before enabling the thing after making changes in the config. I was just testing against a wrong pubic id.
The binding itself seems to work. Reading the date goes fine. Commands are failing with a 500 response from the API, although that seems a teslascope issue since in their portal it doesn’t work either. I’ll check again later.
I am very pleased to see that you are developing this binding. I too am interested mainly in Climate (and conditioning) control along with Start/Stop charging.
I have created an account on Teslascope (free initial period), created the key and checked that Teslascope has access on my Tesla Account (web). Also I tagged my vehicule as Public in Teslascope (would rather not if it is not mandatory).
The binding can read states (Temperature, vehicule name, etc.) but the one item (switch) I tried, i.e. Lock/Unlock does not seem to work. Openhab log shows the command going out and state change, but nothing happens on the car and in the Tesla App. Also changing the lock state via the Tesla App is not reflected in the binding (even after a minute or so).
Tested with the open/close charge port item.
The car responds correctly to the commands from the binding, and the state is also reflected correctly in the Tesla App. However commands from the Tesla App (and corresponding action on the car) are not reflected in the item. I watched the real-time ‘Tail’ of the Openhab log and no incoming messages on those occasions.
One thing I noted in one of your previous posts is that one can check in the car under “keys” to see if Teslascope is listed: I do not see anything about Teslascope as I see only my card keys and Phone keys. As mentioned, I do see the Teslascope access confirmation in my Tesla online account.
re: commands from the app not showing in OpenHAB… are you able to confirm if the status is correctly reflected in https://teslascope.com/ ? the OH binding can only reflect what Teslascope is reporting…
I may be wrong about the ‘key’ showing in the car, I’ll check my cars a bit later this morning.
Looks like Openhab indeed follows the states as they appear in Teslascope. But the Teslascope site seems to be constantly out of sync, even when the commands are sent from it’s interface:
The Trunk open/close commands operate the trunk OK, but the icon "OPEN TRUNK" in the
interface never changes state, so it does not seem to change the item state in Openhab.
The Charge port open/close command is hit and miss, especially the on close command.
I do not know if this is normal behavior at this point (the UI is a little baffling), but I am only interested in Climate (and preconditionning) along with start/stop and scheduled charge. If I can get those items to work, I will be happy. I will test this over the next couple of days.
I’m using autoconditioning when my wife’s car is at school at her finish time, and charge on/off to automate charging based on grid pricing - these are the two main features I needed.
Incidentally, looking at the page source at Teslascope, I see how to support some more commands
It should be possible to add support for:
door locks on/off
dog mode enable/disable
windows vent/close
trigger homelink
AC start/stop
defrost enable/disable
camp mode enable/disable
steering wheel heater enable/disable
seat heaters enable/disable
Hi Paul,
With the lastest Tesla App version I have (v4.35.5-2775), Tesla has improved the flexibility for all-around pre-conditioning. Ex: If I want to have the car ready to go at 9:00AM and let the car do all the ‘calculations’ in terms of when to start pre-conditioning, when to start charging and when to adjust climate, I go in Schedule and set “Precondition by 09:00AM”, set ’ Stop charging at 09:00AM" (with no start time) and finally set the charge limit I want to have at 09:00AM (ex: 95%).
Now I would like to be able to do this in Openhab Questions: Do you have access to all the commands in the Tesla Fleet API? Can you add the appropriate API commands to the binding so that I can set a ‘Departure time’ and send the required commands to have the car take care of it? This would be specially in winter where it is important to have the battery at an optimal temperature when beginning a drive.
Thanks,
Francois