Tesla Battery Gateway Plugin

Posted on
Tue May 12, 2020 1:05 am
GlennNZ offline
User avatar
Posts: 1563
Joined: Dec 07, 2014
Location: Central Coast, Australia

Re: Tesla Battery Gateway Plugin

Okay - that was the reported previous issue

Can overcome by restarting after setting command - but does risk leaving the battery and backup off if commands fails ? (Which was reason I didn’t progress)

Have fixed the issue in 0.4.2 up now

Glenn


Sent from my iPhone using Tapatalk

Posted on
Tue May 12, 2020 1:13 am
petematheson offline
Posts: 847
Joined: Sep 14, 2014
Location: Southampton, UK

Re: Tesla Battery Gateway Plugin

Back to this error now:
Tesla Battery Error Method Not Allowed

If I log in and hit start it starts instantly, no gateway restart or anything from what I can see?


Tesla Battery Debug logLevel = 10
Tesla Battery Debug User prefs saved.
Tesla Battery Debug Debugging on (Level: 10)
Action Group Tesla PW Backup
Tesla Battery Debug setFanSpeed Called as Action.
Tesla Battery Debug Thread Send Login Basic called. Number of Active Threads:2
Tesla Battery Debug Calling https://192.168.0.161/api/login/Basic with payload:{'username': 'installer', 'force_sm_off': False, 'password': xxxxxxx', 'email': u'pete@petematheson.co.uk'}
Tesla Battery Debug {"email":"pete@xxxxxxx","firstname":"Tesla","lastname":"Energy","roles":["Provider_Engineer"],"token":"UXzn0onLxxxxxxxJlYM9V24JG77WpgQ==","provider":"Basic","loginTime":"2020-05-12T08:11:25.112290392+01:00"}
Tesla Battery Debug UXzn0xxxxxxxM9V24JG77WpgQ==
Tesla Battery Debug Change Operation called. Number of Active Threads:2
Tesla Battery Debug Calling https://192.168.0.161/api/operation with headers:{'Authorization': 'Bearer UXzn0onxxxxxxxxx4JG77WpgQ=='} and payload {'backup_reserve_percent': 0.0, 'mode': u'backup'}
Tesla Battery Error Method Not Allowed

Tesla Battery Debug update Tesla Meters Called
Tesla Battery Debug ThreadSendCOmmand called. Number of Active Threads:2
Tesla Battery Debug sendcommand called
Tesla Battery Debug HTTPS CURL result:
Tesla Battery Debug ReturnCode:0
Tesla Battery Debug ReturnCode:0
Tesla Battery Debug Text :<closed file '<fdopen>', mode 'rb' at 0x10f70e9c0>
Tesla Battery Debug Error Running command. ?Powerwall offline
Tesla Battery Debug update Tesla Grid Status Called
Tesla Battery Debug ThreadSendCOmmand called. Number of Active Threads:2
Tesla Battery Debug sendcommand called
Tesla Battery Debug HTTPS CURL result:
Tesla Battery Debug ReturnCode:0
Tesla Battery Debug ReturnCode:0
Tesla Battery Debug Text :<closed file '<fdopen>', mode 'rb' at 0x10f70e780>
Tesla Battery Debug Error Running command. ?Powerwall offline

Posted on
Tue May 12, 2020 1:29 am
GlennNZ offline
User avatar
Posts: 1563
Joined: Dec 07, 2014
Location: Central Coast, Australia

Re: Tesla Battery Gateway Plugin

That doesn’t look great
Doesn’t seem to be recognising either command or token
Try 0.4.4


Sent from my iPhone using Tapatalk

Posted on
Tue May 12, 2020 1:33 am
petematheson offline
Posts: 847
Joined: Sep 14, 2014
Location: Southampton, UK

Re: Tesla Battery Gateway Plugin

