{"action":"created","issue":{"url":"https://api.github.com/repos/titilambert/pyhydroquebec/issues/23","repository_url":"https://api.github.com/repos/titilambert/pyhydroquebec","labels_url":"https://api.github.com/repos/titilambert/pyhydroquebec/issues/23/labels{/name}","comments_url":"https://api.github.com/repos/titilambert/pyhydroquebec/issues/23/comments","events_url":"https://api.github.com/repos/titilambert/pyhydroquebec/issues/23/events","html_url":"https://github.com/titilambert/pyhydroquebec/issues/23","id":350015376,"node_id":"MDU6SXNzdWUzNTAwMTUzNzY=","number":23,"title":"Hydro-Québec sensor fails to init with unexpected mimetype error","user":{"login":"ParitoshBh","id":11397869,"node_id":"MDQ6VXNlcjExMzk3ODY5","avatar_url":"https://avatars1.githubusercontent.com/u/11397869?v=4","gravatar_id":"","url":"https://api.github.com/users/ParitoshBh","html_url":"https://github.com/ParitoshBh","followers_url":"https://api.github.com/users/ParitoshBh/followers","following_url":"https://api.github.com/users/ParitoshBh/following{/other_user}","gists_url":"https://api.github.com/users/ParitoshBh/gists{/gist_id}","starred_url":"https://api.github.com/users/ParitoshBh/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ParitoshBh/subscriptions","organizations_url":"https://api.github.com/users/ParitoshBh/orgs","repos_url":"https://api.github.com/users/ParitoshBh/repos","events_url":"https://api.github.com/users/ParitoshBh/events{/privacy}","received_events_url":"https://api.github.com/users/ParitoshBh/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":17,"created_at":"2018-08-13T12:48:39Z","updated_at":"2018-12-05T01:00:25Z","closed_at":null,"author_association":"NONE","body":"**Home Assistant release with the issue:** 0.75.3\r\n\r\n**Operating environment (Hass.io/Docker/Windows/etc.):** Docker (running in Ubuntu 18.04 virtual machine)\r\n\r\n**Description of problem:**\r\nSensor fails to initialize with following error,\r\n\r\n```python\r\n2018-08-11 22:16:19 ERROR (MainThread) [homeassistant.components.sensor] Error while setting up platform hydroquebec\r\nTraceback (most recent call last):\r\n  File \"/usr/src/app/homeassistant/helpers/entity_platform.py\", line 129, in _async_setup_platform\r\n    SLOW_SETUP_MAX_WAIT, loop=hass.loop)\r\n  File \"/usr/local/lib/python3.6/asyncio/tasks.py\", line 358, in wait_for\r\n    return fut.result()\r\n  File \"/usr/src/app/homeassistant/components/sensor/hydroquebec.py\", line 109, in async_setup_platform\r\n    contracts = yield from hydroquebec_data.get_contract_list()\r\n  File \"/usr/src/app/homeassistant/components/sensor/hydroquebec.py\", line 180, in get_contract_list\r\n    ret = yield from self._fetch_data()\r\n  File \"/usr/src/app/homeassistant/components/sensor/hydroquebec.py\", line 190, in _fetch_data\r\n    await self.client.fetch_data()\r\n  File \"/usr/local/lib/python3.6/site-packages/pyhydroquebec/client.py\", line 372, in fetch_data\r\n    hourly_data = yield from self._get_hourly_data(day_date, p_p_id)\r\n  File \"/usr/local/lib/python3.6/site-packages/pyhydroquebec/client.py\", line 309, in _get_hourly_data\r\n    json_output = yield from raw_res.json(content_type='text/json')\r\n  File \"/usr/local/lib/python3.6/site-packages/aiohttp/client_reqrep.py\", line 927, in json\r\n    headers=self.headers)\r\naiohttp.client_exceptions.ContentTypeError: 0, message='Attempt to decode JSON with unexpected mimetype: text/html; charset=utf-8'\r\n```\r\n\r\n**Problem-relevant `configuration.yaml` entries and (fill out even if it seems unimportant):**\r\n```yaml\r\nsensor:\r\n  - platform: transmission\r\n    host: INTERNAL_IP\r\n    username: transmission\r\n    password: transmission\r\n    monitored_variables:\r\n      #- 'current_status'\r\n      - 'download_speed'\r\n      - 'active_torrents'\r\n      #- 'paused_torrents'\r\n  - platform: hydroquebec\r\n    username: USERNAME\r\n    password: PASSWORD\r\n    contract: CONTRACTNO\r\n    monitored_variables:\r\n#     - period_total_bill\r\n      - period_total_consumption\r\n#     - period_average_temperature\r\n```\r\n\r\n_P.S - Duplicate of https://github.com/home-assistant/home-assistant/issues/15944_"},"comment":{"url":"https://api.github.com/repos/titilambert/pyhydroquebec/issues/comments/444317748","html_url":"https://github.com/titilambert/pyhydroquebec/issues/23#issuecomment-444317748","issue_url":"https://api.github.com/repos/titilambert/pyhydroquebec/issues/23","id":444317748,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0NDMxNzc0OA==","user":{"login":"b0ne","id":971968,"node_id":"MDQ6VXNlcjk3MTk2OA==","avatar_url":"https://avatars1.githubusercontent.com/u/971968?v=4","gravatar_id":"","url":"https://api.github.com/users/b0ne","html_url":"https://github.com/b0ne","followers_url":"https://api.github.com/users/b0ne/followers","following_url":"https://api.github.com/users/b0ne/following{/other_user}","gists_url":"https://api.github.com/users/b0ne/gists{/gist_id}","starred_url":"https://api.github.com/users/b0ne/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/b0ne/subscriptions","organizations_url":"https://api.github.com/users/b0ne/orgs","repos_url":"https://api.github.com/users/b0ne/repos","events_url":"https://api.github.com/users/b0ne/events{/privacy}","received_events_url":"https://api.github.com/users/b0ne/received_events","type":"User","site_admin":false},"created_at":"2018-12-05T01:00:25Z","updated_at":"2018-12-05T01:00:25Z","author_association":"NONE","body":"You are almost there you have to tell home assistant to use pyhydroquebec version 2.4.0. In Hydroquebec.py. \r\nYou got two choice, edit the file at /usr/local/lib/python3.6/site-packages/homeassistant/components/sensor/hydroquebec.py \r\n\r\nor copy the file in the config/custom_components/sensor/hydroquebec.py\r\n\r\nSee here : https://developers.home-assistant.io/docs/en/creating_component_loading.html\r\n\r\nThe line you have to edit is the line 21 : REQUIREMENTS = ['pyhydroquebec==2.4.0']"}}
{"actor":{"display_login":"b0ne"}}