Tesla Battery Gateway Plugin

Posted on
Mon Oct 19, 2020 6:05 pm
GlennNZ offline
Posts: 1084
Joined: Dec 07, 2014
Location: Central Coast, Australia

Re: Tesla Battery Gateway Plugin

Try 0.5.7
Pretty sure fixes issue reported.

Thanks

Posted on
Thu Oct 29, 2020 2:29 pm
jonc offline
Posts: 7
Joined: Apr 19, 2016

Re: Tesla Battery Gateway Plugin

Glenn,
The latest version fixed my issue. I have been integrating and testing for the last week and it all works perfectly. Thanks for the rapid response and fantastic support.
Jon

Posted on
Sun Nov 01, 2020 11:50 pm
GlennNZ offline
Posts: 1084
Joined: Dec 07, 2014
Location: Central Coast, Australia

Re: Tesla Battery Gateway Plugin

Image

New Release 0.6.4

Given changes in Battery software 1.50.1 removing local control

Moves to using Tesla online API to change battery mode, and now optional battery reserve percentage.
Update code to achieve this, update pluginConfig data, remove unneeded data

Also enables addition of online states in Battery
Online Battery States:
    battery mode
    Current set battery backup reserve percentage
    software version of battery
    battery count

This remains optional, if not controlling battery fields can be left blank, new states will also remain blank.

Usage:
Enables rapid changing mode of battery to suit electricity prices, multiple times
Works instantaneously, no downtime and no risk of battery going offline.

In Plugin Store.

Posted on
Fri Jan 01, 2021 12:15 pm
ChiefMonk offline
Posts: 24
Joined: Nov 28, 2014

Re: Tesla Battery Gateway Plugin

Hi,

Early days for me with this and all generally great.

I am getting this when trying to change the mode though. Is this a set up error on my part or is there some other issue?


Regards


Chris




Tesla Battery Error Error change Operatonal Mode : ValueError('could not convert string to float: ',)
Traceback (most recent call last):
File "plugin.py", line 872, in setOperationalModeOnline
if self.changeOperationOnline(mode, reserve, setreserve): ## success do the rest
File "plugin.py", line 674, in changeOperationOnline
percentage = float("%.1f" % float(reservepercentage))
ValueError: could not convert string to float:
WebServer request to execute "_preview_01 - Temperature copy" control #14 from 192.168.10.25
Tesla Battery Error Error change Operatonal Mode : ValueError('could not convert string to float: ',)
Traceback (most recent call last):
File "plugin.py", line 872, in setOperationalModeOnline
if self.changeOperationOnline(mode, reserve, setreserve): ## success do the rest
File "plugin.py", line 674, in changeOperationOnline
percentage = float("%.1f" % float(reservepercentage))
ValueError: could not convert string to float:
WebServer could not find control page "_preview_01 - Temperature copy"

1 Jan 2021 at 18:08:09
Tesla Battery Error Error change Operatonal Mode : ValueError('could not convert string to float: ',)
Traceback (most recent call last):
File "plugin.py", line 872, in setOperationalModeOnline
if self.changeOperationOnline(mode, reserve, setreserve): ## success do the rest
File "plugin.py", line 674, in changeOperationOnline
percentage = float("%.1f" % float(reservepercentage))
ValueError: could not convert string to float:


Posted on
Fri Jan 01, 2021 4:29 pm
GlennNZ offline
Posts: 1084
Joined: Dec 07, 2014
Location: Central Coast, Australia

Re: Tesla Battery Gateway Plugin

Hi

Thanks - have had a look and it is a small bug, presumably you were not wanting to change battery reserve?
I’ll post an update (involves moving a line of code down 5 lines!)

But for moment could in current action - select alter battery reserve percentage, enter your usual value, save, then reopen action and unselect alter battery reserve. That should sort it out.

Basically I added the option not to alter reserve percentage late and the code expects a valid value battery reserve to be present before will do anything.

Glenn


Sent from my iPad using Tapatalk

Posted on
Sat Jan 02, 2021 3:01 pm
ChiefMonk offline
Posts: 24
Joined: Nov 28, 2014

Re: Tesla Battery Gateway Plugin

Awesome - thx


Chris

Posted on
Mon Jan 04, 2021 5:14 am
ChiefMonk offline
Posts: 24
Joined: Nov 28, 2014

Re: Tesla Battery Gateway Plugin

Hi Glenn, just to confirm what you already know .... that it works fine if you do the state and level change at the same time.

Thanks






GlennNZ wrote:
Hi

Thanks - have had a look and it is a small bug, presumably you were not wanting to change battery reserve?
I’ll post an update (involves moving a line of code down 5 lines!)

But for moment could in current action - select alter battery reserve percentage, enter your usual value, save, then reopen action and unselect alter battery reserve. That should sort it out.

Basically I added the option not to alter reserve percentage late and the code expects a valid value battery reserve to be present before will do anything.

Glenn


Sent from my iPad using Tapatalk

Posted on
Mon Jan 04, 2021 5:15 am
GlennNZ offline
Posts: 1084
Joined: Dec 07, 2014
Location: Central Coast, Australia

Re: Tesla Battery Gateway Plugin

Thanks. Good to hear all is good.
Sorry had meant to fix/update - will do so in next 24hours or so...



Sent from my iPad using Tapatalk

Posted on
Thu Feb 18, 2021 1:53 pm
jonc offline
Posts: 7
Joined: Apr 19, 2016

Re: Tesla Battery Gateway Plugin

Hi Glenn,
My Powerwall updated to 20.49.0 and it broke the plugin - not getting battery SOC or current measurements. Debugging showed:

Tesla Battery Error Caught Exception in Fillbattery Info
Traceback (most recent call last):
File "plugin.py", line 1297, in fillbatteryinfo
percentage= float(data['percentage'])
KeyError: 'percentage'


Tesla Battery Error Caught Exception in FillGridStatus Info
Traceback (most recent call last):
File "plugin.py", line 1327, in fillgridstatusinfo
device.updateStateOnServer('gridStatus', value=data['grid_status'])
KeyError: 'grid_status'

Any help appreciated.
Thanks,
Jon

Posted on
Thu Feb 18, 2021 2:19 pm
GlennNZ offline
Posts: 1084
Joined: Dec 07, 2014
Location: Central Coast, Australia

Tesla Battery Gateway Plugin

Bugger, updates....

My is obviously behind - but probably not for long.

Could you send me debug log output (that should contain the breaking changes) and I’ll have a look late today?

Edit:
On further looking no need to send debug. It won’t be connecting; authenicating period. 20.49 is a bit oauth change that buggers everything up. So bad some have downgraded following DW Tesla. Seems still may to get local data thought - but my eta may be out for a fix!

Sent from my iPad using Tapatalk

Posted on
Fri Feb 19, 2021 12:49 am
GlennNZ offline
Posts: 1084
Joined: Dec 07, 2014
Location: Central Coast, Australia

Re: Tesla Battery Gateway Plugin

Ok - Have managed to get this working on my testing

Update for Battery Software 20.49.0 and above...

Try:
0.6.8
https://github.com/Ghawken/TeslaBatteryPlugin

Changes to Oauth3 token for local access (done in 0.6.6). That aspect seems fairly robust and working well.
Have it rechecking expired token once an hour.

&
0.6.8
Updates online to Oauth3 as well (which discovered wasn't working - although less loud in errors)
Again working on my limited testing, get online site_info and change mode/battery reserve working on my testing..

Give it a try...

Glenn

Posted on
Sun Feb 21, 2021 1:17 pm
roquej offline
User avatar
Posts: 552
Joined: Jan 04, 2015
Location: South Florida, USA

Re: Tesla Battery Gateway Plugin

Glenn,

Have the latest version installed. No errors. Solar production and Grid power are reported correctly. However, the % battery is incorrect. In fact, it's never updated.

Any suggestions?

JP

Posted on
Sun Feb 21, 2021 2:16 pm
GlennNZ offline
Posts: 1084
Joined: Dec 07, 2014
Location: Central Coast, Australia

Re: Tesla Battery Gateway Plugin

roquej wrote:
Glenn,

Have the latest version installed. No errors. Solar production and Grid power are reported correctly. However, the % battery is incorrect. In fact, it's never updated.

Any suggestions?

JP

Hi

Glad no errors.

There have been a lot of Tesla server changes; fixed one and then literally was another.(took a while to discover was another...).

Everything Tesla library has stopped working in the last 12 hours .... for some unknown reason all requests to Tesla need to have No headers; otherwise infinite hang. .. presumably this will change again. But for the moment all good.

Your issue - seems strange,
No obvious code cause that I can see - if it gets other aspects no reason battery/soe data shouldn’t return.

On version 0.7.2?
Battery version? Possible if still on earlier version may see unpredictable issues.

Plugin Checks battery/system_soe every minute so a debug log for 5 minutes or so probably will help.

Glenn


Sent from my iPad using Tapatalk

Posted on
Sun Feb 21, 2021 4:53 pm
roquej offline
User avatar
Posts: 552
Joined: Jan 04, 2015
Location: South Florida, USA

Re: Tesla Battery Gateway Plugin

I was on 0.6.8, which I thought was the latest version. Just upgraded to 0.7.2 and it seems to be working. I will monitor and let you know.

Thank you for the quick response!

JP

Posted on
Sun Feb 21, 2021 5:09 pm
GlennNZ offline
Posts: 1084
Joined: Dec 07, 2014
Location: Central Coast, Australia

Re: Tesla Battery Gateway Plugin

roquej wrote:
I was on 0.6.8, which I thought was the latest version. Just upgraded to 0.7.2 and it seems to be working. I will monitor and let you know.

Thank you for the quick response!

JP
Thanks.

Seems Tesla working on their servers.. almost a running commentary of working again.

Presume once Tesla updated/fixed - will need to add headers again to calls... expect some disruption ... but I’ll update code and here.

https://github.com/timdorr/tesla-api/is ... -782824762

Glenn


Sent from my iPad using Tapatalk

Who is online

Users browsing this forum: No registered users and 1 guest