changeset 4:8990981c60a0

Catch up with tesla_powerwall API changes.
author Daniel O'Connor <darius@dons.net.au>
date Mon, 04 Jul 2022 12:09:29 +0930
parents ec3c8b63d8e7
children c02b765b4eb3
files pw2.ini pw2log.py
diffstat 2 files changed, 7 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/pw2.ini	Tue Feb 09 22:10:25 2021 +1030
+++ b/pw2.ini	Mon Jul 04 12:09:29 2022 +0930
@@ -7,5 +7,8 @@
 logtime=30
 
 [pw]
-ip=10.0.2.64
+#ip=10.0.2.64
+ip=1118431-01-H--TG1180640005H1
+username=darius@dons.net.au
+password=Fnordish
 
--- a/pw2log.py	Tue Feb 09 22:10:25 2021 +1030
+++ b/pw2log.py	Mon Jul 04 12:09:29 2022 +0930
@@ -111,17 +111,16 @@
             if not pw:
                 first = True
                 pw = Powerwall(pwip)
-                pw.login(username, password)
-                pw.detect_and_pin_version()
+                pw.login(password, username)
             meters = pw.get_meters()
-            grid_volts = meters.site.avarage_voltage
+            grid_volts = meters.site.average_voltage
             grid_freq = meters.site.frequency
             grid_power = meters.site.instant_power
             load_power = meters.load.instant_power
             battery_power = meters.battery.instant_power
             solar_power = meters.solar.instant_power
             charge = pw.get_charge()
-        except APIError as e:
+        except Exception as e:
             pw = None
             logger.error('Error communicating with Powerwall: ' + str(e))
             time.sleep(300)