alryaz / hass-moscow-pgu

Moscow PGU services for HomeAssistant
20 stars 2 forks source link

Не работает передача показаний воды #14

Open Spirituss opened 2 years ago

Spirituss commented 2 years ago

Ошибки при передаче через сервис :

2021-11-21 00:47:44 ERROR (MainThread) [homeassistant.components.script.water_meter_push_indications] Передача отчета о расходе воды (скрипт): Error executing script. Unexpected error for call_service at pos 1: Cannot connect to host emp.mos.ru:443 ssl:default [Connection reset by peer]
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 969, in _wrap_create_connection
    return await self._loop.create_connection(*args, **kwargs)  # type: ignore  # noqa
  File "/usr/local/lib/python3.9/asyncio/base_events.py", line 1081, in create_connection
    transport, protocol = await self._create_connection_transport(
  File "/usr/local/lib/python3.9/asyncio/base_events.py", line 1111, in _create_connection_transport
    await waiter
  File "/usr/local/lib/python3.9/asyncio/selector_events.py", line 856, in _read_ready__data_received
    data = self._sock.recv(self.max_size)
ConnectionResetError: [Errno 104] Connection reset by peer

The above exception was the direct cause of the following exception:
elf._coro
  File "/usr/local/lib/python3.9/site-packages/aiohttp/client.py", line 520, in _request
    conn = await self._connector.connect(
  File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 535, in connect
    proto = await self._create_connection(req, traces, timeout)
  File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 892, in _create_connection
    _, proto = await self._create_direct_connection(req, traces, timeout)
  File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 1051, in _create_direct_connection
    raise last_exc
  File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 1020, in _create_direct_connection
    transp, proto = await self._wrap_create_connection(
  File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 975, in _wrap_create_connection
    raise client_error(req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host emp.mos.ru:443 ssl:default [Connection reset by peer]

2021-11-21 00:48:51 ERROR (MainThread) [homeassistant.components.websocket_api.http.connection] [140496523328720] Error handling message: Unknown error
Traceback (most recent call last):
  File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 969, in _wrap_create_connection
    return await self._loop.create_connection(*args, **kwargs)  # type: ignore  # noqa
  File "/usr/local/lib/python3.9/asyncio/base_events.py", line 1081, in create_connection
    transport, protocol = await self._create_connection_transport(
  File "/usr/local/lib/python3.9/asyncio/base_events.py", line 1111, in _create_connection_transport
    await waiter
  File "/usr/local/lib/python3.9/asyncio/selector_events.py", line 856, in _read_ready__data_received
    data = self._sock.recv(self.max_size)
ConnectionResetError: [Errno 104] Connection reset by peer

The above exception was the direct cause of the following exception:
water_counter_indication
    return await self.api.push_water_counter_indication(self.flat_id, self.id, indication)
  File "/config/custom_components/moscow_pgu/api.py", line 505, in push_water_counter_indication
    return await self.push_water_counter_indications(flat_id, {counter_id: indication})
  File "/config/custom_components/moscow_pgu/api.py", line 489, in push_water_counter_indications
    await self.uncached_request(
  File "/config/custom_components/moscow_pgu/api.py", line 227, in uncached_request
    async with self.client_session.post(
  File "/usr/local/lib/python3.9/site-packages/aiohttp/client.py", line 1117, in aenter
    self._resp = await self._coro
  File "/usr/local/lib/python3.9/site-packages/aiohttp/client.py", line 520, in _request
    conn = await self._connector.connect(
  File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 535, in connect
    proto = await self._create_connection(req, traces, timeout)
  File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 892, in _create_connection
    _, proto = await self._create_direct_connection(req, traces, timeout)
  File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 1051, in _create_direct_connection
    raise last_exc
  File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 1020, in _create_direct_connection
    transp, proto = await self._wrap_create_connection(
  File "/usr/local/lib/python3.9/site-packages/aiohttp/connector.py", line 975, in _wrap_create_connection
    raise client_error(req.connection_key, exc) from exc
aiohttp.client_exceptions.ClientConnectorError: Cannot connect to host emp.mos.ru:443 ssl:default [Connection reset by peer]
Spirituss commented 2 years ago

Передача в декабре удалась, но событие успешной передачи не сработало. Код такой:

    trigger:
      - platform: event
        event_type: moscow_pgu_water_indications_push       
    condition:
      - condition: template
        value_template: "{{ trigger.event.data.success == 'on' }}"
...
Spirituss commented 2 years ago

@alryaz передача работает, но события так и нет. Либо название события отличается от документации, либо оно не генерится.