jesserizzo / envoy_reader

MIT License
37 stars 26 forks source link

Update envoy_reader.py for my envoy S #26

Closed cselle closed 3 years ago

cselle commented 4 years ago

Hi, Previous scripts don't work with my Envoy-S not Metered.

with old code 👍 Enter the Envoy IP address or host name, or press enter to use 'envoy' as default: 192.168.0.61 Enter the Username for Inverter data authentication, or press enter to use 'envoy' as default: Enter the Password for Inverter data authentication, or press enter to use the default password: Reading... Traceback (most recent call last): File "C:\Users\chris\Documents\new 1.py", line 450, in TESTREADER.run_in_console() File "C:\Users\chris\Documents\new 1.py", line 416, in run_in_console self.inverters_production())) File "C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python36_64\lib\asyncio\base_events.py", line 468, in run_until_complete return future.result() File "C:\Users\chris\Documents\new 1.py", line 223, in daily_consumption daily_consumption = raw_json["consumption"][0]["whToday"] TypeError: 'NoneType' object is not subscriptable

jesserizzo commented 4 years ago

@cselle I'm confused why was your Envoy being identified as having consumption data, and how will this PR fix that. Before the PR if the consumption data was not available, it have used the "http://{}/api/v1/production" endpoint and been classified as an endpoint type "P" and skipped the consumption values.

gtdiehl commented 3 years ago

@cselle Using the latest envoy_reader.py does it still fail on your Envoy-S?

gtdiehl commented 3 years ago

Closing PR haven't received a response. Can reopen if the issue is seen again.