I dont get anything in overview
I put this into configuration.yaml
sensor:
platform: enphase_envoy
ip_address: xx.xx.xx.xx
(I have Xed out the ip)
and get the following in the log
Log Details (ERROR)
Thu Sep 06 2018 06:58:19 GMT+1000 (AEST)
enphase_envoy: Error on device update!
Traceback (most recent call last):
File “/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity_platform.py”, line 251, in _async_add_entity
await entity.async_device_update(warning=False)
File “/usr/local/lib/python3.6/site-packages/homeassistant/helpers/entity.py”, line 353, in async_device_update
yield from self.hass.async_add_job(self.update)
File “/usr/local/lib/python3.6/concurrent/futures/thread.py”, line 56, in run
result = self.fn(*self.args, **self.kwargs)
File “/usr/local/lib/python3.6/site-packages/homeassistant/components/sensor/enphase_envoy.py”, line 87, in update
self._state = int(envoy_reader.production(self._ip_address))
ValueError: invalid literal for int() with base 10: '{“production”:[{“type”:“inverters”,“activeCount”:20,“readingTime”:1536180737,“wNow”:78,“whLifetime”:13200042}],“storage”:[{“type”:“acb”,“activeCount”:0,“readingTime”:0,“wNow”:0,“whNow”:0,“state”:"idl
First of all, it’s really hard to read the log file snippet. Could you please follow the advise on the top of the page and format your log as a code block?
Now, from what I can see, the JSON returned by your Envoy does not contain the expected production data. I don’t know why though.
The error logged also seems to indicate that the envoy_reader library and the HA sensor don’t work well together. In case of an error while fetching data from the Envoy, the library clearly returns a string with the error message, but the HA sensor still interprets the returned value as a number.
I just upgraded to 0.78.3 and it doesn’t read correctly the Enphase_envoy sensor.
It prints the following error message:
“Got a response, but it doesn’t look right. Check the IP address”
The IP address is ok.
From this thread:
I tried the http://envoy/api/v1/production query and the answer was:
{
“wattHoursToday”: 5259,
“wattHoursSevenDays”: 39453,
“wattHoursLifetime”: 4333252,
“wattsNow”: 156
}
It comes from a first generation Envoy (NOT Envoy-S or Envoy-S metered).
Possibly, the added variables pertaining to consumption brake the reader.
In Addition, trying to run the envoy_reader.py script (Ubuntu install) I get the following:
nikos@Ubuntu-18:~/homeassistant/lib/python3.6/site-packages/envoy_reader$ python3 envoy_reader.py
Enter the Envoy IP address, or press enter to search for it.192.168.0.254
Traceback (most recent call last):
File “envoy_reader.py”, line 161, in
print(“production {}”.format(EnvoyReader(host).production()))
File “envoy_reader.py”, line 22, in production
raw_json = EnvoyReader.call_api(self)
File “envoy_reader.py”, line 13, in call_api
if response.status_code == 200 and len(response.json()) == 3:
File “/home/nikos/.local/lib/python3.6/site-packages/requests/models.py”, line 896, in json
return complexjson.loads(self.text, **kwargs)
File “/usr/lib/python3/dist-packages/simplejson/init.py”, line 518, in loads
return _default_decoder.decode(s)
File “/usr/lib/python3/dist-packages/simplejson/decoder.py”, line 370, in decode
obj, end = self.raw_decode(s)
File “/usr/lib/python3/dist-packages/simplejson/decoder.py”, line 400, in raw_decode
return self.scan_once(s, idx=_w(s, idx).end())
simplejson.errors.JSONDecodeError: Expecting value: line 1 column 5 (char 4)
nikos@Ubuntu-18:~/homeassistant/lib/python3.6/site-packages/envoy_reader$
@Nikos_Michailidis
Or it could be the use of SimpleJSON. I’ve only tested it with the built in Python JSON. Have you set up your system to default to SimpleJSON? If so would it be easy for you to temporarily switch to the built in JSON and see if that fixes your problem?