[PROJECT] Driver for Connecting to Your Tesla Devices

Getting some new errors in the logs now, PMd you logs

Hmm... It is when it is trying to add a child device, it says you do not have the TeslaChild driver loaded... I assume you have that driver still in your Drivers? Do you have any other children (the log looks like there is). It was trying to add the child "site" because there SHOULD be site, solar, battery, and load children it will make, based on the data in the aggregate.

Very odd, nothing has changed in that area in, basically ever... and it is the exact same methods that all the other portions of the code use.

I didn’t make and changes to the child drivers, just swapped out the parent version. Not seeing this with any other devices in the logs.

I also didn’t delete the child devices (haven’t been) they are the same that were created by a previous parent driver, but haven’t seen this issue with previous parent drivers.

Holy Moly @snell that made a huge difference in data!

I'm not noting any errors, things look to be working well.

I think I figured out the "Receiving Power from Grid: False" item. It's talking about the batteries not the system as a whole. Another data says "Grid being used: True", so clearly it knows the grid is providing current, and the load it reports is virtually identical to what the Tesla app reports being drawn from the grid right now.

Huge Change!
S

@jared.zimmerman:
Yeah... I did not think that was the case, but it is really an oddball. The only other thing I can think of is if you have ANY other devices named "site" already, but that should generate it's own Hubitat error about the device name already existing... Let me know if that error continues, but you can probably bump to Debug or lower logging, because the rest worked AND you got me the sample to begin with.

@scottgu3:
Awesome news! Plus yours worked overall (which is a bit crazy at the same time). That information about Receiving... Is very valuable because in the data that is just "grid_services_active". So I think I will rename that attribute to be more for the batteries.

2 Likes

@snell are you calling this "good enough for now" ? completely fine if you are, wondering if you could add in Hubitat package manager functionality for auto updating going forward and I'll mark it as done on the Code bounty $$$ list :wink:

I guess the bigger question is for you two. As the only people that appear to be using it, is it doing what you need it to? Are there features you would like that it is missing (besides Package Manager functionality)? The couple attempts at API access appear to have failed so I may just "rip that out" and call it close enough unless there is more you two would like.

As for Package Manager... UGH... I have looked at that a couple times. In my mind it is annoying. Extra steps, ANOTHER app on my PC (even if it is just a little one it says), more stuff I need to remember every time, and of course I cannot stop doing everything I do now... and I am personally not interested in it so it really does not benefit me either. Heck, I built update notifications INTO my drivers since day 1 (not this driver, my first one) and have refined it over the year+ of driver work. So to toss out a lot of that... Plus end users will have to add MY custom repository to their list, so I do not know that it helps make it much simpler than adding the regular driver and importing once in a while. I just do not know. I have seen this same request on a couple of my other drivers also... so I would have to change ALL of them... otherwise I am not consistent. Sorry... there is even more to it in my mind but I really just do not know yet.

1 Like

@snell Honestly, it does everything I need it to. I need to write some rules to monitor the grid and solar generation, but that's sort of a node-red effort for the future. Right now, this is perfect.

HPM is a nice to have, but hardly critical. Sine this is done for the most part, i don't think its going to be horribly onerous for me to check the git hub occasionally and hit "import" :slight_smile:

Thanks for building this! I appreciate it!!!!

Scott

1 Like

I guess part of my question is "why Package Manager"? I have never really felt the need to use it... the few drivers I use (outside of my own) I generally only check for an update if there is a problem. My own (well... that is cheating) but they have an Event to tell me an update is available. I hardly use any apps at all (outside of Rule Machine and the Broadlink RM setup app) and it really seems geared for an app that has a lot of side extra parts to it.

Not being argumentative at all, I just want to know, because I personally do not feel the need. But obviously there is a place or else they would not have made it and people would not be using it. Trying to figure out if I am on the side of "not really for me" or "fuddy duddy just not using it yet". :slight_smile:

Its doing everything I need right now, I'm sure as I play with it more i'll come up with some more things I'd like, but very happy with what's going on now.

HPM, partly laziness, I have a feeling you might come back and tinker with things, and I'd like the confidence that the code i have is up-to-date, also as someone who is still new-ish to hubitat, there were so many things that were hard to find because they were buried in the forums, having thing in HPM made it easier to find things in my mind.

you mentioned that people would have to manually add your repo? but I see new ones added to HPM all the time that I didn't add, the list just keeps getting longer, I'm sure its work on your end to set that up though?

Also if you are done (for now) let me know what charity you want the Code bounty $$$ to go to!

I will have to think about the charity... But I will put version 1.0 tonight or, worst case, over the weekend. I want to remove all the API portion for now to make it more streamlined.

UPDATE:
Version 1.0.0 "Release" is now posted for both the TeslaDriver and TeslaChild. I removed all the API "stuff" I could spot from the TeslaDriver and tried to streamline it a bit as a result. The Child really only had the version changed.

As usual, if anyone spots any bugs, let me know and I will correct it. Still debating about HPM. I will probably give it a try over the weekend.

2 Likes

Getting this error on occasion now

dev:7052020-06-18 11:59:51.506 pm errorTesla Powerwall - Failure to add site and post Instant Total Current=0

dev:7052020-06-18 11:59:51.490 pm errorTesla Powerwall - TeslaChild driver is not loaded, this is required for child devices. Disabling children for rest of refresh.

Neeeeever mind, looks like I had a driver version mismatch.

Glad it worked out. :slight_smile:

Anything else lately? It is weird to me to have a "released" driver. Even my oldest ones I still consider in progress... although I guess I could probably "finish" a couple of them.

1 Like

I just installed this to query my Powerwalls and it is working fine.

I'm really trying to solve a particular problem: I'm not getting Tesla notifications when the grid goes down (some software issue on their end), so I'm trying to work around that.

I want to query the Powerwall and check for Grid Status, and use that in a rule to raise a notification via Hubitat when that happens.

I was going to write something that just queried that one REST API (/api/system_status/grid_status based upon vloschiavo/powerwall2), but then I thought there might be something that already does this. And so I found this.

So I see the state I want to trigger on... but how to I access it from RM?
image

There should be an Event for it also, which means you can check for the "Grid Status" attribute of the device in RM. In the Trigger Events section you would select Custom Attribute then select Grid Status from the list.

1 Like

Thank you! Your message made it easy for me to figure out in RM:

1 Like

Glad to help.

1 Like

Updated Version(s):

  • TeslaDriver.groovy = 1.0.1
  • TeslaChild.groovy = 1.0.1

Change(s):

  • All boolean attributes have been replaced by strings. I was informed that boolean attributes are not a valid type and it was discovered that this caused an error with some apps. While they display and appear to work just fine (and cause no other errors) I do try to follow what is allowed. So I have gone through and attempted to catch every instance in both drivers.
  • Changes to the logging and update check methods I use based on lessons learned over time since these were last updated.