Closed mattmeiser closed 1 year ago
Guess this integration isn't going to be supported.
Hi @mattmeiser , I have only one meter in my account, so I will need your assistance for being able to investigate/fix this issue. Have you tried to investigate the issue on your end? Please let me know if you are available for collaboration.
I've not really tried to investigate. I'd be willing to collaborate on the issue in a couple weeks--have some vacation coming up.
Hi @kdeyev I also have two meters in my account (culinary and secondary/irrigation) and would love to collaborate to get this integration working.
I'm happy to help however you'd like including working with you to login and parse the output from my account.
Hi @kdeyev, That's great. The integration is based on ugly parsing of EOW htmls:
async def fetch_meters(self, client: "Client"):
"""Returns a list of the meters associated with the account"""
path = DASHBOARD_ENDPOINT + urllib.parse.quote(self.username)
data = await client.request(path=path, method="get")
meters = []
lines = data.split("\n")
for line in lines:
if Meter.info_prefix in line:
meter_infos = extract_json(line, Meter.info_prefix)
for meter_info in meter_infos:
if METER_ID_FIELD not in meter_info:
raise EyeOnWaterAPIError(f"Cannot find {METER_ID_FIELD} field")
meter_id = meter_info[METER_ID_FIELD]
meter = Meter(meter_id=meter_id, meter_info=meter_info, metric_measurement_system=self.metric_measurement_system)
meters.append(meter)
return meters
Could you please run the test script and see what's wrong?
Hi @kdeyev , I'm not a developer at all, so hopefully I'm doing this right. I cloned the latest code from Git, updated my userID/password and ran test.py using PyCharm CE.
Here's the output:
/usr/bin/python3 /Users/mw/PycharmProjects/eyeonwater/custom_components/eyeonwater/test.py
2 meters found
meter 190240692 shows 354908.13
meter leaks: False
Traceback (most recent call last):
File "/Users/mw/PycharmProjects/eyeonwater/custom_components/eyeonwater/test.py", line 25, in
Process finished with exit code 1
@whitema Thank you. It seems that the first meter worked as expected and the problem with the second meter:
2 meters found
meter 190240692 shows 354908.13
I still have no idea how to fix it, since this integration is a result of reverse engineering. I'm going to be partly unavailable for the next month, but will do my best for fixing the issue with 2 meters. It would be super helpful if you could temporarily share access to your account. If you are ok with it - please reach me bt kn.deev at gmail.
Have a good one.
@kdeyev Happy to share it.
The fix is published in v0.0.2-beta.1
v0.0.2 has been released
New EOW account for 2 water meters. After installing the integration I get 2 leak detection entities and 2 water consumption entities but nothing has updated. After checking the logs I see:
Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 239, in _async_refresh self.data = await self._async_update_data() File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 195, in _async_update_data return await self.update_method() File "/config/custom_components/eyeonwater/__init__.py", line 50, in async_update_data await eye_on_water_data.read_meters() File "/config/custom_components/eyeonwater/__init__.py", line 102, in read_meters await meter.read_meter(self.client) File "/config/custom_components/eyeonwater/eow.py", line 102, in read_meter return self._parse_reading_data(data) File "/config/custom_components/eyeonwater/eow.py", line 120, in _parse_reading_data self.reading_data = meters_read[METER_READ_FIELD][meter_index][NEW_LATEST_READ_FIELD] IndexError: list index out of range