Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to retrieve meter data #9

Open
kunalkhosla opened this issue Aug 17, 2021 · 4 comments
Open

Unable to retrieve meter data #9

kunalkhosla opened this issue Aug 17, 2021 · 4 comments

Comments

@kunalkhosla
Copy link
Contributor

I cannot tell if this is a misconfiguration or something changed on oru.com

  File "/usr/local/lib/python3.7/dist-packages/coned/meter.py", line 93, in last_read
    await self.browse()
  File "/usr/local/lib/python3.7/dist-packages/coned/meter.py", line 151, in browse
    await page.click(".js-login-new-device-form .button")
  File "/usr/local/lib/python3.7/dist-packages/pyppeteer/page.py", line 1546, in click
    await frame.click(selector, options, **kwargs)
  File "/usr/local/lib/python3.7/dist-packages/pyppeteer/frame_manager.py", line 584, in click
    await handle.click(options)
  File "/usr/local/lib/python3.7/dist-packages/pyppeteer/element_handle.py", line 178, in click
    obj = await self._clickablePoint()
  File "/usr/local/lib/python3.7/dist-packages/pyppeteer/element_handle.py", line 112, in _clickablePoint
    'Node is either not visible or not an HTMLElement')
pyppeteer.errors.ElementHandleError: Node is either not visible or not an HTMLElement
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "run.py", line 18, in <module>
    startTime, endTime, value, uom = asyncio.get_event_loop().run_until_complete(meter.last_read())
  File "/usr/lib/python3.7/asyncio/base_events.py", line 584, in run_until_complete
    return future.result()
  File "/usr/local/lib/python3.7/dist-packages/coned/meter.py", line 114, in last_read
    raise MeterError("Error requesting meter data")
coned.meter.MeterError: Error requesting meter data`
@bvlaicu
Copy link
Owner

bvlaicu commented Aug 22, 2021

It's working for me so it's not oru.com. Hard to say what it could be without additional logging. I too get some errors occasionally, but overall the meter data is returned successfully. I ended up running the add-on from "local", so I can easily add helpful log statements and reload it with ease, in case of issues. Running locally means simply adding the add-on code under the /addons/local/. Usually they get installed under /addons/core/.

@kunalkhosla
Copy link
Contributor Author

kunalkhosla commented Aug 23, 2021

ok, so I cloned your repo and made the tests run locally. Turned out my UUID was incorrect. There are apparently two UUIDs in oru.com, and i picked up the wrong one. I'll send in a PR to your docs to correctly determine the right UUID.

On a separate note, does your integration show up data in the energy dashboard? I have about 10 data points so far, but my energy dashboard says it doesnt have any data to show

Screen Shot 2021-08-23 at 5 47 36 PM

Grafana Chart
Screen Shot 2021-08-23 at 5 48 11 PM

@bvlaicu
Copy link
Owner

bvlaicu commented Aug 24, 2021

I didn't spend too much time on it, but I was able to configure the energy dashboard with the energy meter sensor that I have configured based on the oru usage sensor.
Something like this:

utility_meter:
  daily_energy:
    source: sensor.oru_current_energy_usage
    net_consumption: true
    cycle: daily

So I added this sensor.daily_energy as the "Grid consumption" sensor in the energy dashboard.
Probably not the most ideal way, but I guess will do for now.

image

image

@kunalkhosla
Copy link
Contributor Author

ok, I think this is much better than what I proposed in #12 . I am going to try this with my setup, and if this works, I will close my PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants