Code Monkey home page Code Monkey logo

coned's People

Contributors

bvlaicu avatar habdulkafi avatar kunalkhosla avatar nickborgers avatar ninadpchaudhari avatar onlyservers avatar reriley avatar smitchsmith avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

coned's Issues

How do I get the UUID?

Been trying to find a good way to fine the UUID for oru.

Looking at network tab and such places but can't find a good way. Tried a few which looked like a UUID, but no bueno.
Any ideas how I can get the UUID?

Errors when trying to get data from ORU

Thank you for putting this together, really excited to use it!

I followed the instructions and the info from @kunalkhosla to get my UUID and my meter and can see my data in my browser when using the URL https://oru.opower.com/ei/edge/apis/cws-real-time-ami-v1/cws/oru/accounts/<YOUR_ACCOUNT_UUID>/meters/<YOUR_METER_NUMBER>/usage
in this format: {"startTime":"2021-11-03T17:45:00-04:00","endTime":"2021-11-03T18:00:00-04:00","value":0.2770}
but when i try to run the addon i get a bunch of errors as below:

Params:
EMAIL = [email protected]
PASSWORD = **********orq!$
MFA_TYPE = TOTP
MFA_SECRET = **********frgts
ACCOUNT_UUID = ac624eyy-b0xx-11yy-bfxx-xxxyyyyxxxxy
METER_NUMBER = 7010xxxx
SITE = oru
MQTT_HOST = hassio.local
MQTT_USER = mqtt
MQTT_PASS = **********1$$
Starting endless loop..
[1104/173349.266603:ERROR:bus.cc(393)] Failed to connect to the bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
DevTools listening on ws://127.0.0.1:33807/devtools/browser/fcb17349-06e5-45ca-88a4-bcd251558355
[1104/173349.272310:ERROR:gpu_init.cc(426)] Passthrough is not supported, GL is disabled
[1104/173349.643896:ERROR:bus.cc(393)] Failed to connect to the bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
DevTools listening on ws://127.0.0.1:46823/devtools/browser/64676853-4b5a-4495-b704-a0b403f4a1ab
[1104/173349.652351:ERROR:gpu_init.cc(426)] Passthrough is not supported, GL is disabled
[1104/173351.591201:WARNING:spdy_session.cc(3431)] Received HEADERS for invalid stream 5
[1104/173351.911196:INFO:CONSOLE(11)] "Uncaught TypeError: Cannot read property 'split' of undefined", source: about:srcdoc (11)
[1104/173352.033401:INFO:CONSOLE(11)] "Uncaught TypeError: Cannot read property 'split' of undefined", source: about:srcdoc (11)
[1104/173353.164731:INFO:CONSOLE(1)] "'webkitRequestAnimationFrame' is vendor-specific. Please use the standard 'requestAnimationFrame' instead.", source: https://siteintercept.qualtrics.com/dxjsmodule/CoreModule.js?Q_CLIENTVERSION=1.63.1&Q_CLIENTTYPE=web&Q_BRANDID=coned (1)
[1104/173353.395074:INFO:CONSOLE(1)] "'webkitRequestAnimationFrame' is vendor-specific. Please use the standard 'requestAnimationFrame' instead.", source: https://siteintercept.qualtrics.com/dxjsmodule/CoreModule.js?Q_CLIENTVERSION=1.63.1&Q_CLIENTTYPE=web&Q_BRANDID=coned (1)
[1104/173435.365173:INFO:CONSOLE(1)] "'webkitRequestAnimationFrame' is vendor-specific. Please use the standard 'requestAnimationFrame' instead.", source: https://siteintercept.qualtrics.com/dxjsmodule/CoreModule.js?Q_CLIENTVERSION=1.63.1&Q_CLIENTTYPE=web&Q_BRANDID=coned (1)
Traceback (most recent call last):
File "/usr/local/lib/python3.7/dist-packages/coned/meter.py", line 99, in last_read
for read in jsonResponse['reads']:
KeyError: 'reads'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "run.py", line 18, in
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
Task exception was never retrieved
future: <Task finished coro=<Meter.browse() done, defined at /usr/local/lib/python3.7/dist-packages/coned/meter.py:116> exception=NetworkError('Protocol error Page.navigate: Target closed.')>
Traceback (most recent call last):
File "/usr/local/lib/python3.7/dist-packages/coned/meter.py", line 162, in browse
await api_page.goto(api_url)
File "/usr/local/lib/python3.7/dist-packages/pyppeteer/page.py", line 877, in goto
result = await self._navigate(url, referrer)
File "/usr/local/lib/python3.7/dist-packages/pyppeteer/page.py", line 892, in _navigate
'Page.navigate', {'url': url, 'referrer': referrer})
pyppeteer.errors.NetworkError: Protocol error Page.navigate: Target closed.
Task was destroyed but it is pending!
task: <Task pending coro=<NavigatorWatcher._createTimeoutPromise.._timeout_func() running at /usr/local/lib/python3.7/dist-packages/pyppeteer/navigator_watcher.py:96> wait_for=<Future pending cb=[<TaskWakeupMethWrapper object at 0x7f815489b528>()]>>
Task was destroyed but it is pending!
task: <Task pending coro=<wait() running at /usr/lib/python3.7/asyncio/tasks.py:363> wait_for=<Future pending cb=[<TaskWakeupMethWrapper object at 0x7f815489bdf8>()]> cb=[NavigatorWatcher.init..() at /usr/local/lib/python3.7/dist-packages/pyppeteer/navigator_watcher.py:54]>

