cyr-ius / hass-cozytouch

Cozytouch support for Home Assistant
GNU General Public License v2.0
23 stars 14 forks source link

Cannot log in to Cozytouch #24

Open VoytekD opened 3 years ago

VoytekD commented 3 years ago

Custom-component installed via HACS

When trying to log in, i recive an quite vague error message, pic below.

P.S. login and password are correct... when i make a mistake, on purpose, i receive other error message.

P.S.S. My setup: Home Assistant as a virtual machine in Virtualbox.

What am I doing wrong?

Zrzut ekranu 2020-11-30 211136
LinoDu74 commented 3 years ago

Got exactly the same issue since months... no way to get it worked...

cyr-ius commented 3 years ago

Please enable debug mode et paste the log

ALERTua commented 3 years ago
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/aiohttp/web_protocol.py", line 422, in _handle_request
    resp = await self._request_handler(request)
  File "/usr/local/lib/python3.8/site-packages/aiohttp/web_app.py", line 499, in _handle
    resp = await handler(request)
  File "/usr/local/lib/python3.8/site-packages/aiohttp/web_middlewares.py", line 118, in impl
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 18, in request_context_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 72, in ban_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 127, in auth_middleware
    return await handler(request)
  File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 129, in handle
    result = await result
  File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 169, in post
    return await super().post(request, flow_id)
  File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 60, in wrapper
    result = await method(view, request, *args, **kwargs)
  File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 106, in post
    result = await self._flow_mgr.async_configure(flow_id, data)
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 155, in async_configure
    result = await self._async_handle_step(flow, cur_step["step_id"], user_input)
  File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 213, in _async_handle_step
    result: Dict = await getattr(flow, method)(user_input)
  File "/config/custom_components/cozytouch/config_flow.py", line 55, in async_step_user
    await async_connect(user_input)
  File "/config/custom_components/cozytouch/__init__.py", line 137, in async_connect
    return await cozytouch.get_setup()
  File "/usr/local/lib/python3.8/site-packages/cozytouchpy/client.py", line 136, in get_setup
    return SetupHandler(response_json, self)
  File "/usr/local/lib/python3.8/site-packages/cozytouchpy/handlers.py", line 44, in __init__
    self.__build_devices(data["devices"])
  File "/usr/local/lib/python3.8/site-packages/cozytouchpy/handlers.py", line 71, in __build_devices
    cozyouch_device = DevicesHandler.build(
  File "/usr/local/lib/python3.8/site-packages/cozytouchpy/handlers.py", line 201, in build
    device = CozytouchPod(data)
  File "/usr/local/lib/python3.8/site-packages/cozytouchpy/objects/device.py", line 19, in __init__
    self.states = data["states"]
KeyError: 'states'
alanscorp commented 3 years ago

image image image

Logger: aiohttp.server Source: custom_components/cozytouch/init.py:137 First occurred: 17:08:51 (1 occurrences) Last logged: 17:08:51

Error handling request Traceback (most recent call last): File "/usr/local/lib/python3.8/site-packages/aiohttp/web_protocol.py", line 422, in _handle_request resp = await self._request_handler(request) File "/usr/local/lib/python3.8/site-packages/aiohttp/web_app.py", line 499, in _handle resp = await handler(request) File "/usr/local/lib/python3.8/site-packages/aiohttp/web_middlewares.py", line 118, in impl return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/security_filter.py", line 56, in security_filter_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/request_context.py", line 18, in request_context_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/ban.py", line 72, in ban_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/auth.py", line 127, in auth_middleware return await handler(request) File "/usr/src/homeassistant/homeassistant/components/http/view.py", line 129, in handle result = await result File "/usr/src/homeassistant/homeassistant/components/config/config_entries.py", line 169, in post return await super().post(request, flow_id) File "/usr/src/homeassistant/homeassistant/components/http/data_validator.py", line 60, in wrapper result = await method(view, request, *args, **kwargs) File "/usr/src/homeassistant/homeassistant/helpers/data_entry_flow.py", line 106, in post result = await self._flow_mgr.async_configure(flow_id, data) File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 155, in async_configure result = await self._async_handle_step(flow, cur_step["step_id"], user_input) File "/usr/src/homeassistant/homeassistant/data_entry_flow.py", line 213, in _async_handle_step result: Dict = await getattr(flow, method)(user_input) File "/config/custom_components/cozytouch/config_flow.py", line 55, in async_step_user await async_connect(user_input) File "/config/custom_components/cozytouch/init.py", line 137, in async_connect return await cozytouch.get_setup() File "/usr/local/lib/python3.8/site-packages/cozytouchpy/client.py", line 136, in get_setup return SetupHandler(response_json, self) File "/usr/local/lib/python3.8/site-packages/cozytouchpy/handlers.py", line 44, in init self.__build_devices(data["devices"]) File "/usr/local/lib/python3.8/site-packages/cozytouchpy/handlers.py", line 71, in build_devices cozyouch_device = DevicesHandler.build( File "/usr/local/lib/python3.8/site-packages/cozytouchpy/handlers.py", line 201, in build device = CozytouchPod(data) File "/usr/local/lib/python3.8/site-packages/cozytouchpy/objects/device.py", line 19, in init__ self.states = data["states"] KeyError: 'states'

barsurfer commented 3 years ago

@Cyr-ius I have the same issue as @ALERTua and @alanscorp with the KeyError: 'states'

barsurfer commented 3 years ago

@Cyr-ius If this helps in any way - the data object seems to be like:

{
   "creationTime":1606403967000,
   "lastUpdateTime":1606403967000,
   "label":"INTERNAL (uPod/0)",
   "deviceURL":"internal://1111-1111-1111/uPod/0",
   "shortcut":false,
   "controllableName":"internal:UPodComponent",
   "definition":{
      "commands":[

      ],
      "states":[

      ],
      "dataProperties":[

      ],
      "widgetName":"Pod",
      "uiClass":"Pod",
      "qualifiedName":"internal:UPodComponent",
      "type":"ACTUATOR"
   },
   "available":true,
   "enabled":true,
   "placeOID":"e8272387-e0a8-417b-aa7c-cab5cd846f23",
   "widget":"Pod",
   "type":1,
   "oid":"eab924f1-7f3e-4a0a-bd4f-ebd7e5e2bfcd",
   "uiClass":"Pod"
}

and the appliance I have is Steatite Cube WI-FI VM 100 S4CW. Changing it to data.get will produce the following errir on the UI:

image

Can't say I see anything suspicious on the log. Hopefully, this will help.

UPD: After making data.get and then re-installation through HACS seems like I was able to make it work:

image

UPD2: Still see not too much under the device, so not sure how to use it. Just those to:

image image

The entity seems to be unavailable:

image

And having this in the logs (related to my change, probably):

Traceback (most recent call last):
  File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/helpers/entity_platform.py", line 316, in async_add_entities
    await asyncio.gather(*tasks)
  File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/helpers/entity_platform.py", line 507, in _async_add_entity
    await entity.add_to_platform_finish()
  File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/helpers/entity.py", line 531, in add_to_platform_finish
    self.async_write_ha_state()
  File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/helpers/entity.py", line 296, in async_write_ha_state
    self._async_write_ha_state()
  File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/helpers/entity.py", line 320, in _async_write_ha_state
    sstate = self.state
  File "/srv/homeassistant/lib/python3.7/site-packages/homeassistant/components/water_heater/__init__.py", line 137, in state
    return self.current_operation
  File "/home/homeassistant/.homeassistant/custom_components/cozytouch/water_heater.py", line 174, in current_operation
    return self.COZY_TO_HASS_STATE[self.water_heater.operating_mode]
KeyError: None

So an assumption here is that states should be retrieved in some other way for this water heater.

YomoShitsu commented 2 years ago

Hello, Do you have any news ? I have the same issue since username login is email. Thx

iMicknl commented 2 years ago

Fixed in latest version of https://github.com/iMicknl/ha-tahoma. Someone could port the changes required to this integration as well. (or you could use the general Overkiz integration from my link).

romain3w commented 2 years ago

Hello, I can't logging too... note : it's not Atlantic Cozytouch but Sauter Cozytouch, any incidence ?

YomoShitsu commented 2 years ago

Sorry but this integration never works for me... But with overkiz integration it works perfectly