[PROJECT] Driver for Connecting to Your Tesla Devices

@snell can you please add actuator as a supported capability? It will allow folk to use RM to control the driver options.

I’ve tested it and it works great.

1 Like

Surprised it never got added before to be honest. I will try to get it done tomorrow morning.

1 Like

Cheers. :+1:

Updated Version(s):

  • TeslaDriver.groovy = 1.2.10
  • TeslaChild.groovy = 1.0.3

Change(s):

  • Actuator capability has been added to the parent driver. This allows the commands to be run using other apps such as Rule Machine. The child driver has no commands (it is purely a data-storage entity) so the capability was not added to the child.
  • Slight code change to posting events to child devices to support new option of forcing events to be shown as changed even if they were not.
2 Likes

Awesome work sir. :slight_smile:

Will this indicate if your grid is out and you are being powered off the Powerwall?

Yes, it’s very handy.

1 Like

I'm using Hubitat with 2 PW. I use Rule Machine to control the PWs. I cannot find documentation of the features/attributes available with Rule Machine device manager for PW, have to use guess work and trial and error. I would like to know how to determine Net Grid Usage (in a time period).

Just compare the values you see in the Tesla app with those you see in Hubitat, and go from there.

1 Like

What attributes do i test/capture in Rule Machine. For example, I can capture PW charge level at specific times and compute the difference in charge level between those times. Tesla app shows kWh from grid, to Grid and Net grid usage. How do I access (compute) that info using the driver with Rule Machine?

Just go into the Tesla driver, every imaginable battery State is available for use in Rule machine. Eg

I don't use the Hubitat driver, but gather the same information from my Powerwalls using Node-RED. I think the driver has maintained the same naming conventions as the Tesla API, so this may help to compare what the driver attributes are with what they are called in the Tesla app (Eg: Site = Grid, Battery = Powerwall, Load = Home, Solar = Solar..etc.). The API documentation is at the link below.

The "instant" readings are the current readings (what you see in the animation in the Tesla app), The other readings are cumulative numbers. What I do in Node-RED is to get the aggregate readings at midnight and then subtract that from the latest reading (every 5 minutes) to get the total for the day. To get the amount generated/used in the last 5 minutes, I subtract the latest reading from the previous reading. The info is all stored in a database and I can generate a dashboard like this:

If you post screenshots of all the current state values and names (@dJOS had a partial screenshot), I may be able to help you figure this out.

Thanks, but code reading is something I am hoping to bypass. Also, I need info like what are the uints and time period for Battery Enegy exported and are they the same as for Battery Instant Power (are energy units and power units the same?)?

Mind you I am super impressed with the driver functionality.

That isnt what im suggesting at all - just open the installed Tesla device driver from Devices:

Then everything under "Current States" is available to use in Rule Machine:

kW = Energy being consumed/imported/exported at that moment in time.
kWh = Actual Energy used over time (hence the "hour"). Telsa measures energy used over 24hr periods, just like every utility.

Thanks again, that was helpful, but My Current Status shows much less info and has a different devive driver name (Powerwall, not Powerwall 2). Also, looks like I need to learn about child devices.

Anyway, I just ordered a C8 which will not arrive for a few days.

Powerwall 2 is just @dJOS's naming of the Powerwall device. The actual driver names are shown in the Type column of his Devices list screenshot.

I would (personally) recommend child devices because they make it easier to segment the data. Not sure why the Current States list would be shorter though, most anything the powerwall replies with should be there.

1 Like

That's a great looking dashboard, but doesn't look like the native dashboard. Can you link for more info on how it was created?

It is not the native dashboard. I use Node-RED (https://nodered.org/) for all automation logic and this is built using that platform.

Well my C-8 delivery is delayed. However, I think the source of the different Current Status is I'm using the Darwin Driver, NOT this one (they use different code). My problem now is that I do not know how to install and use this driver. I can get it installed as a separate driver, but don't know how to 'use' it in rule machine.

Not familiar with the Darwin driver unfortunately, so I cannot help with that.

With these drivers (parent and the child if you use that) you should be able to select the custom attributes within Rule Machine. There are only limited commands available from the drivers though (it is focused on reading the data from the Powerwall NOT trying to control the Powerwall itself). The parent driver alone has a large number of attributes. The attributes will not have values until the parent device polls the Powerwall for data and populates them.