im in rockland not sure if that makes a difference.

Issue trying to find Account UUID

I'm unable to find account UUID.

When I search for UUID in network tab it's not showing anything that clearly resembles Account UUID.

Is there anything more specific re finding Account UUID? maybe URL to which that UUID is being posted?

Thank you @bvlaicu ,
Best,
Daniel

Customer is not logged in

Hello,

Trying to give this a shot. I've provided credentials with TOTP. Based on the output screenshots it looks like we're able to login however when making the API request to opower it doesn't appear to pass the credentials through. The final screenshot I get is meter3-2.png resulting with "Error: details: Customer is not logged in." I'll see if I can figure out how pyppeteer is supposed to handle this and see if I can get it working.

        # Access the API using your newly acquired authentication cookies!
        api_page = await browser.newPage()
        api_url = 'https://' + self.data_site + '.opower.com/ei/edge/apis/cws-real-time-ami-v1/cws/' + self.data_site + '/accounts/' + self.account_uuid + '/meters/' + self.meter_number + '/usage'
        await api_page.goto(api_url)
        await api_page.screenshot({'path': 'meter3-2.png'})
Traceback (most recent call last):
  File "\venv\lib\site-packages\coned\meter.py", line 103, in last_read
    raise MeterError(jsonResponse['error']['details'])
coned.meter.MeterError: Customer is not logged in. (76f0e2cc-54a1-4c9b-9e57-38cbe4fbe485)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "test.py", line 15, in <module>
    startTime, endTime, value, unit_of_measurement = event_loop.run_until_complete(meter.last_read())
  File "C:\Python38\lib\asyncio\base_events.py", line 616, in run_until_complete
    return future.result()
  File "\venv\lib\site-packages\coned\meter.py", line 118, in last_read
    raise MeterError("Error requesting meter data")

EDIT:
Dumping the cookies on the opower.com page in the python request it looks like it does not contain the JSESSIONID cookie (seen in network inspection in chrome). I'm not sure where this session cookie is set, possibly in javascript somewhere?

Editing the request and randomizing the JSESSIONID results in the same not logged in error I am seeing in the screenshot so it is highly likely this is the problematic portion.

EDIT EDIT:
After logging it I think we need to make a request to the dashboard to get a valid session with opower. By adding the following lines I'm able to get usage data, however the script still fails with a Navigation Timeout Exceeded on page.py.

        opower_dash_url = 'https://www.coned.com/en/accounts-billing/dashboard?tab1=billingandusage-1&tab2=sectionEnergyBillingUsage-1&tab3=sectionRealTimeData-3'
        await page.goto(opower_dash_url )
        sleep = 5000
        await page.waitFor(sleep)

Opower endpoint no longer works

>>> from coned import Meter
>>>
>>> meter = Meter("123456789")
>>> energy_usage_kWh = meter.last_read()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "coned/meter.py", line 39, in last_read
    jsonResponse['error'])
coned.meter.MeterError: ('Error in getting the meter data: %s', {'details': 'HTTP 404 Not Found (43dd6f3a-d2eb-4d6a-acde-1ed6b74021a9)'})

The opower endpoint used in this project no longer works. The correct endpoint to use now is:

https://cned.opower.com/ei/edge/apis/cws-real-time-ami-v1/cws/cned/accounts/<account_id>/meters/<meter_id>/usage

This endpoint only works after opower authenticates via Okta SSO. If they are not, you may get this response:

{"error":{"details":"Customer is not logged in. (ee9d0f9a-e52f-4840-9c35-c975a08ecbb1)"}}

Increase scraping performance and reliability

Hi there,

First off, I just want to say huge thanks for building this- it helped me build a nice scraper to track/store my electricity usage which is something I've been putting off for a very long time.

While trying to get this library to work I noticed that I would successfully fetch reading data for only about 25% of my attempts. The other 75% would get caught up on authentication issues or some element not showing up as it should. I had a feeling these issues were due to various race conditions associated with trying to scrape JS-heavy webpage and wanted to do some refactoring, taking some lessons from how Cypress approaches this kind of work. Namely, I restructured the scraper to watch for and respond to elements appearing/disappearing on the page rather than waiting arbitrary amounts of time and hoping requests finished.

Here's the code, which is built pretty specifically for the context where I'm using it, but you can see the general ideas:

async def fetch_element(page, selector, max_tries=10):
    tries = 0
    el = None
    while el == None and tries < max_tries:
        el = await page.querySelector(selector)
        await page.waitFor(1000)

    return el

async def fetch_readings():
    browser_launch_config = {
        'defaultViewport': {'width': 1920, 'height': 1080},
        'dumpio': False,
        'args': ['--no-sandbox'],
    }

    browser = await pyppeteer.launch(browser_launch_config)
    page = await browser.newPage()
    await page.goto('https://coned.com/en/login', {'waitUntil' : 'domcontentloaded'})
    element = await page.querySelector('#form-login-email')
    logging.info('Authenticating...')

    await page.type('#form-login-email', os.environ.get('CONED_EMAIL'))
    await page.type('#form-login-password', os.environ.get('CONED_PASSWORD'))
    await page.click('.submit-button'),

    mfa_form = await fetch_element(page, '.js-login-new-device-form-selector:not(.hidden)')
    if mfa_form is None:
        logging.error('Never got MFA prompt. Aborting!')
        return

    logging.info('Entering MFA code...')
    mfa = await fetch_element(page, '#form-login-mfa-code')
    mfa_code = pyotp.TOTP(os.environ.get('CONED_MFA')).now()
    await mfa.type(mfa_code)
    await asyncio.gather(
        page.waitForNavigation(),
        page.click('.js-login-new-device-form .button'),
    )

    logging.info('Pausing for auth...')
    await page.waitFor(5000)
    logging.info('Fetching readings JSON...')
    
    api_page = await browser.newPage()
    account_id = os.environ.get('CONED_ACCOUNT_ID')
    meter_no = os.environ.get('CONED_METER_NUMBER')
    url = f"https://cned.opower.com/ei/edge/apis/cws-real-time-ami-v1/cws/cned/accounts/{account_id}/meters/{meter_no}/usage"
    await api_page.goto(url)
    data_elem = await api_page.querySelector('pre')
    raw_data = await api_page.evaluate('(el) => el.textContent', data_elem)

    data = json.loads(raw_data)

    await browser.close()
    logging.info('Done!')

    return data

The results have been promising so far- in my testing this method has been more reliable and faster than the current implementation since it doesn't have to wait as long for data. I figured I'd share it here in case you'd like to incorporate the changes into your library (or if you're open to a PR I can see if I can make the changes myself), or for others to use as a reference.

One thing I'd also like to add: I would recommend returning all of the reading results rather than just the latest one. AMI data can be lagged or be updated as time goes on (utilities are bad at computers), so if you're trying to scrape and store your meter's data you'll likely want to fetch the whole set of readings and insert/replace each interval in the database you're storing them in. Since running this scraper I've noticed that the latest reading is usually null for an hour or so before it starts getting populated with a kwh value.

Hope this is helpful!

Unable to install on pi4

