[RELEASE] Tesla Powerwall Manager Smart App and Device Handler

This is a beta release smart app and device handler for the Tesla Powerwall II home battery.

For documentation and more information on this smart app and device handler, see: https://darwinsden.com/powerwall

Thank you to @RLS and @trentfoley for your earlier work interfacing Tesla and Powerwall features. I believe this app and handler fill a current gap, but apologize if there is overlap.

The Smart app currently must interface directly with the Tesla Servers, and so unfortunately requires your Tesla credentials.

This software was developed for my personal use and is provided here in the hopes that it will be useful to others, however, it is beta software and use of this software may result in unforeseen side effects to your equipment and related accounts. Use at your own risk!


  • Monitor and View Status:

    • Battery % level & Reserve % Level, Power status of Solar, Grid, Home, & Powerwall
    • Operational Mode Status (Backup-Only/Self Powered/Advanced Time Controls)
    • Optimization Strategy (Cost-Saving/Balanced)
    • Stormwatch Enabled Status
    • Grid/Power Outage Status (added 13-Aug-2019)
  • Control:

    • Set Reserve % Level
    • Set Operational Mode Status (Backup-Only/Self Powered/Advanced Time Controls)
    • Set Optimization Strategy (Cost-Saving/Balanced)
  • Define Schedules & Automations:

    • Schedule Operational Mode and/or reserve percentage changes to occur at specified times and days of the week
    • Select smart devices to automatically turn off in the event of a grid outage (added 13-Aug-2019)
  • Customize built in notification options to receive push and/or text notifications when:

    • Powerwall battery level approaches the reserve level
    • Powerwall battery level reaches a user-defined notification % value
    • Modes change
    • Firmware version changes
    • Grid/Power outage status changes (added 13-Aug-2019)
  • Monitored values and mode and level controls are exposed to SmartThings allowing integration with other smart apps such as WebCoRE.


Looks good. Nice to get it back into native groovy. I wish there was a method to directly control the amount of off peak charge, the Tesla algorithm is bizarre.

1 Like

Thanks, and I agree. Tesla’s time-based control mode never seems to do exactly what I would expect. I recognize the benefit of the ‘smarts’ they have added for some users and use cases, but for my needs, I would much rather have simple controls for scheduling basic modes and parameters. This app allows for some of that, but for whatever reason, it can take several hours for the Powerwall to change modes after being commanded. Hopefully Tesla will address some of this in future software updates.

Installed. Now I just need a Tesla.

1 Like

no worry… this is alteady in the chapter 7 of the Apache license 2.0 you included in your code.

“You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License.”

I hardly think anyone in this forum would bring anyone in court for a DTH or a smartapp even though after few years in the US I still have hard time understanding the mindset.

If we start freaking out our devs can mess up things then this forum can close so let’s keep it simple and enjoyable.

Funny. Test drove a performance model 3 last week. Still outta my $$ range, but good to dream.

Installed and working, thanks! Tying this in with automation over Webcore. Is there a way to detect when the utility power grid is out? (black out)

Great suggestion. I updated the app and device handler to indicate the grid status from the Powerwall. The device attribute “gridStatus” will now be either “onGrid” or “offGrid”. To make things easier if you want to use Smart Lighting or other standard apps, I also added a switch capability to the device type so that “on” indicates the Powerwall is connected to the grid and “off” indicates a disconnect/power outage.

Since it only added a few more lines of code, I added grid status push/text notification option as well as an option to select devices to turn off during an outage in the Powerwall manager app itself. I configured my app to turn off the bar fridge in the event of a power outage, but now that I think about it, an operational bar fridge in an extended outage might be critical…

I did a quick run-through with a simulated outage, but won’t be able to give it a thorough test until tomorrow, when I can shut off grid power without disturbing the family.

Let me know if this will work and/or if you have other thoughts on implementation.

Awesome! Can’t wait to try this out once I get my Powerwall (still waiting on two referral red ones).

Great! I only have one, so I’m curious how well this works with multiple Powerwalls.

I’ve completed a quick test of the updates to add grid/outage status. If you’ve already installed the prior version, you’ll need to update both the smart app and device handler for all the changes to work properly.

As a side note, the Powerwall performed flawlessly when I cut off grid power to test the update. This is the first test I’ve done on the latest V1.37.1 software version. The Powerwall immediately cut over to power my home, and solar continued charging the battery. I think with a little care and forethought (and unfortunately no air conditioning considering I’m only using a single Powerwall), my home power could be indefinitely sustainable without grid-power. The Powerwall is just plain awesome.

© 2019 SmartThings, Inc. All Rights Reserved. Terms of Use | Privacy Policy

SmartThings; SmartApps®; Physical Graph; Hello, Home; and Hello, Smart Home are all trademarks of the SmartThings, Inc.