@bwduncan @borpin @TrystanLea
I have made some small progress in obtaining PowerWall data.
If you substitute the following url in the EmonHubTeslaPowerWallInterfacer in emonhub.conf
url = http:// IP of PowerWall /api/meters/aggregates
… then a whole bunch of data becomes available.
The data is only available as part of an error log but at least it’s data in the Emon eco system.
To get the following log data, I commented out lines 54, 55 & 56 in EmonHubTeslaPowerWallInterfacer.py that Check if battery percentage key is in data object … which it isn’t in this url call.
Here’s the relevant bit of the log – pls ignore refs to watchman.
2020-07-08 18:43:35,756 INFO MainThread EmonHub emonHub emon-pi variant v3-beta
2020-07-08 18:43:35,756 INFO MainThread Opening hub...
2020-07-08 18:43:35,757 INFO MainThread Logging level set to DEBUG
2020-07-08 18:43:35,757 INFO MainThread Creating EmonHubMqttInterfacer 'MQTT'
2020-07-08 18:43:35,759 DEBUG MainThread Setting MQTT pubchannels: ['ToRFM12']
2020-07-08 18:43:35,760 DEBUG MainThread Setting MQTT subchannels: ['ToEmonCMS']
2020-07-08 18:43:35,760 INFO MainThread Setting MQTT node_format_enable: 0
2020-07-08 18:43:35,760 INFO MainThread Setting MQTT nodevar_format_enable: 1
2020-07-08 18:43:35,761 INFO MainThread Setting MQTT nodevar_format_basetopic: emon/
2020-07-08 18:43:35,762 INFO MainThread Creating EmonHubTeslaPowerWallInterfacer 'PowerWall'
2020-07-08 18:43:35,762 INFO MainThread Setting PowerWall name: powerwall
2020-07-08 18:43:35,763 INFO MainThread Setting PowerWall url: False
2020-07-08 18:43:35,763 INFO MainThread Setting PowerWall readinterval: 10
2020-07-08 18:43:35,763 DEBUG MainThread Setting PowerWall pubchannels: ['ToEmonCMS']
2020-07-08 18:43:35,764 INFO MainThread Creating EmonHubEmoncmsHTTPInterfacer 'To_watchman'
2020-07-08 18:43:35,765 DEBUG MainThread Setting To_watchman pubchannels: ['ToRFM12']
2020-07-08 18:43:35,766 DEBUG MainThread Setting To_watchman subchannels: ['ToEmonCMS']
2020-07-08 18:43:35,766 INFO MainThread Setting To_watchman apikey: set
2020-07-08 18:43:35,766 INFO MainThread Setting To_watchman url: http://192.168.1.10/emoncms
2020-07-08 18:43:35,766 INFO MainThread Setting To_watchman senddata: 1
2020-07-08 18:43:35,767 INFO MainThread Setting To_watchman sendstatus: 0
2020-07-08 19:26:31,478 INFO MainThread Setting PowerWall url: http://192.168.1.100/api/meters/aggregates
2020-07-08 19:26:31,479 INFO MainThread Setting PowerWall readinterval: 10
2020-07-08 19:26:38,126 INFO MainThread EmonHub emonHub emon-pi variant v3-beta
2020-07-08 19:26:38,127 INFO MainThread Opening hub...
2020-07-08 19:26:38,127 INFO MainThread Logging level set to DEBUG
2020-07-08 19:26:38,128 INFO MainThread Creating EmonHubMqttInterfacer 'MQTT'
2020-07-08 19:26:38,130 DEBUG MainThread Setting MQTT pubchannels: ['ToRFM12']
2020-07-08 19:26:38,131 DEBUG MainThread Setting MQTT subchannels: ['ToEmonCMS']
2020-07-08 19:26:38,131 INFO MainThread Setting MQTT node_format_enable: 0
2020-07-08 19:26:38,131 INFO MainThread Setting MQTT nodevar_format_enable: 1
2020-07-08 19:26:38,131 INFO MainThread Setting MQTT nodevar_format_basetopic: emon/
2020-07-08 19:26:38,132 INFO MainThread Creating EmonHubTeslaPowerWallInterfacer 'PowerWall'
2020-07-08 19:26:38,133 INFO MainThread Setting PowerWall name: powerwall
2020-07-08 19:26:38,133 INFO MainThread Setting PowerWall url: http://192.168.1.100/api/meters/aggregates
2020-07-08 19:26:38,134 INFO MainThread Setting PowerWall readinterval: 10
2020-07-08 19:26:38,134 DEBUG MainThread Setting PowerWall pubchannels: ['ToEmonCMS']
2020-07-08 19:26:38,136 INFO MainThread Creating EmonHubEmoncmsHTTPInterfacer 'To_watchman'
2020-07-08 19:26:38,137 DEBUG MainThread Setting To_watchman pubchannels: ['ToRFM12']
2020-07-08 19:26:38,138 DEBUG MainThread Setting To_watchman subchannels: ['ToEmonCMS']
2020-07-08 19:26:38,138 INFO MainThread Setting To_watchman apikey: set
2020-07-08 19:26:38,139 INFO MainThread Setting To_watchman url: http://192.168.1.10/emoncms
2020-07-08 19:26:38,139 INFO MainThread Setting To_watchman senddata: 1
2020-07-08 19:26:38,139 INFO MainThread Setting To_watchman sendstatus: 0
2020-07-08 19:26:38,278 DEBUG PowerWall PowerWall Request response: {"site":{"last_communication_time":"2020-07-08T19:26:38.190213726+01:00","instant_power":260.3262634277344,"instant_reactive_power":-142.2243995666504,"instant_apparent_power":296.64379862444514,"frequency":50.049781799316406,"energy_exported":151417.04500000057,"energy_imported":241906.8625000005,"instant_average_voltage":193.68669086797593,"instant_total_current":0,"i_a_current":0,"i_b_current":0,"i_c_current":0,"timeout":1500000000},"battery":{"last_communication_time":"2020-07-08T19:26:38.188451066+01:00","instant_power":-110,"instant_reactive_power":30,"instant_apparent_power":114.0175425099138,"frequency":50.067,"energy_exported":37100,"energy_imported":41530,"instant_average_voltage":246.43333333333337,"instant_total_current":0.30000000000000004,"i_a_current":0,"i_b_current":0,"i_c_current":0,"timeout":1500000000},"load":{"last_communication_time":"2020-07-08T19:26:38.188451066+01:00","instant_power":361.4218817850619,"instant_reactive_power":-119.27322196880134,"instant_apparent_power":380.5941120299606,"frequency":50.049781799316406,"energy_exported":0,"energy_imported":86059.81749999995,"instant_average_voltage":193.68669086797593,"instant_total_current":1.8660129932800624,"i_a_current":0,"i_b_current":0,"i_c_current":0,"timeout":1500000000},"solar":{"last_communication_time":"2020-07-08T19:26:38.190978437+01:00","instant_power":0,"instant_reactive_power":0,"instant_apparent_power":0,"frequency":0,"energy_exported":0,"energy_imported":0,"instant_average_voltage":0,"instant_total_current":0,"i_a_current":0,"i_b_current":0,"i_c_current":0,"timeout":1500000000}}
2020-07-08 19:26:38,281 WARNING PowerWall Exception caught in PowerWall thread. Traceback (most recent call last):
File "/opt/openenergymonitor/emonhub/src/emonhub_interfacer.py", line 32, in wrapper
return f(*args)
File "/opt/openenergymonitor/emonhub/src/emonhub_interfacer.py", line 99, in run
rxc = self.read()
File "/opt/openenergymonitor/emonhub/src/interfacers/EmonHubTeslaPowerWallInterfacer.py", line 62, in read
c.realdata = [data['percentage']]
KeyError: 'percentage'
Errors are reported in lines 32 & 99 in emonhub_interfacer.py and line 62 in EmonHubTeslaPowerWallInterfacer.py.
It’s way beyond my skill level to fix those errors so any help would be most welcome.
For me and most other PowerWall users I suspect, the key info is in the “battery” section namely – instant_power, energy_exported & energy_imported.
The percentage level of charge is also important. That requires a call to url = http:// IP of PowerWall /api/system_status/soe … per the current working EmonHubTeslaPowerWallInterfacer.
This begs the question – is it possible to have two url calls within one Interfacer?
TIA for any help/suggestions