Thanks for working on this project. Really excited to use it to monitor Coned. But also... halp plz. I'm unable to install by adding your repository to my addons. After your repository is added I and I click on ORU then the "install" i get a spinning cursor for a moment and then it just stops.

I'm running core-2021.4.6 and supervisor-2021.04.3 on a pi4

I'm wondering it has something to do with Chrome? The only error I'm seeing is:

E: Unable to locate package google-chrome-stable

But I actually can't tell if it's related to installing this addon. Although I do see pyppeteer as a dependency. Can i install this on home assistant? Sorry for the basic questions, I'm just having some difficulty problem-solving. Thanks in advance.

Inconsistant meter reading

Hi
First, thank you so much for creating this tool to read the coned meter data and get this into Home Assistant!

I noticed that the tool does not constantly read all meter updates published by ConEd. Somehow, it is only successful in ~1 of 8 updates available.

Below are some screenshots.
I am not sure where exactly the issue is, but maybe it helps to fix this so that the tool does catch all updates.

Thanks a lot for your help!

`DevTools listening on ws://127.0.0.1:47855/devtools/browser/743a81eb-383d-4ab4-8d0b-b12366843dbc
[0820/223427.304942:INFO:CONSOLE(24)] "ERR_DUP_SCRIPTS", source: https://www.glancecdn.net/cobrowse/CobrowseJS.ashx?group=19641&site=production (24)
[0820/223428.612899:INFO:CONSOLE(24)] "ERR_DUP_SCRIPTS", source: https://www.glancecdn.net/cobrowse/CobrowseJS.ashx?group=19641&site=production (24)
[0820/223431.125800:INFO:CONSOLE(3)] "Uncaught (in promise) Error: Loading chunk 11 failed.
(error: https://siteintercept.qualtrics.com/dxjsmodule/11.538b4e05effab334888e.chunk.js?Q_CLIENTVERSION=1.76.0&Q_CLIENTTYPE=web&Q_BRANDID=www.coned.com)", source: https://znetevwa2wlb6en9p-coned.siteintercept.qualtrics.com/WRSiteInterceptEngine/?Q_ZID=ZN_etEvWA2WLb6eN9P&Q_LOC=https%3A%2F%2Fwww.coned.com%2Fen%2Flogin&t=1661049270747 (3)
[0820/223431.141310:INFO:CONSOLE(3)] "Uncaught (in promise) Error: Loading chunk 11 failed.
(error: https://siteintercept.qualtrics.com/dxjsmodule/11.538b4e05effab334888e.chunk.js?Q_CLIENTVERSION=1.76.0&Q_CLIENTTYPE=web&Q_BRANDID=www.coned.com)", source: https://znetevwa2wlb6en9p-coned.siteintercept.qualtrics.com/WRSiteInterceptEngine/?Q_ZID=ZN_etEvWA2WLb6eN9P&Q_LOC=https%3A%2F%2Fwww.coned.com%2Fen%2Flogin&t=1661049270737 (3)
[0820/223500.242722:INFO:CONSOLE(2)] "Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check https://xhr.spec.whatwg.org/.", source: https://acdn-prod-bsdce-ngcx-va.azureedge.net/va/coned-va-build.min.js (2)
[0820/223501.557375:INFO:CONSOLE(24)] "ERR_DUP_SCRIPTS", source: https://www.glancecdn.net/cobrowse/CobrowseJS.ashx?group=19641&site=production (24)
[0820/223502.520911:INFO:CONSOLE(24)] "ERR_DUP_SCRIPTS", source: https://www.glancecdn.net/cobrowse/CobrowseJS.ashx?group=19641&site=production (24)
[0820/223503.017514:INFO:CONSOLE(3)] "Uncaught (in promise) Error: Loading chunk 11 failed.
(error: https://siteintercept.qualtrics.com/dxjsmodule/11.538b4e05effab334888e.chunk.js?Q_CLIENTVERSION=1.76.0&Q_CLIENTTYPE=web&Q_BRANDID=www.coned.com)", source: https://znetevwa2wlb6en9p-coned.siteintercept.qualtrics.com/WRSiteInterceptEngine/?Q_ZID=ZN_etEvWA2WLb6eN9P&Q_LOC=https%3A%2F%2Fwww.coned.com%2Fen%2Flogin%3Furl%3D%252fen%252faccounts-billing%252fdashboard%253ftab1%253dbillingandusage-1%2526tab3%253dsectionRealTimeData-3%26returnUrl%3D%252Fen%252Faccounts-billing%252Fdashboard%253Ftab1%253Dbillingandusage-1%2526tab3%253DsectionRealTimeData-3&t=1661049302844 (3)
[0820/223506.979122:INFO:CONSOLE(1)] "::-webkit-details-marker pseudo element selector is deprecated. Please use ::marker instead. See https://chromestatus.com/feature/6730096436051968 for more details.", source: https://nextweb-static.opower.com/maestro/themes/maestro-theme-cned/291e529f859e134f140a21f4b32a070d/pages/apps/maestro-widget-library-core/index.generated.embedded-api.40.min.js (1)
Task exception was never retrieved
future: <Task finished coro=<resp() done, defined at /usr/local/lib/python3.7/dist-packages/coned/meter.py:225> exception=NetworkError('Protocol error (Network.getResponseBody): No resource with given identifier found')>
Traceback (most recent call last):
File "/usr/local/lib/python3.7/dist-packages/coned/meter.py", line 231, in resp
raw_data = await res.text()
File "/usr/local/lib/python3.7/dist-packages/pyppeteer/network_manager.py", line 669, in text
content = await self.buffer()
File "/usr/local/lib/python3.7/dist-packages/pyppeteer/network_manager.py", line 654, in _bufread
'requestId': self._request._requestId
pyppeteer.errors.NetworkError: Protocol error (Network.getResponseBody): No resource with given identifier found
[0820/223512.896145:INFO:CONSOLE(3)] "Uncaught (in promise) Error: Loading chunk 11 failed.
(error: https://siteintercept.qualtrics.com/dxjsmodule/11.538b4e05effab334888e.chunk.js?Q_CLIENTVERSION=1.76.0&Q_CLIENTTYPE=web&Q_BRANDID=www.coned.com)", source: https://znetevwa2wlb6en9p-coned.siteintercept.qualtrics.com/WRSiteInterceptEngine/?Q_ZID=ZN_etEvWA2WLb6eN9P&Q_LOC=https%3A%2F%2Fwww.coned.com%2Fen%2Faccounts-billing%2Fdashboard%3Ftab1%3Dbillingandusage-1%26tab3%3DsectionRealTimeData-3&t=1661049310566 (3)
Creating Meter
Calling meter.last_read()..
res.url: https://cned.opower.com/ei/edge/apis/cws-real-time-ami-v1/cws/cned/accounts/8ff0f432-7638-11eb-99d8-02001700dbdb/meters/13798110/usage
res.status: 200
res.url: https://cned.opower.com/ei/edge/apis/cws-real-time-ami-v1/cws/cned/accounts/8ff0f432-7638-11eb-99d8-02001700dbdb/meters/13798110/usage
res.status: 200
message: {'startTime': '2022-08-20T21:45:00-04:00', 'endTime': '2022-08-20T22:00:00-04:00', 'value': 0.021, 'uom': 'KWH'}
Connecting to mqtt 192.168.5.149 as mqtt_user
Publishing to mqtt
Publishing electric_meter/value: 0.021
Publishing electric_meter/uom: KWH
Publishing electric_meter/startTime: 2022-08-20T21:45:00-04:00
Publishing electric_meter/endTime: 2022-08-20T22:00:00-04:00
Publishing electric_meter/message: {"startTime": "2022-08-20T21:45:00-04:00", "endTime": "2022-08-20T22:00:00-04:00", "value": 0.021, "uom": "KWH"}
Disconnectig from mqtt
DONE
Sleeping 5 mins..

[0820/224118.863236:ERROR:bus.cc(393)] Failed to connect to the bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
DevTools listening on ws://127.0.0.1:50145/devtools/browser/9b452db1-1157-4498-bb8e-6eeb69116340
[0820/224119.702062:ERROR:bus.cc(393)] Failed to connect to the bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
DevTools listening on ws://127.0.0.1:42163/devtools/browser/a60da16c-a6cb-401b-b8d8-982c2ecf5749
[0820/224124.877010:INFO:CONSOLE(24)] "ERR_DUP_SCRIPTS", source: https://www.glancecdn.net/cobrowse/CobrowseJS.ashx?group=19641&site=production (24)
[0820/224127.177833:INFO:CONSOLE(3)] "Uncaught (in promise) Error: Loading chunk 11 failed.
(error: https://siteintercept.qualtrics.com/dxjsmodule/11.538b4e05effab334888e.chunk.js?Q_CLIENTVERSION=1.76.0&Q_CLIENTTYPE=web&Q_BRANDID=www.coned.com)", source: https://znetevwa2wlb6en9p-coned.siteintercept.qualtrics.com/WRSiteInterceptEngine/?Q_ZID=ZN_etEvWA2WLb6eN9P&Q_LOC=https%3A%2F%2Fwww.coned.com%2Fen%2Flogin&t=1661049686882 (3)
[0820/224155.751674:INFO:CONSOLE(24)] "ERR_DUP_SCRIPTS", source: https://www.glancecdn.net/cobrowse/CobrowseJS.ashx?group=19641&site=production (24)
[0820/224156.594159:INFO:CONSOLE(3)] "Uncaught (in promise) Error: Loading chunk 11 failed.
(error: https://siteintercept.qualtrics.com/dxjsmodule/11.538b4e05effab334888e.chunk.js?Q_CLIENTVERSION=1.76.0&Q_CLIENTTYPE=web&Q_BRANDID=www.coned.com)", source: https://znetevwa2wlb6en9p-coned.siteintercept.qualtrics.com/WRSiteInterceptEngine/?Q_ZID=ZN_etEvWA2WLb6eN9P&Q_LOC=https%3A%2F%2Fwww.coned.com%2Fen%2Flogin&t=1661049716339 (3)
[0820/224210.437321:INFO:CONSOLE(2)] "Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check https://xhr.spec.whatwg.org/.", source: https://acdn-prod-bsdce-ngcx-va.azureedge.net/va/coned-va-build.min.js (2)
Task exception was never retrieved
future: <Task finished coro=<Meter.browse() done, defined at /usr/local/lib/python3.7/dist-packages/coned/meter.py:120> exception=TimeoutError('Navigation Timeout Exceeded: 10000 ms exceeded.')>
Traceback (most recent call last):
File "/usr/local/lib/python3.7/dist-packages/coned/meter.py", line 199, in browse
await page.goto(usage_page_url, {'waitUntil': 'domcontentloaded', 'timeout': 10000})
File "/usr/local/lib/python3.7/dist-packages/pyppeteer/page.py", line 837, in goto
raise error
pyppeteer.errors.TimeoutError: Navigation Timeout Exceeded: 10000 ms exceeded.
[0820/224216.089391:INFO:CONSOLE(24)] "ERR_DUP_SCRIPTS", source: https://www.glancecdn.net/cobrowse/CobrowseJS.ashx?group=19641&site=production (24)
[0820/224218.489546:INFO:CONSOLE(2)] "Synchronous XMLHttpRequest on the main thread is deprecated because of its detrimental effects to the end user's experience. For more help, check https://xhr.spec.whatwg.org/.", source: https://acdn-prod-bsdce-ngcx-va.azureedge.net/va/coned-va-build.min.js (2)
[0820/224219.567349:INFO:CONSOLE(1)] "::-webkit-details-marker pseudo element selector is deprecated. Please use ::marker instead. See https://chromestatus.com/feature/6730096436051968 for more details.", source: https://nextweb-static.opower.com/maestro/themes/maestro-theme-cned/291e529f859e134f140a21f4b32a070d/pages/apps/maestro-widget-library-core/index.generated.embedded-api.40.min.js (1)
Creating Meter
Calling meter.last_read()..
Traceback (most recent call last):
File "/usr/local/lib/python3.7/dist-packages/coned/meter.py", line 96, in last_read
await self.browse()
File "/usr/local/lib/python3.7/dist-packages/coned/meter.py", line 199, in browse
await page.goto(usage_page_url, {'waitUntil': 'domcontentloaded', 'timeout': 10000})
File "/usr/local/lib/python3.7/dist-packages/pyppeteer/page.py", line 837, in goto
raise error
pyppeteer.errors.TimeoutError: Navigation Timeout Exceeded: 10000 ms exceeded.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "run.py", line 26, in
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 118, in last_read
raise MeterError("Error requesting meter data")
coned.meter.MeterError: Error requesting meter data
[0820/224250.029086:ERROR:database.cc(1707)] Cookie sqlite error 1032, errno 0: attempt to write a readonly database, sql: DELETE FROM cookies WHERE name=? AND host_key=? AND path=?
[0820/224250.031757:ERROR:database.cc(1707)] Cookie sqlite error 2067, errno 0: UNIQUE constraint failed: cookies.host_key, cookies.name, cookies.path, sql: INSERT INTO cookies (creation_utc, host_key, name, value, path, expires_utc, is_secure, is_httponly, last_access_utc, has_expires, is_persistent, priority, encrypted_value, samesite, source_scheme, source_port, is_same_party) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
[0820/224250.033149:ERROR:database.cc(1707)] Cookie sqlite error 1032, errno 0: attempt to write a readonly database, sql: DELETE FROM cookies WHERE name=? AND host_key=? AND path=?
[0820/224250.034569:ERROR:database.cc(1707)] Cookie sqlite error 2067, errno 0: UNIQUE constraint failed: cookies.host_key, cookies.name, cookies.path, sql: INSERT INTO cookies (creation_utc, host_key, name, value, path, expires_utc, is_secure, is_httponly, last_access_utc, has_expires, is_persistent, priority, encrypted_value, samesite, source_scheme, source_port, is_same_party) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
[0820/224250.036206:ERROR:database.cc(1707)] Cookie sqlite error 1032, errno 0: attempt to write a readonly database, sql: DELETE FROM cookies WHERE name=? AND host_key=? AND path=?
[0820/224250.037849:ERROR:database.cc(1707)] Cookie sqlite error 2067, errno 0: UNIQUE constraint failed: cookies.host_key, cookies.name, cookies.path, sql: INSERT INTO cookies (creation_utc, host_key, name, value, path, expires_utc, is_secure, is_httponly, last_access_utc, has_expires, is_persistent, priority, encrypted_value, samesite, source_scheme, source_port, is_same_party) VALUES (?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?,?)
Sleeping 5 mins..`

