Giter Site home page Giter Site logo

eyeonwater's People

Contributors

disforw avatar kdeyev avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

eyeonwater's Issues

Unsupported Units CF

I'm in the US (Washington state to be exact) and it look like CF (cubic feet) is not a supported unit. Complete error message included below. The website and my phone app report volume in gallons, but it looks like the meters are natively reporting CF. This is with the most recent code base.

Logger: homeassistant
Source: custom_components/eyeonwater/eow.py:155
Integration: EyeOnWater ([documentation](https://github.com/kdeyev/eyeonwater))
First occurred: 9:42:02 PM (2 occurrences)
Last logged: 9:44:47 PM
Error doing job: Task exception was never retrieved

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 182, in async_refresh
    await self._async_refresh(log_failures=True)
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 283, in _async_refresh
    self.async_update_listeners()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 110, in async_update_listeners
    update_callback()
  File "/config/custom_components/eyeonwater/sensor.py", line 85, in _state_update
    self._state = self.meter.reading
  File "/config/custom_components/eyeonwater/eow.py", line 155, in reading
    raise EyeOnWaterAPIError(f"Unsupported measurement unit: {read_unit}")
custom_components.eyeonwater.eow.EyeOnWaterAPIError: Unsupported measurement unit: CF

Error setting up entry

Howdy-

Since updating to HA Core 2023.5.0, this component is no longer loading. The integration fails with this error:

Error setting up entry [email protected] for eyeonwater

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/config_entries.py", line 387, in async_setup
    result = await component.async_setup_entry(hass, self)
  File "/config/custom_components/eyeonwater/__init__.py", line 72, in async_setup_entry
    hass.config_entries.async_setup_platforms(entry, PLATFORMS)
AttributeError: 'ConfigEntries' object has no attribute 'async_setup_platforms'

Additional logs:

2023-05-04 10:24:00.375 WARNING (SyncWorker_1) [homeassistant.loader] We found a custom integration eyeonwater which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2023-05-04 10:24:25.125 INFO (MainThread) [homeassistant.bootstrap] Setting up stage 2: {'influxdb', 'input_select', 'met', 'automation', 'config', 'person', 'homeassistant_hardware', 'stream', 'sharkiq', 'sun', 'script', 'input_button', 'zwave_js', 'timer', 'trace', 'brother', 'sensor', 'homekit_controller', 'conversation', 'system_health', 'scene', 'nws', 'auto_backup', 'alarmo', 'radio_browser', 'stt', 'esphome', 'input_datetime', 'diagnostics', 'myq', 'cast', 'schedule', 'accuweather', 'eyeonwater', 'counter', 'energy', 'history', 'ffmpeg', 'device_automation', 'co2signal', 'tplink', 'search', 'media_source', 'homeassistant_alerts', 'input_text', 'mqtt', 'zha', 'hacs', 'fontawesome', 'opensprinkler', 'auth', 'file_upload', 'persistent_notification', 'map', 'zone', 'tts', 'waze_travel_time', 'adaptive_lighting', 'analytics', 'assist_pipeline', 'logbook', 'tasmota', 'homekit', 'unifi', 'input_number', 'smart_meter_texas', 'image_upload', 'blueprint', 'roku', 'tag', 'application_credentials', 'mobile_app', 'lovelace', 'default_config', 'input_boolean', 'ibeacon', 'hardware', 'homeassistant_yellow', 'repairs', 'my', 'bluetooth_adapters', 'onboarding', 'panel_custom', 'notify'}
2023-05-04 10:24:25.245 INFO (MainThread) [homeassistant.setup] Setting up eyeonwater
2023-05-04 10:24:25.246 INFO (MainThread) [homeassistant.setup] Setup of domain eyeonwater took 0.0 seconds
2023-05-04 10:24:30.823 ERROR (MainThread) [homeassistant.config_entries] Error setting up entry [email protected] for eyeonwater
File "/config/custom_components/eyeonwater/__init__.py", line 72, in async_setup_entry

2.0.4 - Unexpected EOW response 10 validation errors for MeterInfo register_0

Error

This error originated from a custom integration.

Logger: custom_components.eyeonwater
Source: custom_components/eyeonwater/init.py:52
Integration: EyeOnWater (documentation)
First occurred: 6:25:34 PM (1 occurrences)
Last logged: 6:25:34 PM

Reading meters failed: Unexpected EOW response 10 validation errors for MeterInfo register_0 -> low_read_limit none is not an allowed value (type=type_error.none.not_allowed) register_0 -> high_read_limit none is not an allowed value (type=type_error.none.not_allowed) register_0 -> flow -> last_year_last_month_ratio field required (type=value_error.missing) register_0 -> flow -> last_year_last_month field required (type=value_error.missing) register_0 -> flow -> last_year_this_month_ratio field required (type=value_error.missing) register_0 -> flow -> last_year_this_month field required (type=value_error.missing) meter -> flow -> last_year_last_month_ratio field required (type=value_error.missing) meter -> flow -> last_year_last_month field required (type=value_error.missing) meter -> flow -> last_year_this_month_ratio field required (type=value_error.missing) meter -> flow -> last_year_this_month field required (type=value_error.missing)

KeyError: recorder_instance [SOLVED]

Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 388, in async_setup
result = await component.async_setup_entry(hass, self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/eyeonwater/init.py", line 48, in async_setup_entry
await eye_on_water_data.import_historical_data(days_to_load=30)
File "/config/custom_components/eyeonwater/coordinator.py", line 80, in import_historical_data
async_import_statistics(self.hass, metadata, statistics)
File "/usr/src/homeassistant/homeassistant/components/recorder/statistics.py", line 2146, in async_import_statistics
_async_import_statistics(hass, metadata, statistics)
File "/usr/src/homeassistant/homeassistant/components/recorder/statistics.py", line 2126, in _async_import_statistics
get_instance(hass).async_import_statistics(metadata, statistics, Statistics)
^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/recorder/util.py", line 744, in get_instance
instance: Recorder = hass.data[DATA_INSTANCE]
~~~~~~~~~^^^^^^^^^^^^^^^
KeyError: 'recorder_instance'

Issue on Integration Setup

Logger: homeassistant.config_entries
Source: config_entries.py:406
First occurred: 8:52:55 AM (2 occurrences)
Last logged: 8:54:23 AM

Error setting up entry ---REDACTED--- for eyeonwater
Traceback (most recent call last):
  File "/config/lsiopy/lib/python3.11/site-packages/pyonwater/meter_reader.py", line 115, in read_historical_data_one_day
    data = HistoricalData.parse_raw(raw_data)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "pydantic/main.py", line 549, in pydantic.main.BaseModel.parse_raw
  File "pydantic/main.py", line 526, in pydantic.main.BaseModel.parse_obj
  File "pydantic/main.py", line 341, in pydantic.main.BaseModel.__init__
pydantic.error_wrappers.ValidationError: 2 validation errors for HistoricalData
timeseries -> 4928193028058372026,0 -> series -> 9 -> display_unit
  field required (type=value_error.missing)
timeseries -> 4928193028058372026,0 -> series -> 9 -> bill_read
  field required (type=value_error.missing)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/config/custom_components/eyeonwater/coordinator.py", line 43, in read_meters
    await meter.read_historical_data(
  File "/config/lsiopy/lib/python3.11/site-packages/pyonwater/meter.py", line 64, in read_historical_data
    historical_data = await self._reader.read_historical_data(
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/lsiopy/lib/python3.11/site-packages/pyonwater/meter_reader.py", line 79, in read_historical_data
    statistics += await self.read_historical_data_one_day(
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/lsiopy/lib/python3.11/site-packages/pyonwater/meter_reader.py", line 118, in read_historical_data_one_day
    raise EyeOnWaterAPIError(msg) from e
pyonwater.exceptions.EyeOnWaterAPIError: Unexpected EOW response 2 validation errors for HistoricalData
timeseries -> 4928193028058372026,0 -> series -> 9 -> display_unit
  field required (type=value_error.missing)
timeseries -> 4928193028058372026,0 -> series -> 9 -> bill_read
  field required (type=value_error.missing)

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/lsiopy/lib/python3.11/site-packages/homeassistant/config_entries.py", line 406, in async_setup
    result = await component.async_setup_entry(hass, self)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/eyeonwater/__init__.py", line 52, in async_setup_entry
    await eye_on_water_data.read_meters(days_to_load=30)
  File "/config/custom_components/eyeonwater/coordinator.py", line 48, in read_meters
    raise UpdateFailed(error) from error
homeassistant.helpers.update_coordinator.UpdateFailed: Unexpected EOW response 2 validation errors for HistoricalData
timeseries -> 4928193028058372026,0 -> series -> 9 -> display_unit
  field required (type=value_error.missing)
timeseries -> 4928193028058372026,0 -> series -> 9 -> bill_read
  field required (type=value_error.missing)

Rogue negative value in energy dashboard

Newest integration seems to be working well. Thanx for all the work on this!!!

One issue still present. While the history of the entity looks to be fine, the most current reading in the energy dashboard is a huge negative value. As updates come in from water meter, this value moves to be the most current.

I have no errors in the logs, and I am unable to locate any rogue data points that would cause this.

If I go to previous day(s) everything is populated correctly.

Any suggestions where to look?

IMG_0502
IMG_0501

list index out of range

I've had this integration running fine for quite some time now. I noticed today that I haven't gotten a read since jan 21st. All of the entities are showing unavailable. This is the error in my logs.

Unexpected error fetching EyeOnWater data: list index out of range

Traceback (most recent call last):
  File "/home/homeassistant/.pyenv/versions/3.11.6/lib/python3.11/site-packages/homeassistant/helpers/update_coordinator.py", line 300, in _async_refresh
    self.data = await self._async_update_data()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/homeassistant/.pyenv/versions/3.11.6/lib/python3.11/site-packages/homeassistant/helpers/update_coordinator.py", line 256, in _async_update_data
    return await self.update_method()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/mnt/dietpi_userdata/homeassistant/custom_components/eyeonwater/__init__.py", line 59, in async_update_data
    await eye_on_water_data.read_meters(days_to_load=3)
  File "/mnt/dietpi_userdata/homeassistant/custom_components/eyeonwater/coordinator.py", line 43, in read_meters
    await meter.read_historical_data(
  File "/mnt/dietpi_userdata/homeassistant/deps/lib/python3.11/site-packages/pyonwater/meter.py", line 78, in read_historical_data
    elif historical_data[-1].reading == self.last_historical_data[
         ~~~~~~~~~~~~~~~^^^^
IndexError: list index out of range

Restarted the integration and got the same error. I logged into eyeonwater.com to check the site was up and my credentials were still good which they were. Tried removing and reinstalling the integration but still getting the same error.

Error Setting up binary_sensor.eyeonwater

2023-08-02 16:50:48.295 INFO (MainThread) [homeassistant.components.binary_sensor] Setting up binary_sensor.eyeonwater
2023-08-02 16:50:48.296 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up eyeonwater platform for sensor
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 362, in _async_setup_platform
    await asyncio.shield(task)
    sensors.append(EyeOnWaterSensor(meter, coordinator))
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/eyeonwater/sensor.py", line 50, in __init__
    sensors.append(EyeOnWaterBinarySensor(meter, coordinator, description))
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

This is using the latest release

EyeOnWater data: list index out of range

I see many instances of next error in my log from integration:

Logger: custom_components.eyeonwater
Source: helpers/update_coordinator.py:313
Integration: EyeOnWater ([documentation](https://github.com/kdeyev/eyeonwater))
First occurred: 3:19:06 PM (21 occurrences)
Last logged: 8:19:27 PM

Unexpected error fetching EyeOnWater data: list index out of range
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 313, in _async_refresh
    self.data = await self._async_update_data()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 269, in _async_update_data
    return await self.update_method()
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/eyeonwater/__init__.py", line 59, in async_update_data
    await eye_on_water_data.read_meters(days_to_load=3)
  File "/config/custom_components/eyeonwater/coordinator.py", line 43, in read_meters
    await meter.read_historical_data(
  File "/usr/local/lib/python3.12/site-packages/pyonwater/meter.py", line 78, in read_historical_data
    elif historical_data[-1].reading == self.last_historical_data[
         ~~~~~~~~~~~~~~~^^^^
IndexError: list index out of range

I don't see any usage data yet, but in my case meter have not reported data to the site for about a month. It just started reporting data again - but still no data in ha.

Eye On Water Entities Not Supported in New Core 2022.11.x Energy Dashboard

It looks like the water meter entity created by Eye On Water is not supported by the Energy dashboard in Home Assistant Core 2022.11.0 (or 2022.11.1). See screenshots attached below. The Home Assistant help topic on this says to refer developers to

https://developers.home-assistant.io/docs/core/entity/sensor#long-term-statistics

for details on how to made their integrations compatible with the new water meter tracking in the Energy dashboard.

No matching statistics found
Water meter entities

do not appear to be receiving water data

After update via hacs, I removed the integration from home assistant, rebooted, and reinstalled integration.

I noticed an additional line in the config…
.com
Username
Password

I changed the .com to .ca in the initial setup assuming that is what was required to use the alternate site.

This change in the initial config did not connect to the .ca site. I still had to modify the eow.py …It looks like Eyeonwater.com is still the default.

I updated that to .ca, and integration appears to be working with that one change.

so, integration creates the appropriate sensors, appears to connect to the correct site (after I changed how.py), allows me to add to energy dashboard, however, I do NOT appear to be getting any data into the water sensor after over 12 hours.

logs appear to show it is connecting every 5 mins.

2022-11-13 09:11:07.000 DEBUG (MainThread) [custom_components.eyeonwater] Fetching latest data
2022-11-13 09:11:07.001 DEBUG (MainThread) [custom_components.eyeonwater.eow] Requesting meter reading
2022-11-13 09:11:09.701 DEBUG (MainThread) [custom_components.eyeonwater] Finished fetching Eye On Water data in 2.700 seconds (success: True)
...

2022-11-13 09:16:09.002 DEBUG (MainThread) [custom_components.eyeonwater] Fetching latest data
2022-11-13 09:16:09.003 DEBUG (MainThread) [custom_components.eyeonwater.eow] Requesting meter reading
2022-11-13 09:16:11.619 DEBUG (MainThread) [custom_components.eyeonwater] Finished fetching Eye On Water data in 2.617 seconds (success: True)

Hosting eow.py in pypi

As per the Development Checklist, all logic related to communication with external devices or services must be contained within a separate Python library, which must be hosted on pypi.
@kdeyev do you want to create this library?

Logging error when debug logs are enabled

I enabled debug logs on my install as the meter is showing up unavailable and noticed the following error in the logs

2024-01-29 07:04:08.237 DEBUG (MainThread) [custom_components.eyeonwater] Finished fetching EyeOnWater data in 2.719 seconds (success: True)
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/logging/__init__.py", line 1110, in emit
    msg = self.format(record)
          ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/logging/__init__.py", line 953, in format
    return fmt.format(record)
           ^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/logging/__init__.py", line 687, in format
    record.message = record.getMessage()
                     ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/logging/__init__.py", line 377, in getMessage
    msg = msg % self.args
          ~~~~^~~~~~~~~~~
TypeError: %d format: a real number is required, not datetime.datetime
Call stack:
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/usr/src/homeassistant/homeassistant/__main__.py", line 221, in <module>
    sys.exit(main())
  File "/usr/src/homeassistant/homeassistant/__main__.py", line 209, in main
    exit_code = runner.run(runtime_conf)
  File "/usr/src/homeassistant/homeassistant/runner.py", line 188, in run
    return loop.run_until_complete(setup_and_run_hass(runtime_config))
  File "/usr/local/lib/python3.11/asyncio/base_events.py", line 640, in run_until_complete
    self.run_forever()
  File "/usr/local/lib/python3.11/asyncio/base_events.py", line 607, in run_forever
    self._run_once()
  File "/usr/local/lib/python3.11/asyncio/base_events.py", line 1925, in _run_once
    handle._run()
  File "/usr/local/lib/python3.11/asyncio/events.py", line 80, in _run
    self._context.run(self._callback, *self._args)
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 243, in _handle_refresh_interval
    await self._async_refresh(log_failures=True, scheduled=True)
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 399, in _async_refresh
    self.async_update_listeners()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 182, in async_update_listeners
    update_callback()
  File "/config/custom_components/eyeonwater/sensor.py", line 127, in _state_update
    self._last_historical_data = filter_newer_data(
  File "/config/custom_components/eyeonwater/statistic_helper.py", line 115, in filter_newer_data

2024-01-29 07:04:08.237 DEBUG (MainThread) [custom_components.eyeonwater] Finished fetching EyeOnWater data in 2.719 seconds (success: True)
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/logging/__init__.py", line 1110, in emit
    msg = self.format(record)
          ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/logging/__init__.py", line 953, in format
    return fmt.format(record)
           ^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/logging/__init__.py", line 687, in format
    record.message = record.getMessage()
                     ^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/logging/__init__.py", line 377, in getMessage
    msg = msg % self.args
          ~~~~^~~~~~~~~~~
TypeError: %d format: a real number is required, not datetime.datetime
Call stack:
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/usr/src/homeassistant/homeassistant/__main__.py", line 221, in <module>
    sys.exit(main())
  File "/usr/src/homeassistant/homeassistant/__main__.py", line 209, in main
    exit_code = runner.run(runtime_conf)
  File "/usr/src/homeassistant/homeassistant/runner.py", line 188, in run
    return loop.run_until_complete(setup_and_run_hass(runtime_config))
  File "/usr/local/lib/python3.11/asyncio/base_events.py", line 640, in run_until_complete
    self.run_forever()
  File "/usr/local/lib/python3.11/asyncio/base_events.py", line 607, in run_forever
    self._run_once()
  File "/usr/local/lib/python3.11/asyncio/base_events.py", line 1925, in _run_once
    handle._run()
  File "/usr/local/lib/python3.11/asyncio/events.py", line 80, in _run
    self._context.run(self._callback, *self._args)
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 243, in _handle_refresh_interval
    await self._async_refresh(log_failures=True, scheduled=True)
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 399, in _async_refresh
    self.async_update_listeners()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 182, in async_update_listeners
    update_callback()
  File "/config/custom_components/eyeonwater/sensor.py", line 127, in _state_update
    self._last_historical_data = filter_newer_data(
  File "/config/custom_components/eyeonwater/statistic_helper.py", line 115, in filter_newer_data

  File "/config/custom_components/eyeonwater/statistic_helper.py", line 115, in filter_newer_data
    _LOGGER.debug(
  File "/usr/local/lib/python3.11/logging/__init__.py", line 1477, in debug
    self._log(DEBUG, msg, args, **kwargs)
  File "/usr/local/lib/python3.11/logging/__init__.py", line 1634, in _log
    self.handle(record)
  File "/usr/local/lib/python3.11/logging/__init__.py", line 1644, in handle
    self.callHandlers(record)
  File "/usr/local/lib/python3.11/logging/__init__.py", line 1706, in callHandlers
    hdlr.handle(record)
  File "/usr/src/homeassistant/homeassistant/util/logging.py", line 48, in handle
    self.emit(record)
Message: 'last_imported_time %d - data %d'
Arguments: (datetime.datetime(2024, 1, 27, 23, 0, tzinfo=zoneinfo.ZoneInfo(key='America/Chicago')), datetime.datetime(2024, 1, 28, 23, 0, tzinfo=<Ds
tTzInfo 'US/Central' CST-1 day, 18:00:00 STD>))

Version 1.1 errors after a reboot

I noticed after updating to 1.1 that Everytime I reboot my system eyeonwater will not launch. If I hit restart addon it will then successfully launch. Here is the error I get in the log.

Error while setting up eyeonwater platform for sensor
Traceback (most recent call last):
File "/home/homeassistant/.pyenv/versions/3.11.4/lib/python3.11/site-packages/homeassistant/helpers/entity_platform.py", line 362, in _async_setup_platform
await asyncio.shield(task)
File "/mnt/dietpi_userdata/homeassistant/custom_components/eyeonwater/sensor.py", line 29, in async_setup_entry
sensors.append(EyeOnWaterSensor(meter, coordinator))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/mnt/dietpi_userdata/homeassistant/custom_components/eyeonwater/sensor.py", line 51, in init
name=f"Water Meter {meter.meter_info['meter_id']}",
~~~~~~~~~~~~~~~~^^^^^^^^^^^^
KeyError: 'meter_id'

Unsupported measurement unit: cm

Since the last few updates, it does not work here. It seems it don't recognise the metric values and if I move it outside the metric value loop, it recognise it as GAL instead of CM.

Logger: homeassistant
Source: custom_components/eyeonwater/eow.py:155
Integration: EyeOnWater (documentation)
First occurred: 06.44.14 (108 occurrences)
Last logged: 15.39.18

Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 182, in async_refresh
await self._async_refresh(log_failures=True)
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 283, in _async_refresh
self.async_update_listeners()
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 110, in async_update_listeners
update_callback()
File "/config/custom_components/eyeonwater/sensor.py", line 85, in _state_update
self._state = self.meter.reading
File "/config/custom_components/eyeonwater/eow.py", line 155, in reading
raise EyeOnWaterAPIError(f"Unsupported measurement unit: {read_unit}")
custom_components.eyeonwater.eow.EyeOnWaterAPIError: Unsupported measurement unit: CM

Permission error

I suddenly can’t create releases or tags…
Error: You're not authorized to create a tag

Adding eow to Utility

Thanks for adding the .ca support. I had already hacked your code to get this to work but luckily can now go back to the original repository.
I created a utility water meter (from helper) - this is working fine (billing every 2 months). I want to add my water meter to the utility dashboard. In the add water source in the energy tab, nothing shows in the "Water usage (m3 or gl) pulldown - not sure if this is a unit issue as the EOW reports water for me as CM not m3? Seems m3 is the more popular metric unit for reporting volume in HA.

Drop down points to this page: https://www.home-assistant.io/more-info/statistics/

Also wondering if its difficult to add another entity for daily consumption for last 24 hours (ie from last reading).
Also for setup, there are no descriptions of the 3 input fields (domain, user, password) - I guessed correctly but may not be obvious for other users.

Great addin. I was using the web scraper but this approach was considerably more difficult.

2.3.0 data value incorrect for metric

Version 2.2.0 appears to work properly - showing the correct number of litres used.

version 2.3.0 appears to scale value down by a factor of 100.

Ie 1200L in 2.2.0 appears as 1.2L in 2.3.0.

I’m guessing it has something to do with units…

cubic meter vs cm

Mind if I jump onboard?

Hey @kdeyev,

I just got notice from my utility company that they are swapping out my meter next week and will offer EyesOnWater as a new feature. So of course I came running to Github in search of a repo! This is awesome work, mind if I submit some PRs?

  • move leak sensor to binary_sensor
  • Move coordinator to coordinator.py
  • submit icon/logo to ha-brands
  • Separate out eow.py to a dependency repo
  • Help with cleanup for core submission (unless you’d rather just go HACS-default)

Support for HomeAssistant v2023.3

2023-02-24 18:46:14.051 WARNING (MainThread) [homeassistant.helpers.frame] Detected integration that called async_setup_platforms instead of awaiting async_forward_entry_setups; this will fail in version 2023.3. Please report issue to the custom integration author for eyeonwater using this method at custom_components/eyeonwater/__init__.py, line 72: hass.config_entries.async_setup_platforms(entry, PLATFORMS)

Index Out of Range

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

Units issue: cf

Hi,

I’m running hassio 10.1 and seeing this units issue I wanted to report:

Entity sensor.water_meter_xxxxxx_water_meter_xxxxxx_statistic (<class 'custom_components.eyeonwater.sensor.EyeOnWaterStatistic'>) is using native unit of measurement 'cf' which is not a valid unit for the device class ('water') it is using; expected one of ['ft³', 'L', 'm³', 'CCF', 'gal']; Please update your configuration if your entity is manually configured, otherwise report it to the custom integration author
did the hassio units chance with the latest release?

Cubic_meter missing unit of measure

Logger: homeassistant
Source: custom_components/eyeonwater/eow.py:127
Integration: EyeOnWater (documentation)
First occurred: July 13, 2023 at 8:10:55 PM (543 occurrences)
Last logged: 5:22:40 PM

Error doing job: Task exception was never retrieved
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 262, in async_refresh
await self._async_refresh(log_failures=True)
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 374, in _async_refresh
self.async_update_listeners()
File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 164, in async_update_listeners
update_callback()
File "/config/custom_components/eyeonwater/sensor.py", line 85, in _state_update
self._state = self.meter.reading
^^^^^^^^^^^^^^^^^^
File "/config/custom_components/eyeonwater/eow.py", line 127, in reading
raise EyeOnWaterAPIError(f"Unsupported measurement unit: {read_unit}")
custom_components.eyeonwater.eow.EyeOnWaterAPIError: Unsupported measurement unit: CUBIC_METER

DeviceInfo Import error

Unable to prepare setup for platform eyeonwater.sensor: Platform not found (cannot import name 'DeviceInfo' from 'homeassistant.helpers.device_registry' (/usr/src/homeassistant/homeassistant/helpers/device_registry.py)).

Getting a strange error when importing DeviceInfo from its proper place as described in the CLI.

Temporary Solution
I am reverting back to importing it from another library until this issue is resolved or further understood.

Old: from homeassistant.helpers.entity import DeviceInfo
Proper: from homeassistant.helpers.device_registry import DeviceInfo

EyeOnWater custom compoent is empty

I've installed this repository as a custom component in HACS but aside from some of the default repository info, the integration is empty:

image

image

I've tried adding logging the init.py and eow.py files to see if there's an error being lost, but as far as I can tell, those files don't ever seem to get loaded. Am I missing something in getting HACS to load the repository properly? (or has something changed in HACS that the repo needs to be updated to handle?)

multiple database issues

As well as the other issues recently reported, also noticing these 3 database issues which I am guessing may be related

current version of home assistant
current version of eyonwater

**THIS ERROR
Logger: homeassistant.components.recorder.util
Source: components/recorder/util.py:139
Integration: Recorder (documentation, issues)
First occurred: January 29, 2024 at 5:00:10 PM (2 occurrences)
Last logged: 7:00:10 AM

Error executing query: (MySQLdb.IntegrityError) (1062, "Duplicate entry '499-1706572800' for key 'ix_statistics_statistic_id_start_ts'") [SQL: INSERT INTO statistics (created, created_ts, metadata_id, start, start_ts, mean, min, max, last_reset, last_reset_ts, state, sum) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s), (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s), (%s, %s, %s, ... 3933 characters truncated ... s), (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s) RETURNING statistics.id, statistics.id AS id__1] [parameters: (None, 1706576410.577547, 28, None, 1706572800.0, 3195.232080623055, 1218.0, 10613.0, None, None, None, None, None, 1706576410.5778189, 29, None, 1706572800.0, 0.14725605999999997, 0.14725606, 0.14725606, None, None, None, None, None, 1706576410.5779796, 31, None, 1706572800.0, 5.8999999999999995, 5.9, 5.9, None, None, None, None, None, 1706576410.578151, 32, None, 1706572800.0, 31.89257960794444, 26.7, 38.6, None, None, None, None, None, 1706576410.5783548 ... 884 parameters truncated ... 69.3626, 69.3535, None, 1706576410.5904734, 492, None, 1706572800.0, 2.1000000000000005, 2.1, 2.1, None, None, None, None, None, 1706576410.5906467, 493, None, 1706572800.0, None, None, None, None, None, 4.6152, 4.6152, None, 1706576410.5908117, 499, None, 1706572800.0, None, None, None, None, None, 723.991, 0.25900000000001455, None, 1706576410.590975, 515, None, 1706572800.0, None, None, None, None, 1706554710.865161, 2.44160729999985, 627.3264551400002)] (Background on this error at: https://sqlalche.me/e/20/gkpj)
Error executing query: (MySQLdb.IntegrityError) (1062, "Duplicate entry '499-1706623200' for key 'ix_statistics_statistic_id_start_ts'") [SQL: INSERT INTO statistics (created, created_ts, metadata_id, start, start_ts, mean, min, max, last_reset, last_reset_ts, state, sum) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s), (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s), (%s, %s, %s, ... 3833 characters truncated ... s), (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s) RETURNING statistics.id, statistics.id AS id__1] [parameters: (None, 1706626810.5791802, 28, None, 1706623200.0, 2321.116250138889, 699.9999999999999, 5398.0, None, None, None, None, None, 1706626810.5794628, 29, None, 1706623200.0, 0.14725605999999997, 0.14725606, 0.14725606, None, None, None, None, None, 1706626810.5796165, 31, None, 1706623200.0, 5.8999999999999995, 5.9, 5.9, None, None, None, None, None, 1706626810.5797615, 32, None, 1706623200.0, 31.094835868972222, 27.5, 39.1, None, None, None, None, None, 1706626810.5799015 ... 860 parameters truncated ... 69.6136, 69.6045, None, 1706626810.5989528, 492, None, 1706623200.0, 2.1000000000000005, 2.1, 2.1, None, None, None, None, None, 1706626810.599085, 493, None, 1706623200.0, None, None, None, None, None, 4.6442, 4.6442, None, 1706626810.5992107, 499, None, 1706623200.0, None, None, None, None, None, 723.991, 0.25900000000001455, None, 1706626810.5993323, 515, None, 1706623200.0, None, None, None, None, 1706554710.865161, 6.03138689999953, 630.91623474)] (Background on this error at: https://sqlalche.me/e/20/gkpj)
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 2112, in _exec_insertmany_context
dialect.do_execute(
File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/default.py", line 922, in do_execute
cursor.execute(statement, parameters)
File "/usr/local/lib/python3.11/site-packages/MySQLdb/cursors.py", line 179, in execute
res = self._query(mogrified_query)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/MySQLdb/cursors.py", line 331, in _query
self._do_get_result(db)
File "/usr/local/lib/python3.11/site-packages/MySQLdb/cursors.py", line 136, in _do_get_result
self._result = result = self._get_result()
^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/MySQLdb/cursors.py", line 363, in _get_result
return self._get_db().store_result()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
MySQLdb.IntegrityError: (1062, "Duplicate entry '499-1706572800' for key 'ix_statistics_statistic_id_start_ts'")

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/recorder/util.py", line 139, in session_scope
yield session
File "/usr/src/homeassistant/homeassistant/components/recorder/statistics.py", line 477, in compile_statistics
modified_statistic_ids = _compile_statistics(
^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/recorder/statistics.py", line 573, in _compile_statistics
session.flush() # populate the ids of the new StatisticsShortTerm rows
^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/sqlalchemy/orm/session.py", line 4312, in flush
self._flush(objects)
File "/usr/local/lib/python3.11/site-packages/sqlalchemy/orm/session.py", line 4447, in _flush
with util.safe_reraise():
File "/usr/local/lib/python3.11/site-packages/sqlalchemy/util/langhelpers.py", line 146, in exit
raise exc_value.with_traceback(exc_tb)
File "/usr/local/lib/python3.11/site-packages/sqlalchemy/orm/session.py", line 4408, in _flush
flush_context.execute()
File "/usr/local/lib/python3.11/site-packages/sqlalchemy/orm/unitofwork.py", line 466, in execute
rec.execute(self)
File "/usr/local/lib/python3.11/site-packages/sqlalchemy/orm/unitofwork.py", line 642, in execute
util.preloaded.orm_persistence.save_obj(
File "/usr/local/lib/python3.11/site-packages/sqlalchemy/orm/persistence.py", line 93, in save_obj
_emit_insert_statements(
File "/usr/local/lib/python3.11/site-packages/sqlalchemy/orm/persistence.py", line 1136, in _emit_insert_statements
result = connection.execute(
^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1416, in execute
return meth(
^^^^^
File "/usr/local/lib/python3.11/site-packages/sqlalchemy/sql/elements.py", line 516, in _execute_on_connection
return connection._execute_clauseelement(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1639, in _execute_clauseelement
ret = self._execute_context(
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1843, in _execute_context
return self._exec_insertmany_context(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 2120, in _exec_insertmany_context
self._handle_dbapi_exception(
File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 2343, in _handle_dbapi_exception
raise sqlalchemy_exception.with_traceback(exc_info[2]) from e
File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 2112, in _exec_insertmany_context
dialect.do_execute(
File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/default.py", line 922, in do_execute
cursor.execute(statement, parameters)
File "/usr/local/lib/python3.11/site-packages/MySQLdb/cursors.py", line 179, in execute
res = self._query(mogrified_query)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/MySQLdb/cursors.py", line 331, in _query
self._do_get_result(db)
File "/usr/local/lib/python3.11/site-packages/MySQLdb/cursors.py", line 136, in _do_get_result
self._result = result = self._get_result()
^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/MySQLdb/cursors.py", line 363, in _get_result
return self._get_db().store_result()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
sqlalchemy.exc.IntegrityError: (MySQLdb.IntegrityError) (1062, "Duplicate entry '499-1706572800' for key 'ix_statistics_statistic_id_start_ts'")
[SQL: INSERT INTO statistics (created, created_ts, metadata_id, start, start_ts, mean, min, max, last_reset, last_reset_ts, state, sum) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s), (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s), (%s, %s, %s, ... 3933 characters truncated ... s), (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s) RETURNING statistics.id, statistics.id AS id__1]
[parameters: (None, 1706576410.577547, 28, None, 1706572800.0, 3195.232080623055, 1218.0, 10613.0, None, None, None, None, None, 1706576410.5778189, 29, None, 1706572800.0, 0.14725605999999997, 0.14725606, 0.14725606, None, None, None, None, None, 1706576410.5779796, 31, None, 1706572800.0, 5.8999999999999995, 5.9, 5.9, None, None, None, None, None, 1706576410.578151, 32, None, 1706572800.0, 31.89257960794444, 26.7, 38.6, None, None, None, None, None, 1706576410.5783548 ... 884 parameters truncated ... 69.3626, 69.3535, None, 1706576410.5904734, 492, None, 1706572800.0, 2.1000000000000005, 2.1, 2.1, None, None, None, None, None, 1706576410.5906467, 493, None, 1706572800.0, None, None, None, None, None, 4.6152, 4.6152, None, 1706576410.5908117, 499, None, 1706572800.0, None, None, None, None, None, 723.991, 0.25900000000001455, None, 1706576410.590975, 515, None, 1706572800.0, None, None, None, None, 1706554710.865161, 2.44160729999985, 627.3264551400002)]
(Background on this error at: https://sqlalche.me/e/20/gkpj)

**THIS WARNING
Logger: homeassistant.components.recorder.statistics
Source: components/recorder/statistics.py:477
Integration: Recorder (documentation, issues)
First occurred: January 29, 2024 at 5:00:10 PM (2 occurrences)
Last logged: 7:00:10 AM

Blocked attempt to insert duplicated statistic rows, please report at https://github.com/home-assistant/core/issues?q=is%3Aopen+is%3Aissue+label%3A%22integration%3A+recorder%22
Traceback (most recent call last):
File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 2112, in _exec_insertmany_context
dialect.do_execute(
File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/default.py", line 922, in do_execute
cursor.execute(statement, parameters)
File "/usr/local/lib/python3.11/site-packages/MySQLdb/cursors.py", line 179, in execute
res = self._query(mogrified_query)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/MySQLdb/cursors.py", line 331, in _query
self._do_get_result(db)
File "/usr/local/lib/python3.11/site-packages/MySQLdb/cursors.py", line 136, in _do_get_result
self._result = result = self._get_result()
^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/MySQLdb/cursors.py", line 363, in _get_result
return self._get_db().store_result()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
MySQLdb.IntegrityError: (1062, "Duplicate entry '499-1706572800' for key 'ix_statistics_statistic_id_start_ts'")

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/recorder/util.py", line 139, in session_scope
yield session
File "/usr/src/homeassistant/homeassistant/components/recorder/statistics.py", line 477, in compile_statistics
modified_statistic_ids = _compile_statistics(
^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/recorder/statistics.py", line 573, in _compile_statistics
session.flush() # populate the ids of the new StatisticsShortTerm rows
^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/sqlalchemy/orm/session.py", line 4312, in flush
self._flush(objects)
File "/usr/local/lib/python3.11/site-packages/sqlalchemy/orm/session.py", line 4447, in _flush
with util.safe_reraise():
File "/usr/local/lib/python3.11/site-packages/sqlalchemy/util/langhelpers.py", line 146, in exit
raise exc_value.with_traceback(exc_tb)
File "/usr/local/lib/python3.11/site-packages/sqlalchemy/orm/session.py", line 4408, in _flush
flush_context.execute()
File "/usr/local/lib/python3.11/site-packages/sqlalchemy/orm/unitofwork.py", line 466, in execute
rec.execute(self)
File "/usr/local/lib/python3.11/site-packages/sqlalchemy/orm/unitofwork.py", line 642, in execute
util.preloaded.orm_persistence.save_obj(
File "/usr/local/lib/python3.11/site-packages/sqlalchemy/orm/persistence.py", line 93, in save_obj
_emit_insert_statements(
File "/usr/local/lib/python3.11/site-packages/sqlalchemy/orm/persistence.py", line 1136, in _emit_insert_statements
result = connection.execute(
^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1416, in execute
return meth(
^^^^^
File "/usr/local/lib/python3.11/site-packages/sqlalchemy/sql/elements.py", line 516, in _execute_on_connection
return connection._execute_clauseelement(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1639, in _execute_clauseelement
ret = self._execute_context(
^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 1843, in _execute_context
return self._exec_insertmany_context(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 2120, in _exec_insertmany_context
self._handle_dbapi_exception(
File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 2343, in _handle_dbapi_exception
raise sqlalchemy_exception.with_traceback(exc_info[2]) from e
File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py", line 2112, in _exec_insertmany_context
dialect.do_execute(
File "/usr/local/lib/python3.11/site-packages/sqlalchemy/engine/default.py", line 922, in do_execute
cursor.execute(statement, parameters)
File "/usr/local/lib/python3.11/site-packages/MySQLdb/cursors.py", line 179, in execute
res = self._query(mogrified_query)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/MySQLdb/cursors.py", line 331, in _query
self._do_get_result(db)
File "/usr/local/lib/python3.11/site-packages/MySQLdb/cursors.py", line 136, in _do_get_result
self._result = result = self._get_result()
^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/MySQLdb/cursors.py", line 363, in _get_result
return self._get_db().store_result()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
sqlalchemy.exc.IntegrityError: (MySQLdb.IntegrityError) (1062, "Duplicate entry '499-1706572800' for key 'ix_statistics_statistic_id_start_ts'")
[SQL: INSERT INTO statistics (created, created_ts, metadata_id, start, start_ts, mean, min, max, last_reset, last_reset_ts, state, sum) VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s), (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s), (%s, %s, %s, ... 3933 characters truncated ... s), (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s) RETURNING statistics.id, statistics.id AS id__1]
[parameters: (None, 1706576410.577547, 28, None, 1706572800.0, 3195.232080623055, 1218.0, 10613.0, None, None, None, None, None, 1706576410.5778189, 29, None, 1706572800.0, 0.14725605999999997, 0.14725606, 0.14725606, None, None, None, None, None, 1706576410.5779796, 31, None, 1706572800.0, 5.8999999999999995, 5.9, 5.9, None, None, None, None, None, 1706576410.578151, 32, None, 1706572800.0, 31.89257960794444, 26.7, 38.6, None, None, None, None, None, 1706576410.5783548 ... 884 parameters truncated ... 69.3626, 69.3535, None, 1706576410.5904734, 492, None, 1706572800.0, 2.1000000000000005, 2.1, 2.1, None, None, None, None, None, 1706576410.5906467, 493, None, 1706572800.0, None, None, None, None, None, 4.6152, 4.6152, None, 1706576410.5908117, 499, None, 1706572800.0, None, None, None, None, None, 723.991, 0.25900000000001455, None, 1706576410.590975, 515, None, 1706572800.0, None, None, None, None, 1706554710.865161, 2.44160729999985, 627.3264551400002)]
(Background on this error at: https://sqlalche.me/e/20/gkpj)

**THIS ERROR
Logger: homeassistant.components.recorder.core
Source: components/recorder/core.py:901
Integration: Recorder (documentation, issues)
First occurred: January 29, 2024 at 5:00:10 PM (2 occurrences)
Last logged: 7:00:10 AM

Error while processing event StatisticsTask(start=datetime.datetime(2024, 1, 30, 0, 55, tzinfo=datetime.timezone.utc), fire_events=True): cannot access local variable 'modified_statistic_ids' where it is not associated with a value
Error while processing event StatisticsTask(start=datetime.datetime(2024, 1, 30, 14, 55, tzinfo=datetime.timezone.utc), fire_events=True): cannot access local variable 'modified_statistic_ids' where it is not associated with a value
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/recorder/core.py", line 901, in _guarded_process_one_task_or_recover
self._process_one_task_or_recover(task)
File "/usr/src/homeassistant/homeassistant/components/recorder/core.py", line 912, in _process_one_task_or_recover
return task.run(self)
^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/recorder/tasks.py", line 165, in run
if statistics.compile_statistics(instance, self.start, self.fire_events):
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/recorder/util.py", line 625, in wrapper
return job(instance, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/src/homeassistant/homeassistant/components/recorder/statistics.py", line 481, in compile_statistics
if modified_statistic_ids:
^^^^^^^^^^^^^^^^^^^^^^
UnboundLocalError: cannot access local variable 'modified_statistic_ids' where it is not associated with a value

Loading more granular historical data

Hello,

It looks like the API pulls the data only few times a day, resulting in fairly incomplete data with low granularity. Would it be possible to load 15 min interval data historically and insert it to Home Assistant? Thanks

Value is not a valid enumeration member - Setup failure.

Hi Devs! Thank you for supporting this addon!

I'll admit that I'm not super code savvy - I tried looking for meter_reader.py but wasn't able to locate it in my HA Pi. In fact, I'm not sure posting an issue is even the most friendly way to request assistance, but here we are.

It appears that the enumeration member for my service does not match an allowed format? The meter reports back in Litres (I'm on the eyeonwater.ca domain, if that matters)

Here's the log - if you have any suggestions, I'm all ears.

`Traceback (most recent call last):
File "/usr/local/lib/python3.12/site-packages/pyonwater/meter_reader.py", line 47, in read_meter_info
meter_info = MeterInfo.parse_obj(meters[0]["_source"])
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/pydantic/main.py", line 526, in parse_obj
return cls(**obj)
^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/pydantic/main.py", line 341, in init
raise validation_error
pydantic.error_wrappers.ValidationError: 1 validation error for MeterInfo
register_0 -> latest_read -> bill_display_units
value is not a valid enumeration member; permitted: 'GAL', '100 GAL', '10 GAL', 'CF', 'CUBIC_FEET', 'CCF', 'KGAL', 'CM', 'CUBIC_METER' (type=type_error.enum; enum_values=[<EOWUnits.UNIT_GAL: 'GAL'>, <EOWUnits.UNIT_100_GAL: '100 GAL'>, <EOWUnits.UNIT_10_GAL: '10 GAL'>, <EOWUnits.UNIT_CF: 'CF'>, <EOWUnits.UNIT_CUBIC_FEET: 'CUBIC_FEET'>, <EOWUnits.UNIT_CCF: 'CCF'>, <EOWUnits.UNIT_KGAL: 'KGAL'>, <EOWUnits.UNIT_CM: 'CM'>, <EOWUnits.UNIT_CUBIC_METER: 'CUBIC_METER'>])

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/config/custom_components/eyeonwater/init.py", line 45, in async_setup_entry
await eye_on_water_data.setup()
File "/config/custom_components/eyeonwater/coordinator.py", line 35, in setup
self.meters = await self.account.fetch_meters(self.client)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/pyonwater/account.py", line 67, in fetch_meters
meter_info = await reader.read_meter_info(client)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.12/site-packages/pyonwater/meter_reader.py", line 50, in read_meter_info
raise EyeOnWaterAPIError(msg) from e
pyonwater.exceptions.EyeOnWaterAPIError: Unexpected EOW response 1 validation error for MeterInfo
register_0 -> latest_read -> bill_display_units
value is not a valid enumeration member; permitted: 'GAL', '100 GAL', '10 GAL', 'CF', 'CUBIC_FEET', 'CCF', 'KGAL', 'CM', 'CUBIC_METER' (type=type_error.enum; enum_values=[<EOWUnits.UNIT_GAL: 'GAL'>, <EOWUnits.UNIT_100_GAL: '100 GAL'>, <EOWUnits.UNIT_10_GAL: '10 GAL'>, <EOWUnits.UNIT_CF: 'CF'>, <EOWUnits.UNIT_CUBIC_FEET: 'CUBIC_FEET'>, <EOWUnits.UNIT_CCF: 'CCF'>, <EOWUnits.UNIT_KGAL: 'KGAL'>, <EOWUnits.UNIT_CM: 'CM'>, <EOWUnits.UNIT_CUBIC_METER: 'CUBIC_METER'>])
`

Repository description

Can you please add a one sentence description about this repository and EyeOnWater. It ill show up in the HACS object box.

negative daily usage equals to lifetime usage

Since update to 2.4, I intermittently see huge negative usage that autocorrects. Observations...

  1. Initially I thought the huge negative usage is random but I can now say that it is equal to the lifetime water usage.
  2. I don't find any invalid statistics when I go to "Developer Tools" -> Statistics (I know how it works and have fixed incorrect statistics for electricity).

The issue seems to autocorrect and then manifests again after some time (few hours) and then again auto-corrects (in some hours). Also, the spike (the hour with the huge negative usage) seems to be shifting. The last I saw today was 12pm and then it corrected and now again I see at 6pm.

incompatible parsing for multiple meters

I would like to collect data on multiple meters that are registered under the same eyeonwater.com username.

When I access the dashboard, my page contains just one meter reading in new_barInfo["meter_read"] (going by what the eow.py code seems to be scraping), and this meter reading corresponds to the meter whose meter_uuid value is in AQ.Settings.meter_uuid. Accessing each meter requires doing a POST to the dashboard URL with a payload of meter_uuid=NNN, where the different meter_uuid values come from AQ.Views.MeterPicker.meters.

This seems to be different from what the eow.py code is expecting; it seems like the current code expects to see the readings for all of the multiple meters to be in found in new_barInfo["meter_read"]. The current code never issues a POST to the dashboard, just a GET. I don't know whether this is a recent change to eyeonwater.com (I only started trying to use this recently), or whether there's something different about how my eyeonwater.com account is set up (e.g., my two meters have different account_id values in AQ.Views.MeterPicker.meters; is that relevant here?).

Multi meter

Has the multi meter that indicated in the code actually been tested?

Integration Cannot Be Loaded or Deleted

I tried to delete the integration but it gave me the message, but it just stay there.

I looked at the log at found error message saying: unable to intstall package pyonwater.

Setup failed for custom integration eyeonwater: Requirements for eyeonwater not found: ['pyonwater==0.3.1'].

Unable to install package pyonwater==0.3.1: ERROR: Cannot install pyonwater==0.3.1 because these package versions have conflicting dependencies. ERROR: ResolutionImpossible

I tried to redownload the package in HACS, but the problem still exists.

Thank you.

Unsupported measurement unit: CCF

Thanks for maintaining this great integration. It looks like something may have changed on the Eye On Water API side. Both v2.2.0-beta.1 and v2.0.5 are giving me the same error message since recently.

Logger: homeassistant.config_entries
Source: custom_components/eyeonwater/coordinator.py:48
Integration: EyeOnWater (documentation)
First occurred: 9:59:35 PM (3 occurrences)
Last logged: 10:00:04 PM

Error setting up entry [email protected] for eyeonwater
Traceback (most recent call last):
File "/config/custom_components/eyeonwater/coordinator.py", line 46, in read_meters
await meter.read_meter(client=self.client, days_to_load=days_to_load)
File "/usr/local/lib/python3.11/site-packages/pyonwater/meter.py", line 64, in read_meter
historical_data = await self.reader.read_historical_data(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/pyonwater/meter_reader.py", line 124, in read_historical_data
statistics += await self.read_historical_data_one_day(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/pyonwater/meter_reader.py", line 186, in read_historical_data_one_day
reading=self.convert(response_unit, d.bill_read),
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/site-packages/pyonwater/meter_reader.py", line 71, in convert
raise EyeOnWaterAPIError(
pyonwater.exceptions.EyeOnWaterAPIError: Unsupported measurement unit: CCF

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/config_entries.py", line 388, in async_setup
result = await component.async_setup_entry(hass, self)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/config/custom_components/eyeonwater/init.py", line 53, in async_setup_entry
await eye_on_water_data.read_meters(days_to_load=30)
File "/config/custom_components/eyeonwater/coordinator.py", line 48, in read_meters
raise UpdateFailed(error) from error
homeassistant.helpers.update_coordinator.UpdateFailed: Unsupported measurement unit: CCF

The state class '' of this entity is not supported

Thanks for maintaining this integration! The statistic sensor and main meter sensor are reporting that their state class is incorrectly defined.

The state class '' of this entity is not supported.
v2.5.2

No history imported w/ import_historical_data service

Added this integration today, able to see current values. However, when I call the import_historical_data service, no historical data is added as far as I can tell. I've tried both high values and as low as 1 day. I don't see any errors reported in the logs looking at HA Core.

Happy to try to troubleshoot / look further if pointed in the right direction!

Failed to connect when installing

Hi

I've just reinstalled my HA system and was about to install EOW again. But when I try, firstly, there is no where I can select .com or .ca and when I enter the correct information I get this error.

I can't see anything in the log

Skærmbillede 2023-08-19 kl  19 43 12

Restore state class of the Sensor and create HistoricalSensor

As per discussion here #30:

  • HistoricalSensor should have an undefined state_class and should keep all the logic related to historical data imports
  • Sensor should have proper state_class and should keep all the logic but historical data imports (as it was before v2.0)

Unsupported measurement unit error

Hello,
I have just installed this Integration. It is connecting properly to the Eye on water server and created 2 sensors, one for my meter and one for leak detection. However both sensors show unavailable, and after enabling debug logs, I find the following error:



Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 262, in async_refresh
    await self._async_refresh(log_failures=True)
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 374, in _async_refresh
    self.async_update_listeners()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 164, in async_update_listeners
    update_callback()
  File "/config/custom_components/eyeonwater/sensor.py", line 85, in _state_update
    self._state = self.meter.reading
                  ^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/eyeonwater/eow.py", line 158, in reading
    raise EyeOnWaterAPIError(f"Unsupported measurement unit: {read_unit}")
custom_components.eyeonwater.eow.EyeOnWaterAPIError: Unsupported measurement unit: 10 GAL

I am not familiar enough with HomeAssistant to know if the problem could be that it s getting GAL and only understands gal. I tried changing the code to convert the value to lowercase to see if that helped, but wasn't successful in doing that. Any pointers would be appreciated.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.