Announcement

Collapse
No announcement yet.

Seeking help for Tesla Powerwall integration or dev to work with if willing

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Seeking help for Tesla Powerwall integration or dev to work with if willing

    Hi All,

    I've got a Tesla Powerwall, and i'm looking to get some advice on what the best way to integrate it in, or see if there's a dev that might be willing to work with me to develop a plug-in to support this.

    I think having a plugin / function to support this would be an absolute killer feature for anyone with a Powerwall (which is a pretty decent global market and growing), as what i'm seeking to do is to query the local device as it can be queried over HTTPS (pictures below) and the API interface is well documented (refer link below) so its possible to work out when:
    • Your solar is generating and the level of generation
    • When you're sending solar back to the grid (i.e. exporting) and the level of this
    • When you're using grid power, and the levels
    • When you're using the powerwall itself and the levels
    Based on this information, you could then very easily:
    • Turn air-conditioners / heating on or off, washing machines / dish washers or other high energy usage devices for when you're exporting back to the grid - this would essentially enable you to heat / cool your house for free, as well as minimise your other costs & impact to the grid where possible
    • Turn car charging on/off during the same scenario - given that there already is a Telsa (car) plugin for Homeseer where you can schedule or remotely turn the charging on/off, this again would be an absolute killer feature for integration and literally enable you to run your car on sunshine
    • Collect and store the stats long term - whilst the Telsa app is great, it loses its fidelity outside of 48 hours or so, so being able to collect and store (in another plugin / system) this data would be ridiculously useful for lowering your energy usage and costs over time
    • Respond during grid outage scenarios when you're using the battery and use this telemetry to smart control your house (e.g. turn off air-con, other high usage devices) so that you can use your battery most efficiently
    • Program in the costs of electricity during times of day (e.g. peak, off-peak, shoulder) as well as your export rates (e.g. what you get paid) and track this and make smart decisions
    • Make sure you're fully utilising the capacity of your solar - some people are limited in what they can export to the grid (e.g. export limited to 4KW on a 10KW system) due to local power companies, so once you've charged your battery in the morning, the full capacity of your solar isn't being used as you get throttled back to say 6KW (4KW export + 2 KW usage)
    In regards to the technology behind this might work:
    • Each Powerwall install has a smart gateway which has a local IP address. This address can be hit up through the browser (https://<ip address>) and if gets you a webpage visualising the stats (refer screenshots)
    • Likewise, there is an API (fully documented here - https://github.com/vloschiavo/powerwall2) which you can query and it provides the results back (refer screenshot). That github page is up to date, with the exception that the Powerwalls use HTTPS now with self signed certificates, so any integration would need to be able to work around self signed certificate / https issues
    • I'd suggest that the plugin (or other integration if i could do this already with an existing product) would query specific URLs / APIs, parse the results, and then create / update homseer devices with the info. I've already tested the queries and can confirm that you receive results & can provide the results to troubleshoot the integration
    • You would then create events using the native homeseer functionality (e.g. if grid export has been greater than 1KW for more than 1 minute, turn on device) based on the values of the devices created, and control the functions as you need
    So what am I asking? Well i'm not a developer myself, but i've got a lot of experience tinkering and doing basic integrations, plus writing requirements, doing testing and performing other integration.

    I'm more than happy to get pointed in the right direction for a plugin / way to do this, but ideally, i'd love to work with a willing dev (if one was interested) to jointly develop and test this plugin and get it as an official plugin as I really think it'd prove popular, cover something not in place today, as well as help Powerwall owners to lower their energy usage and impact to the planet as they could reduce or avoid the amount of energy they'll need to use from the grid.

    I'm happy to contribute some funds to cover their time if this is what they'd like, and they'd retain the IP & ownership for a plugin. I'm also happy to provide the suggested requirements / prioritisation of these based on what would likely be popular, test the plug-in (if they didn't have a powerwall themselves), write the user or other documentation, as well provide any other help that they'd like.

    If this isn't something that a dev might be interested in, all i'm asking for is some suggestions on how i could do the web queries and parsing myself to achieve this same function, and i'm more than happy to document this and provide this back to the community as the community has been great in helping me out to date.

    Thanks all,

    Kieran

  • #2
    Hi Kieran

    I’m not a plug-in developer so can’t help with that exactly.
    We are expecting to get a Powerwall 2 and backup gateway soon (having waited since September 2018) and I will also be looking to integrate it with Homeseer. I have written scripts to bring in data from our SolarEdge inverter which works very well in almost real time and I would be hoping to do something similar with the Powerwall (when it eventually arrives)
    I will post something here when the Powerwall arrives.

    Jez

    Comment


    • #3
      Hey Jez,

      I'm about to head off on some travel, but if you want to pm me and are willing to share your current scripts, then I'm happy to try adapting them when I'm back, and then work together to try and get some basic integration going.

      I'm super excited as I've just configured my model 3 here in Australia, and it's due in August

      Comment


      • #4
        schnark I'm leaving for a mini-vacation this weekend. Based on what you've said so far it seems an integration is feasible. If interested we are willing to take a look at the documentation and API that you have and if feasible we can discuss the plugin development.

        Comment


        • #5
          No Powerwall here. We don't have tiered pricing so it is not justifiable at this time. I get paid for the TOTAL I produce, not the net sent to the grid. The grid is my battery. Fortunately, the power only goes out a couple of times a year and I have a genset for those times.

          Managing power is high on my list. I have a 10k solar system which is generating more than I use. I have great monitoring of the solar production and consumption via an energy monitor called egauge. For the last 12 months, my stats are:

          Produced: 9.9 MWh
          Consumed: 6.49 MWh
          Excess: 3.41 MWh

          Here is a current screenshot of my egauge monitor screen

          Click image for larger version

Name:	solar.JPG
Views:	180
Size:	90.3 KB
ID:	1308127

          Note that I have been away for a few days so consumption is low.

          When I first installed the solar, my mindset was to reduce my consumption as much as possible so that I would end up not paying for any power by year end. Maybe I was a bit too successful with that. Now I find myself looking for ways to use the excess.

          My main heat sources are wood stove and propane forced air furnace. I'd like to work on reducing my propane costs which are about $1,000 per year. I've begun to introduce electric oil space heaters. They are safe and quiet and are powered and controlled by Zooz switches. The Zooz are nice since they monitor power usage. They are z-wave so the plugin creates devices for the power usage.

          It would be great if the egauge stats were imported into HS3 every 10 seconds or so. That way, one could tailor usage based on energy produced in my energy management events as well as surface the stats in HSTouch apps. The egauge system has an api which is documented here.

          Also, I have owned a Chevy Bolt for the last year. It gets charged on this system. When charging, consumption spikes to about 8kw. I love the Bolt. With a range of about 230 miles, for my use cases it is perfect. I've often dreamed how nice it would be to use the 60kwh Bolt as my battery in the event of a power failure but I doubt GM will allow that to happen.

          Comment


          • #6
            Here is the full graph for today. Nice sun. You can see where I arrived home around 6:15pm.

            Click image for larger version

Name:	egauge20190531.JPG
Views:	158
Size:	91.3 KB
ID:	1308194

            Comment


            • #7
              Originally posted by schnark View Post
              Hey Jez,

              I'm about to head off on some travel, but if you want to pm me and are willing to share your current scripts, then I'm happy to try adapting them when I'm back, and then work together to try and get some basic integration going.

              I'm super excited as I've just configured my model 3 here in Australia, and it's due in August
              Hi Kieran. Just to be clear, my scripts are to bring in data from the SolarEdge inverter. I’ve just heard that our Powerwall 2 will be installed in a couple of weeks so I’ll be able (and eager) to work on scripts to bring that dataset through to Homeseer.

              Comment


              • #8
                Originally posted by logbuilder View Post
                It would be great if the egauge stats were imported into HS3 every 10 seconds or so. That way, one could tailor usage based on energy produced in my energy management events as well as surface the stats in HSTouch apps. The egauge system has an api which is documented here.
                If nothing else is forthcoming, you should be able to use my datascraper to grab much of the info into HomeSeer.
                Jon

                Comment


                • #9
                  Originally posted by jon00 View Post

                  If nothing else is forthcoming, you should be able to use my datascraper to grab much of the info into HomeSeer.
                  Thanks! I'll try to learn more about it.

                  Comment


                  • #10
                    Hi Jez,

                    I'm now back from my holiday, so if you can send me through your scripts, more than happy to start the work on this. I understand that your scripts are for the SolarEdge, but if you can send them through, i'll start adapting them for the PowerWall using the APIs

                    Comment


                    • #11
                      Hi all - I've actually just completed the Powerwall plugin myself. As a Powerwall 2 owner and HS enthusiast this was something I wanted to have integrated for all of the reasons folks have said on this thread. I will look to publish shortly.

                      Click image for larger version

Name:	HS Powerwall Plugin.png
Views:	100
Size:	38.7 KB
ID:	1315493

                      Comment


                      • #12
                        schnark let me know if there are any other features you think would be good to include. I've made some updates over the weekend and it's been running solidly on my local system. With the new Homeseer mobile app I've put together a replica of the Tesla app, which is pretty slick!


                        Click image for larger version

Name:	Screenshot_20190715-100619_HomeSeer Mobile.jpg
Views:	97
Size:	55.8 KB
ID:	1315883Click image for larger version

Name:	Screenshot_20190715-100631_Tesla.jpg
Views:	85
Size:	31.9 KB
ID:	1315884

                        Comment


                        • #13
                          That's awesome man - nice work! Our car is (hopefully) arriving next month so this was on my list of things to do.

                          From what you've provided, i'd suggest the following:
                          • It would be great if you could add in values for the the totals produced / used every day for the grid, solar, home and powerwall
                            • I.e. record the stats on the Energy Usage page when you drill in on any of them. I'd suggest different stats for used vs. produced / sent to grid, to/from powerwall, and single stats for house and solar totals
                            • thesenumbers would increase over the day and then reset at night time
                            • Ib that these stats are already available over the API, but happy to be corrected
                          • On the earlier post, you've got a negative number next to Site Watts, but i'm not quite sure what this is about
                            • Is this showing that you're sending back to the grid at -4289Watts?
                            • Ifso, i'd suggest that you rename Site Watts to Grid Watts
                          • Can you elaborate as to whether you can currently see if you're sending to the grid (i.e. exporting) vs. using the grid if the above info isn't true
                            • This would be a key bit of info to then use to trigger actions
                            • Doest show up as negative values in the Site Watts?
                          • Do you think its worth splitting the To / From Grid for the instantaneous values? I'm not sure either way
                          • Absolutes goal, but it'd be great to show if Storm Watch was enabled, and then if it was active

                          Would love to get a copy if you're willing to let me try out / bug test with you. More than happy to document the process and contribute this back if helpful.

                          Thanks for your awesome work!

                          Cheers,

                          Kieran

                          Comment


                          • #14
                            Great suggestions, here are my thoughts.
                            • I wasn't intending on making this an energy device as it is possible people have multiple energy meters and the Powerwall could potentially only have a limited view in to a part of the system. For example my single Powerwall is not sufficient to back up high watt appliances like the dryer, oven, or AC so those are on a separate circuit that is not backed up. Primary goal was to have amounts that were triggerable rather than reporting on the energy, which IMO HS is not as good at as other options. May reconsider this if it is helpful.
                            • I'm not a fan of the verbiage but "site" is what Tesla calls the utility connection and I simply copied that in the plugin. I'm on the fence about departing from the wording Tesla uses though I totally agree it's crummy.
                            • Negative numbers in Site Watts indicate power is being sold back and negative numbers in Battery Watts indicates the battery is charging. Solar and Load should never be negative.
                            • Could add to/from grid values though those are easy to script out based on the Site Watts value and I know not everyone has the capability of selling back to the grid.
                            • LOVE the storm watch idea however that's a new feature and the API documentation vloschiavo posted was created before that feature was around so there is no documentation. Will have to poke at it.

                            Comment


                            • #15
                              Thanks for the quick response back - here's my thoughts:
                              • Understand where you're coming from with the energy device, and I'm guessing that you've only got the Powerwall covering a single phase? Agree that the main outcome / benefit needed is triggerable data, and there are other monitoring options if you buy other hardware, but given the constraints with long term retention of data in the Tesla app, having the data coming in would be awesome as you could then feed it out to splunk or something similar. I'll be documenting shortly how I've done this so other people can send and report on info in splunk, and once I've got they plugin, I'll also update the info how to do it with this as well. I also think this functionality would also help people out who were only on a single phase, or who are using the new 3 phase gateway and have multiple Powerwalls. As always though, appreciate any functionality you're willing to provide
                              • As long as you can rename it, I'm not stressed, but I'd also point out it's visually shown as grid as per the app screenshot
                              • Cool, what you've said makes sense on the next two points and if it was able to be split out for both to/from grid and battery, then that'd be awesome. That said, your current functionality provides a way to get this data and use it in events
                              • No problems about storm watch functionality - happy to wait, or assist in looking into this if you'd like
                              Many thanks again, and happy to help out how ever you need.

                              Comment

                              Working...
                              X