[0820/225413.007690:ERROR:bus.cc(393)] Failed to connect to the bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
DevTools listening on ws://127.0.0.1:34941/devtools/browser/9c9bc563-97a8-4425-ab97-e46dd448fc07
[0820/225413.896444:ERROR:bus.cc(393)] Failed to connect to the bus: Failed to connect to socket /var/run/dbus/system_bus_socket: No such file or directory
DevTools listening on ws://127.0.0.1:36045/devtools/browser/221b9a78-f2af-482e-8b6d-8cc4a08f1bea
[0820/225419.102500:INFO:CONSOLE(24)] "ERR_DUP_SCRIPTS", source: https://www.glancecdn.net/cobrowse/CobrowseJS.ashx?group=19641&site=production (24)
[0820/225419.448758:INFO:CONSOLE(24)] "ERR_DUP_SCRIPTS", source: https://www.glancecdn.net/cobrowse/CobrowseJS.ashx?group=19641&site=production (24)
[0820/225421.218994:INFO:CONSOLE(3)] "Uncaught (in promise) Error: Loading chunk 11 failed.
(error: https://siteintercept.qualtrics.com/dxjsmodule/11.538b4e05effab334888e.chunk.js?Q_CLIENTVERSION=1.76.0&Q_CLIENTTYPE=web&Q_BRANDID=www.coned.com)", source: https://znetevwa2wlb6en9p-coned.siteintercept.qualtrics.com/WRSiteInterceptEngine/?Q_ZID=ZN_etEvWA2WLb6eN9P&Q_LOC=https%3A%2F%2Fwww.coned.com%2Fen%2Flogin&t=1661050460803 (3)
[0820/225441.969077:INFO:CONSOLE(3)] "Uncaught (in promise) Error: Loading chunk 11 failed.
(error: https://siteintercept.qualtrics.com/dxjsmodule/11.538b4e05effab334888e.chunk.js?Q_CLIENTVERSION=1.76.0&Q_CLIENTTYPE=web&Q_BRANDID=www.coned.com)", source: https://znetevwa2wlb6en9p-coned.siteintercept.qualtrics.com/WRSiteInterceptEngine/?Q_ZID=ZN_etEvWA2WLb6eN9P&Q_LOC=https%3A%2F%2Fwww.coned.com%2Fen%2Flogin&t=1661050481436 (3)
[0820/225458.051161:INFO:CONSOLE(24)] "ERR_DUP_SCRIPTS", source: https://www.glancecdn.net/cobrowse/CobrowseJS.ashx?group=19641&site=production (24)
[0820/225459.603692:INFO:CONSOLE(24)] "ERR_DUP_SCRIPTS", source: https://www.glancecdn.net/cobrowse/CobrowseJS.ashx?group=19641&site=production (24)
[0820/225459.924115:INFO:CONSOLE(3)] "Uncaught (in promise) Error: Loading chunk 11 failed.
(error: https://siteintercept.qualtrics.com/dxjsmodule/11.538b4e05effab334888e.chunk.js?Q_CLIENTVERSION=1.76.0&Q_CLIENTTYPE=web&Q_BRANDID=www.coned.com)", source: https://znetevwa2wlb6en9p-coned.siteintercept.qualtrics.com/WRSiteInterceptEngine/?Q_ZID=ZN_etEvWA2WLb6eN9P&Q_LOC=https%3A%2F%2Fwww.coned.com%2Fen%2Flogin%3Furl%3D%252fen%252faccounts-billing%252fdashboard%253ftab1%253dbillingandusage-1%2526tab3%253dsectionRealTimeData-3%26returnUrl%3D%252Fen%252Faccounts-billing%252Fdashboard%253Ftab1%253Dbillingandusage-1%2526tab3%253DsectionRealTimeData-3&t=1661050499607 (3)
[0820/225501.157648:INFO:CONSOLE(3)] "Uncaught (in promise) Error: Loading chunk 11 failed.
(error: https://siteintercept.qualtrics.com/dxjsmodule/11.538b4e05effab334888e.chunk.js?Q_CLIENTVERSION=1.76.0&Q_CLIENTTYPE=web&Q_BRANDID=www.coned.com)", source: https://znetevwa2wlb6en9p-coned.siteintercept.qualtrics.com/WRSiteInterceptEngine/?Q_ZID=ZN_etEvWA2WLb6eN9P&Q_LOC=https%3A%2F%2Fwww.coned.com%2Fen%2Flogin%3Furl%3D%252fen%252faccounts-billing%252fdashboard%253ftab1%253dbillingandusage-1%2526tab3%253dsectionRealTimeData-3%26returnUrl%3D%252Fen%252Faccounts-billing%252Fdashboard%253Ftab1%253Dbillingandusage-1%2526tab3%253DsectionRealTimeData-3&t=1661050500951 (3)
Creating Meter
Calling meter.last_read()..
Traceback (most recent call last):
File "/usr/local/lib/python3.7/dist-packages/coned/meter.py", line 96, in last_read
await self.browse()
File "/usr/local/lib/python3.7/dist-packages/coned/meter.py", line 214, in browse
self._LOGGER.debug(f"raw_data = {raw_data}")
NameError: name 'raw_data' is not defined
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "run.py", line 26, in
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 118, in last_read
raise MeterError("Error requesting meter data")
coned.meter.MeterError: Error requesting meter data
Task was destroyed but it is pending!
task: <Task pending coro=<sleep() running at /usr/lib/python3.7/asyncio/tasks.py:568> wait_for=<Future pending cb=[<TaskWakeupMethWrapper object at 0x7fa7bb6ee8>()]> cb=[<TaskWakeupMethWrapper object at 0x7fa7af97c8>()]>
Task was destroyed but it is pending!
task: <Task pending coro=<Meter.browse() running at /usr/local/lib/python3.7/dist-packages/coned/meter.py:205> wait_for=<Task pending coro=<sleep() done, defined at /usr/lib/python3.7/asyncio/tasks.py:555> wait_for=<Future pending cb=[<TaskWakeupMethWrapper object at 0x7fa7bb6ee8>()]> cb=[<TaskWakeupMethWrapper object at 0x7fa7af97c8>()]>>
Sleeping 5 mins..

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.