Unfortunately not :(


extToSpeak :
Tesla Battery Debug Thread Send Login Basic called. Number of Active Threads:2
Tesla Battery Debug Calling https://192.168.0.161/api/login/Basic with payload:{'username': 'installer', 'force_sm_off': False, 'password': xxxxxx', 'email': u'pete@xxxxxxxx'}
Tesla Battery Debug {"email":"pete@xxxxxxx","firstname":"Tesla","lastname":"Energy","roles":["Provider_Engineer"],"token":"aKaht0lxxxxxxxFRMuOqw==","provider":"Basic","loginTime":"2020-05-12T08:31:58.866239999+01:00"}
Tesla Battery Debug aKaht0lxxxxxxxxRMuOqw==
Tesla Battery Debug Change Operation called. Number of Active Threads:2
Tesla Battery Debug Reserve Percentage is :0.0 and prior 0
Tesla Battery Debug Calling https://192.168.0.161/api/operation with headers:{'Authorization': 'Bearer aKahtxxxxxxxMuOqw=='} and payload {'backup_reserve_percent': 0.0, 'mode': u'backup'}
Tesla Battery Error {"code":403,"error":"Unable to POST to resource","message":"User does not have adequate access rights"}
Tesla Battery Error change Operation failed.

Posted on
Tue May 12, 2020 1:34 am
GlennNZ offline
User avatar
Posts: 1563
Joined: Dec 07, 2014
Location: Central Coast, Australia

Re: Tesla Battery Gateway Plugin

Ok
Thats a different error for some reason
Have you set the reserve percentage in the action? Says 0.0 which may cause issues

Posted on
Tue May 12, 2020 1:37 am
GlennNZ offline
User avatar
Posts: 1563
Joined: Dec 07, 2014
Location: Central Coast, Australia

Re: Tesla Battery Gateway Plugin

Found something
Try 0.4.5

Posted on
Tue May 12, 2020 1:40 am
petematheson offline
Posts: 847
Joined: Sep 14, 2014
Location: Southampton, UK

Re: Tesla Battery Gateway Plugin

Changed reserve to 1 and errored below:

Tesla Battery Debug Thread Send Login Basic called. Number of Active Threads:2
Tesla Battery Debug Calling https://192.168.0.161/api/login/Basic with payload:{'username': 'installer', 'force_sm_off': False, 'password': 'xxxxx', 'email': 'pete@xxxxxxx'}
Tesla Battery Debug {"email":"pete@xxxxxx","firstname":"Tesla","lastname":"Energy","roles":["Provider_Engineer"],"token":"R9YyxxxxxqXFXitdcWag==","provider":"Basic","loginTime":"2020-05-12T08:39:49.865609746+01:00"}
Tesla Battery Debug R9Yy4FVxxxxxxhqXFXitdcWag==
Tesla Battery Debug Change Operation called. Number of Active Threads:2
Tesla Battery Debug Reserve Percentage is :1.0 and prior 1
Tesla Battery Debug Calling https://192.168.0.161/api/operation with headers:{'Authorization': 'Bearer R9Yy4FVpFGe-ou_CAbw_xxxxxdcWag=='} and payload {'backup_reserve_percent': 1.0, 'mode': 'backup'}
Tesla Battery Error {"code":403,"error":"Unable to POST to resource","message":"User does not have adequate access rights"}
Tesla Battery Error change Operation failed. Unsure why. Check error message.
Tesla Battery Error Restarting Sitemaster
Tesla Battery Debug setConfigCompleted called. Number of Active Threads:2
Tesla Battery Debug Calling https://192.168.0.161/api/sitemaster/run with headers:{'Authorization': 'Bearer R9Yy4FVpFGe-ou_CAbwxxxxxxxxxFXitdcWag=='}
Tesla Battery Error {"code":403,"error":"Unable to GET to resource","message":"User does not have adequate access rights"}

Posted on
Tue May 12, 2020 1:44 am
GlennNZ offline
User avatar
Posts: 1563
Joined: Dec 07, 2014
Location: Central Coast, Australia

Re: Tesla Battery Gateway Plugin

try 0.4.6
Very much shot in dark - otherwise probably need to sort out own installer access to resolve.

But error has changed - from method not allowed, to authorisation now?

Posted on
Tue May 12, 2020 1:48 am
GlennNZ offline
User avatar
Posts: 1563
Joined: Dec 07, 2014
Location: Central Coast, Australia

Re: Tesla Battery Gateway Plugin

Skip 0.4.6

Feel more confident about 0.4.7 - give me 5

Posted on
Tue May 12, 2020 1:49 am
howartp offline
Posts: 4559
Joined: Jan 09, 2014
Location: West Yorkshire, UK

Re: Tesla Battery Gateway Plugin

Pete, don’t give Glenn your credentials - he might try summoning your Powerwall off the wall!

Oh wait, it’s only me does that with Tesla cars. :-(


Sent from my iPhone using Tapatalk Pro

Posted on
Tue May 12, 2020 1:51 am
GlennNZ offline
User avatar
Posts: 1563
Joined: Dec 07, 2014
Location: Central Coast, Australia

Re: Tesla Battery Gateway Plugin

howartp wrote:
Pete, don’t give Glenn your credentials - he might try summoning your Powerwall off the wall!
Oh wait, it’s only me does that with Tesla cars. :-(


Shipping would be a bit much!

Try 0.4.7- up there now - vaguely confident.

Also those error messages you are getting, is when login as installer (which have to be to change mode/settings) it turns off the battery/backup so called 'sitemaster'
With this off - the calls for info by the plugin fail as you are seeing.

Once mode changed, then need to restart sitemaster and get battery up and running again.
(added that a few versions ago - yet to be tested as haven't logged in yet)

A Blackout - at any stage during this would be just that a proper blackout - as battery is off, with no backup function.
No sure what would happen if in a actual grid-outage and you tried changing settings with the plugin - probably battery off, house dead/Indigo dead and no way of turning on again (although you can plug a 9V battery into the Gateway service ports to cold jump start -I have done that once!)

So you can see the risk of allowing mode changes via plugin/code?


Glenn
Last edited by GlennNZ on Tue May 12, 2020 1:56 am, edited 1 time in total.

Posted on
Tue May 12, 2020 1:52 am
howartp offline
Posts: 4559
Joined: Jan 09, 2014
Location: West Yorkshire, UK

Re: Tesla Battery Gateway Plugin

GlennNZ wrote:
vaguely confident.

Never claim that when releasing annoying bug fixes - it always backfires!


Sent from my iPhone using Tapatalk Pro

Posted on
Tue May 12, 2020 2:02 am
petematheson offline
Posts: 847
Joined: Sep 14, 2014
Location: Southampton, UK

Re: Tesla Battery Gateway Plugin

Didn't work, but also didn't kill the PW this time :)


Tesla Battery Debug ReturnCode:0
Tesla Battery Debug Text :<closed file '<fdopen>', mode 'rb' at 0x11097f5d0>
Tesla Battery Debug Error Running command. ?Powerwall offline
Tesla Battery Debug Calling https://192.168.0.161/api/login/Basic with payload:{'username': 'installer', 'force_sm_off': False, 'password': 'xxxxx', 'email': 'pete@xxxxx'}
Tesla Battery Debug {"email":"pete@xxxxx","firstname":"Tesla","lastname":"Energy","roles":["Provider_Engineer"],"token":"xMlRzxxxxoyQtYw==","provider":"Basic","loginTime":"2020-05-12T08:59:55.031570923+01:00"}
Tesla Battery Debug xMlxxxxxxx4UToyQtYw==
Tesla Battery Debug Change Operation called. Number of Active Threads:2
Tesla Battery Debug Reserve Percentage is :1.0 and prior 1
Tesla Battery Debug Calling https://192.168.0.161/api/operation with headers:{'Authorization': 'Bearer xMlRz68Cxxxxx4UToyQtYw=='} and payload {'backup_reserve_percent': 1.0, 'mode': 'backup'}
Tesla Battery Error {"code":500,"error":"invalid character 'b' looking for beginning of value","message":"Unable to set operational mode"}
Tesla Battery Error change Operation failed. Unsure why. Check error message.
Tesla Battery Error Restarting Sitemaster
Tesla Battery Debug setConfigCompleted called. Number of Active Threads:2
Tesla Battery Debug Calling https://192.168.0.161/api/sitemaster/run with headers:{'Authorization': 'Bearer xMlRz68CpxxxxxxxHEA38rU4UToyQtYw=='}
Tesla Battery Debug
Tesla Battery Error Error setconfigComplete Operation : ValueError('No JSON object could be decoded',)
Traceback (most recent call last):
File "plugin.py", line 621, in setsitemasterRun
jsonResponse = r.json()
File "/Library/Application Support/Perceptive Automation/Indigo 7.4/IndigoPluginHost.app/Contents/Resources/PlugIns/requests/models.py", line 816, in json
return complexjson.loads(self.text, **kwargs)
File "/Library/Application Support/Perceptive Automation/Indigo 7.4/IndigoPluginHost.app/Contents/Resources/PlugIns/simplejson/__init__.py", line 307, in loads
return _default_decoder.decode(s)
File "/Library/Application Support/Perceptive Automation/Indigo 7.4/IndigoPluginHost.app/Contents/Resources/PlugIns/simplejson/decoder.py", line 335, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/Library/Application Support/Perceptive Automation/Indigo 7.4/IndigoPluginHost.app/Contents/Resources/PlugIns/simplejson/decoder.py", line 353, in raw_decode
raise ValueError("No JSON object could be decoded")
ValueError: No JSON object could be decoded
Tesla Battery Debug Error setting OperationNo JSON object could be decoded
Tesla Battery Debug update Tesla Battery Called
Tesla Battery Debug ThreadSendCOmmand called. Number of Active Threads:2
Tesla Battery Debug sendcommand called
Tesla Battery Debug HTTPS CURL result:
Tesla Battery Debug ReturnCode:0
Tesla Battery Debug SUCCESS Text :{u'percentage': 0}
Tesla Battery Debug Json results:{u'percentage': 0}
Tesla Battery Debug sendcommand r.json result:{u'percentage': 0}

Posted on
Tue May 12, 2020 2:07 am
GlennNZ offline
User avatar
Posts: 1563
Joined: Dec 07, 2014
Location: Central Coast, Australia

Re: Tesla Battery Gateway Plugin

Ok

Powerwall - is still running because plugin did successfully restart it. So that bit works - just the operational mode change isn't

Try :0.4.8
FIxes some of those errors and trys something different for operationalmode.

Otherwise - try a few other types of modes and see how goes
Up reserve Battery to 20 etc. There may be lower limit and API setting does not equal App % setting completely.

Posted on
Tue May 12, 2020 2:10 am
petematheson offline
Posts: 847
Joined: Sep 14, 2014
Location: Southampton, UK

Re: Tesla Battery Gateway Plugin

Tesla Battery Error {"code":500,"error":"RealMode must be either backup, self_consumption, or autonomous","message":"Unable to set operational mode"}
Tesla Battery Error change Operation failed. Unsure why. Check error message.
Tesla Battery Error Restarting Sitemaster

Page 3 of 9 1, 2, 3, 4, 5, 6 ... 9

Who is online

Users browsing this forum: No registered users and 2 guests