denysdovhan / ha-yasno-outages

⚡️ Yasno electricity outages (due to war in Ukraine) integration for Home Assistant.
MIT License
88 stars 12 forks source link

feat/daily events #32

Open tarik02 opened 6 days ago

tarik02 commented 6 days ago

closes #31

ALERTua commented 4 days ago

@denysdovhan Можу підтвердити, що із цими змінами календар для моєї групи містить актуальні дані: сьогодні відключень не було, завтра їх не буде, а на післязавтра актуальний календар інформації не має, тому бере за основу прогноз. Як і повинно бути.

ALERTua commented 4 days ago

Київ, третя група.

2024-11-25 13:26:14.890 DEBUG (MainThread) [custom_components.yasno_outages.calendar] Getting current event for 2024-11-25 13:26:14.890417+02:00
2024-11-25 13:26:14.890 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved (None)
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 266, in _handle_refresh_interval
    await self._async_refresh(log_failures=True, scheduled=True)
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 481, in _async_refresh
    self.async_update_listeners()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 176, in async_update_listeners
    update_callback()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 561, in _handle_coordinator_update
    self.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/components/calendar/__init__.py", line 541, in async_write_ha_state
    super().async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1007, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1132, in _async_write_ha_state
    self.__async_calculate_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1069, in __async_calculate_state
    state = self._stringify_state(available)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1013, in _stringify_state
    if (state := self.state) is None:
                 ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/calendar/__init__.py", line 524, in state
    if (event := self.event) is None:
                 ^^^^^^^^^^
  File "/config/custom_components/yasno_outages/calendar.py", line 55, in event
    return self.coordinator.get_event_at(now)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/yasno_outages/coordinator.py", line 160, in get_event_at
    event = self.api.get_current_event(at)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/yasno_outages/api.py", line 95, in get_current_event
    for event in self.gen_events(at, at + datetime.timedelta(days=1)):
  File "/config/custom_components/yasno_outages/api.py", line 202, in gen_events
    if last["summary"] != "none" and last["end"] > now and s >= start_date:
                                     ~~~~^^^^^^^
KeyError: 'end'
tarik02 commented 4 days ago

@ALERTua fixed

ardeus-ua commented 4 days ago

@ALERTua fixed

Київ 5

Traceback (most recent call last): File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 599, in _async_add_entities await coro File "/usr/src/homeassistant/homeassistant/helpers/entity_platform.py", line 918, in _async_add_entity await entity.add_to_platform_finish() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1368, in add_to_platform_finish self.async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1007, in async_write_ha_state self._async_write_ha_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1132, in _async_write_ha_state self.async_calculate_state() File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1069, in async_calculate_state state = self._stringify_state(available) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1013, in _stringify_state if (state := self.state) is None: ^^^^^^^^^^ File "/usr/src/homeassistant/homeassistant/components/sensor/init.py", line 544, in state value = self.native_value ^^^^^^^^^^^^^^^^^ File "/config/custom_components/yasno_outages/sensor.py", line 99, in native_value return self.entity_description.val_func(self.coordinator) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/yasno_outages/sensor.py", line 38, in val_func=lambda coordinator: coordinator.current_state, ^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/yasno_outages/coordinator.py", line 155, in current_state event = self.get_event_at(now) ^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/yasno_outages/coordinator.py", line 160, in get_event_at event = self.api.get_current_event(at) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/config/custom_components/yasno_outages/api.py", line 95, in get_current_event for event in self.gen_events(at, at + datetime.timedelta(days=1)): File "/config/custom_components/yasno_outages/api.py", line 202, in gen_events if last["summary"] != "none" and last["end"] > now and s >= start_date:


KeyError: 'end'
ardeus-ua commented 4 days ago

@tarik02 встановлював заміною одного файлу та перезавантаженням. Можливо потрібно щось ще замінити?

ALERTua commented 4 days ago

@ALERTua fixed

ага, підтягнув, тестую.

змінив групу туди-сюди. вилізла помилка із мінімальною тривалістю івента

2024-11-25 14:57:43.809 DEBUG (MainThread) [custom_components.yasno_outages.config_flow] User input: {'group': '3'}
2024-11-25 14:57:43.809 DEBUG (MainThread) [custom_components.yasno_outages.coordinator] Updating group from 1 -> 3
2024-11-25 14:57:43.944 DEBUG (MainThread) [custom_components.yasno_outages.coordinator] Finished fetching yasno_outages data in 0.135 seconds (success: True)
2024-11-25 14:57:43.944 DEBUG (MainThread) [custom_components.yasno_outages.calendar] Getting current event for 2024-11-25 14:57:43.944219+02:00
2024-11-25 14:57:43.944 DEBUG (MainThread) [custom_components.yasno_outages.calendar] Getting current event for 2024-11-25 14:57:43.944449+02:00
2024-11-25 14:57:43.944 DEBUG (MainThread) [custom_components.yasno_outages.calendar] Getting current event for 2024-11-25 14:57:43.944628+02:00
2024-11-25 14:57:43.945 DEBUG (MainThread) [custom_components.yasno_outages.coordinator] Transforming event: POSSIBLE_OUTAGE (2024-11-25 14:57:43.944930+02:00 -> 2024-11-25 00:00:00+02:00)
2024-11-25 14:57:43.945 ERROR (MainThread) [homeassistant] Error doing job: Task exception was never retrieved (None)
Traceback (most recent call last):
  File "/usr/local/lib/python3.12/site-packages/voluptuous/schema_builder.py", line 205, in __call__
    return self._compiled([], data)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/voluptuous/validators.py", line 256, in _run
    return self._exec(self._compiled, value, path)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/voluptuous/validators.py", line 386, in _exec
    raise e if self.msg is None else AllInvalid(self.msg, path=path)
  File "/usr/local/lib/python3.12/site-packages/voluptuous/validators.py", line 384, in _exec
    v = func(path, v)
        ^^^^^^^^^^^^^
  File "/usr/local/lib/python3.12/site-packages/voluptuous/schema_builder.py", line 779, in validate_callable
    return schema(data)
           ^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/calendar/__init__.py", line 148, in validate
    raise vol.Invalid(
voluptuous.error.Invalid: Expected minimum event duration of 0:00:00 (2024-11-25 14:57:43.944930+02:00, 2024-11-25 00:00:00+02:00)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/calendar/__init__.py", line 386, in __post_init__
    CALENDAR_EVENT_SCHEMA(dataclasses.asdict(self, dict_factory=skip_none))
  File "/usr/local/lib/python3.12/site-packages/voluptuous/schema_builder.py", line 209, in __call__
    raise er.MultipleInvalid([e])
voluptuous.error.MultipleInvalid: Expected minimum event duration of 0:00:00 (2024-11-25 14:57:43.944930+02:00, 2024-11-25 00:00:00+02:00)
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
  File "/config/custom_components/yasno_outages/coordinator.py", line 88, in update_config
    await self.async_refresh()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 358, in async_refresh
    await self._async_refresh(log_failures=True)
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 481, in _async_refresh
    self.async_update_listeners()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 176, in async_update_listeners
    update_callback()
  File "/usr/src/homeassistant/homeassistant/helpers/update_coordinator.py", line 561, in _handle_coordinator_update
    self.async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1007, in async_write_ha_state
    self._async_write_ha_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1132, in _async_write_ha_state
    self.__async_calculate_state()
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1069, in __async_calculate_state
    state = self._stringify_state(available)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/entity.py", line 1013, in _stringify_state
    if (state := self.state) is None:
                 ^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/sensor/__init__.py", line 544, in state
    value = self.native_value
            ^^^^^^^^^^^^^^^^^
  File "/config/custom_components/yasno_outages/sensor.py", line 99, in native_value
    return self.entity_description.val_func(self.coordinator)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/yasno_outages/sensor.py", line 45, in 
    val_func=lambda coordinator: coordinator.next_outage,
                                 ^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/yasno_outages/coordinator.py", line 127, in next_outage
    event = self._get_next_event_of_type(STATE_OFF)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/yasno_outages/coordinator.py", line 111, in _get_next_event_of_type
    self.get_events_between(
  File "/config/custom_components/yasno_outages/coordinator.py", line 173, in get_events_between
    self._get_calendar_event(event, translate=translate) for event in events
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/config/custom_components/yasno_outages/coordinator.py", line 198, in _get_calendar_event
    return CalendarEvent(
           ^^^^^^^^^^^^^^
  File "", line 11, in __init__
  File "/usr/src/homeassistant/homeassistant/components/calendar/__init__.py", line 388, in __post_init__
    raise HomeAssistantError(
homeassistant.exceptions.HomeAssistantError: Failed to validate CalendarEvent: Expected minimum event duration of 0:00:00 (2024-11-25 14:57:43.944930+02:00, 2024-11-25 00:00:00+02:00)
tarik02 commented 4 days ago

what about now?

ardeus-ua commented 4 days ago

what about now?

image

Works!

ALERTua commented 4 days ago

what about now?

працює. помилок поки немає. дивлюсь в логи, буду репортити.

ALERTua commented 3 days ago

не розумію POSSIBLE_OUTAGE 26 числа (вівторок) о другій ночі. цієї події немає в Ясно image

image

image

image

2024-11-25 15:57:14.920 DEBUG (MainThread) [custom_components.yasno_outages.coordinator] Finished fetching yasno_outages data in 0.132 seconds (success: True)
2024-11-25 15:57:14.920 DEBUG (MainThread) [custom_components.yasno_outages.calendar] Getting current event for 2024-11-25 15:57:14.920808+02:00
2024-11-25 15:57:14.921 DEBUG (MainThread) [custom_components.yasno_outages.calendar] Getting current event for 2024-11-25 15:57:14.921063+02:00
2024-11-25 15:57:14.921 DEBUG (MainThread) [custom_components.yasno_outages.calendar] Getting current event for 2024-11-25 15:57:14.921249+02:00
2024-11-25 15:57:14.921 DEBUG (MainThread) [custom_components.yasno_outages.coordinator] Transforming event: POSSIBLE_OUTAGE (2024-11-26 02:00:00+02:00 -> 2024-11-26 05:00:00+02:00)
2024-11-25 15:57:14.921 DEBUG (MainThread) [custom_components.yasno_outages.coordinator] Transforming event: DEFINITE_OUTAGE (2024-11-26 07:00:00+02:00 -> 2024-11-26 11:00:00+02:00)
2024-11-25 15:57:14.922 DEBUG (MainThread) [custom_components.yasno_outages.coordinator] Transforming event: POSSIBLE_OUTAGE (2024-11-26 11:00:00+02:00 -> 2024-11-26 14:00:00+02:00)
2024-11-25 15:57:14.922 DEBUG (MainThread) [custom_components.yasno_outages.coordinator] Next events: [CalendarEvent(start=datetime.datetime(2024, 11, 26, 2, 0, tzinfo=zoneinfo.ZoneInfo(key='Europe/Kiev')), end=datetime.datetime(2024, 11, 26, 5, 0, tzinfo=zoneinfo.ZoneInfo(key='Europe/Kiev')), summary='POSSIBLE_OUTAGE', description='POSSIBLE_OUTAGE', location=None, uid=None, recurrence_id=None, rrule=None), CalendarEvent(start=datetime.datetime(2024, 11, 26, 7, 0, tzinfo=zoneinfo.ZoneInfo(key='Europe/Kiev')), end=datetime.datetime(2024, 11, 26, 11, 0, tzinfo=zoneinfo.ZoneInfo(key='Europe/Kiev')), summary='DEFINITE_OUTAGE', description='DEFINITE_OUTAGE', location=None, uid=None, recurrence_id=None, rrule=None), CalendarEvent(start=datetime.datetime(2024, 11, 26, 11, 0, tzinfo=zoneinfo.ZoneInfo(key='Europe/Kiev')), end=datetime.datetime(2024, 11, 26, 14, 0, tzinfo=zoneinfo.ZoneInfo(key='Europe/Kiev')), summary='POSSIBLE_OUTAGE', description='POSSIBLE_OUTAGE', location=None, uid=None, recurrence_id=None, rrule=None)]
2024-11-25 15:57:14.922 DEBUG (MainThread) [custom_components.yasno_outages.coordinator] Next outage: CalendarEvent(start=datetime.datetime(2024, 11, 26, 7, 0, tzinfo=zoneinfo.ZoneInfo(key='Europe/Kiev')), end=datetime.datetime(2024, 11, 26, 11, 0, tzinfo=zoneinfo.ZoneInfo(key='Europe/Kiev')), summary='DEFINITE_OUTAGE', description='DEFINITE_OUTAGE', location=None, uid=None, recurrence_id=None, rrule=None)
2024-11-25 15:57:14.922 DEBUG (MainThread) [custom_components.yasno_outages.coordinator] Transforming event: POSSIBLE_OUTAGE (2024-11-26 02:00:00+02:00 -> 2024-11-26 05:00:00+02:00)
2024-11-25 15:57:14.922 DEBUG (MainThread) [custom_components.yasno_outages.coordinator] Transforming event: DEFINITE_OUTAGE (2024-11-26 07:00:00+02:00 -> 2024-11-26 11:00:00+02:00)
2024-11-25 15:57:14.923 DEBUG (MainThread) [custom_components.yasno_outages.coordinator] Next events: [CalendarEvent(start=datetime.datetime(2024, 11, 26, 2, 0, tzinfo=zoneinfo.ZoneInfo(key='Europe/Kiev')), end=datetime.datetime(2024, 11, 26, 5, 0, tzinfo=zoneinfo.ZoneInfo(key='Europe/Kiev')), summary='POSSIBLE_OUTAGE', description='POSSIBLE_OUTAGE', location=None, uid=None, recurrence_id=None, rrule=None), CalendarEvent(start=datetime.datetime(2024, 11, 26, 7, 0, tzinfo=zoneinfo.ZoneInfo(key='Europe/Kiev')), end=datetime.datetime(2024, 11, 26, 11, 0, tzinfo=zoneinfo.ZoneInfo(key='Europe/Kiev')), summary='DEFINITE_OUTAGE', description='DEFINITE_OUTAGE', location=None, uid=None, recurrence_id=None, rrule=None), CalendarEvent(start=datetime.datetime(2024, 11, 26, 11, 0, tzinfo=zoneinfo.ZoneInfo(key='Europe/Kiev')), end=datetime.datetime(2024, 11, 26, 14, 0, tzinfo=zoneinfo.ZoneInfo(key='Europe/Kiev')), summary='POSSIBLE_OUTAGE', description='POSSIBLE_OUTAGE', location=None, uid=None, recurrence_id=None, rrule=None)]
2024-11-25 15:57:14.923 DEBUG (MainThread) [custom_components.yasno_outages.coordinator] Next possible outage: CalendarEvent(start=datetime.datetime(2024, 11, 26, 2, 0, tzinfo=zoneinfo.ZoneInfo(key='Europe/Kiev')), end=datetime.datetime(2024, 11, 26, 5, 0, tzinfo=zoneinfo.ZoneInfo(key='Europe/Kiev')), summary='POSSIBLE_OUTAGE', description='POSSIBLE_OUTAGE', location=None, uid=None, recurrence_id=None, rrule=None)
2024-11-25 15:57:14.923 DEBUG (MainThread) [custom_components.yasno_outages.coordinator] Transforming event: POSSIBLE_OUTAGE (2024-11-26 02:00:00+02:00 -> 2024-11-26 05:00:00+02:00)
2024-11-25 15:57:14.923 DEBUG (MainThread) [custom_components.yasno_outages.coordinator] Transforming event: DEFINITE_OUTAGE (2024-11-26 07:00:00+02:00 -> 2024-11-26 11:00:00+02:00)
2024-11-25 15:57:14.923 DEBUG (MainThread) [custom_components.yasno_outages.coordinator] Transforming event: POSSIBLE_OUTAGE (2024-11-26 11:00:00+02:00 -> 2024-11-26 14:00:00+02:00)
2024-11-25 15:57:14.924 DEBUG (MainThread) [custom_components.yasno_outages.coordinator] Next connectivity: CalendarEvent(start=datetime.datetime(2024, 11, 26, 2, 0, tzinfo=zoneinfo.ZoneInfo(key='Europe/Kiev')), end=datetime.datetime(2024, 11, 26, 5, 0, tzinfo=zoneinfo.ZoneInfo(key='Europe/Kiev')), summary='POSSIBLE_OUTAGE', description='POSSIBLE_OUTAGE', location=None, uid=None, recurrence_id=None, rrule=None)
tarik02 commented 3 days ago

@ALERTua в ясно якраз таки є зображення

ALERTua commented 3 days ago

хз. ось генерований графік із додатку Київ Цифровий, де реально актуальні дані на наступні два дні, що і є новою фічою. і на ньому немає сірих зон https://kyiv.digital/storage/dtek/generated/schedule_3.pdf?v=1732466259

tarik02 commented 3 days ago

Та я знаю це, але ми парсимо сайт ясно і на сайті ясно воно так... + можеш глянути main в ha-hysno-outages - побачиш те ж саме

tarik02 commented 3 days ago

Є інакша опція - парсити pdf за посиланням яке ти скинув.

ALERTua commented 3 days ago

не маю гадки навіть, як розпарсити таблицю із pdf, але отой int в кінці — таймстемп дати генерації. приймає будь-який.

timestamp = int(pendulum.now(tz=pendulum.local_timezone()).timestamp())

https://{city}.digital/storage/dtek/generated/schedule_{group}.pdf?v={timestamp}
ardeus-ua commented 3 days ago

хз. ось генерований графік із додатку Київ Цифровий, де реально актуальні дані на наступні два дні, що і є новою фічою. і на ньому немає сірих зон https://kyiv.digital/storage/dtek/generated/schedule_3.pdf?v=1732466259

Підкажіть, часом не співпадає графік до кінця тижня з тим що було на минулому тижні? тоді це не прогноз а історичні дані і в принципі вони не актуальні на цей тиждень

infestonn commented 2 days ago

Is it possible to display the next day schedule with updated data(if it exists) from Yasno? The current day works good.

ALERTua commented 2 days ago

щось точно не так. третя група. зараз 10:52. світла немає з десяти. календар показує все згідно з Ясно: з 10 до 13 не буде світла. і це єдина подія за день. image сенсори показують що попало. типу електрика є, next restore неадекватний. next connectivity неадекватний. image

логи:

2024-11-27 10:56:00.444 DEBUG (MainThread) [custom_components.yasno_outages.config_flow] City selected: {'city': 'kiev'}
2024-11-27 10:56:00.444 DEBUG (MainThread) [custom_components.yasno_outages.config_flow] Getting kiev groups: dict_keys(['group_1', 'group_2', 'group_3', 'group_4', 'group_5', 'group_6'])
2024-11-27 10:56:02.856 DEBUG (MainThread) [custom_components.yasno_outages.config_flow] User input: {'group': '3'}
2024-11-27 10:56:02.856 INFO (MainThread) [custom_components.yasno_outages] Setup entry: <ConfigEntry entry_id=01JDPDBB18S55TJAB8RHN1KVWH version=1 domain=yasno_outages title=Yasno Outages state=ConfigEntryState.SETUP_IN_PROGRESS unique_id=None>
2024-11-27 10:56:02.994 DEBUG (MainThread) [custom_components.yasno_outages.coordinator] Finished fetching yasno_outages data in 0.137 seconds (success: True)
2024-11-27 10:56:02.994 DEBUG (MainThread) [custom_components.yasno_outages.calendar] Setup new entry: <ConfigEntry entry_id=01JDPDBB18S55TJAB8RHN1KVWH version=1 domain=yasno_outages title=Yasno Outages state=ConfigEntryState.SETUP_IN_PROGRESS unique_id=None>
2024-11-27 10:56:02.996 DEBUG (MainThread) [custom_components.yasno_outages.calendar] Getting current event for 2024-11-27 10:56:02.996281+02:00
2024-11-27 10:56:02.996 DEBUG (MainThread) [custom_components.yasno_outages.calendar] Getting current event for 2024-11-27 10:56:02.996622+02:00
2024-11-27 10:56:02.997 DEBUG (MainThread) [custom_components.yasno_outages.calendar] Getting current event for 2024-11-27 10:56:02.997041+02:00
2024-11-27 10:56:02.997 DEBUG (MainThread) [custom_components.yasno_outages.calendar] Getting current event for 2024-11-27 10:56:02.997334+02:00
2024-11-27 10:56:02.997 DEBUG (MainThread) [custom_components.yasno_outages.calendar] Getting current event for 2024-11-27 10:56:02.997610+02:00
2024-11-27 10:56:02.999 DEBUG (MainThread) [custom_components.yasno_outages.calendar] Getting current event for 2024-11-27 10:56:02.999037+02:00
2024-11-27 10:56:03.000 DEBUG (MainThread) [custom_components.yasno_outages.sensor] Setup new entry: <ConfigEntry entry_id=01JDPDBB18S55TJAB8RHN1KVWH version=1 domain=yasno_outages title=Yasno Outages state=ConfigEntryState.SETUP_IN_PROGRESS unique_id=None>
2024-11-27 10:56:03.006 DEBUG (MainThread) [custom_components.yasno_outages.coordinator] Transforming event: POSSIBLE_OUTAGE (2024-11-28 00:00:00+02:00 -> 2024-11-28 02:00:00+02:00)
2024-11-27 10:56:03.006 DEBUG (MainThread) [custom_components.yasno_outages.coordinator] Transforming event: DEFINITE_OUTAGE (2024-11-28 04:00:00+02:00 -> 2024-11-28 08:00:00+02:00)
2024-11-27 10:56:03.007 DEBUG (MainThread) [custom_components.yasno_outages.coordinator] Transforming event: POSSIBLE_OUTAGE (2024-11-28 08:00:00+02:00 -> 2024-11-28 11:00:00+02:00)
2024-11-27 10:56:03.007 DEBUG (MainThread) [custom_components.yasno_outages.coordinator] Next events: [CalendarEvent(start=datetime.datetime(2024, 11, 28, 0, 0, tzinfo=zoneinfo.ZoneInfo(key='Europe/Kiev')), end=datetime.datetime(2024, 11, 28, 2, 0, tzinfo=zoneinfo.ZoneInfo(key='Europe/Kiev')), summary='POSSIBLE_OUTAGE', description='POSSIBLE_OUTAGE', location=None, uid=None, recurrence_id=None, rrule=None), CalendarEvent(start=datetime.datetime(2024, 11, 28, 4, 0, tzinfo=zoneinfo.ZoneInfo(key='Europe/Kiev')), end=datetime.datetime(2024, 11, 28, 8, 0, tzinfo=zoneinfo.ZoneInfo(key='Europe/Kiev')), summary='DEFINITE_OUTAGE', description='DEFINITE_OUTAGE', location=None, uid=None, recurrence_id=None, rrule=None), CalendarEvent(start=datetime.datetime(2024, 11, 28, 8, 0, tzinfo=zoneinfo.ZoneInfo(key='Europe/Kiev')), end=datetime.datetime(2024, 11, 28, 11, 0, tzinfo=zoneinfo.ZoneInfo(key='Europe/Kiev')), summary='POSSIBLE_OUTAGE', description='POSSIBLE_OUTAGE', location=None, uid=None, recurrence_id=None, rrule=None)]
2024-11-27 10:56:03.007 DEBUG (MainThread) [custom_components.yasno_outages.coordinator] Next outage: CalendarEvent(start=datetime.datetime(2024, 11, 28, 4, 0, tzinfo=zoneinfo.ZoneInfo(key='Europe/Kiev')), end=datetime.datetime(2024, 11, 28, 8, 0, tzinfo=zoneinfo.ZoneInfo(key='Europe/Kiev')), summary='DEFINITE_OUTAGE', description='DEFINITE_OUTAGE', location=None, uid=None, recurrence_id=None, rrule=None)
2024-11-27 10:56:03.007 DEBUG (MainThread) [custom_components.yasno_outages.coordinator] Transforming event: POSSIBLE_OUTAGE (2024-11-28 00:00:00+02:00 -> 2024-11-28 02:00:00+02:00)
2024-11-27 10:56:03.008 DEBUG (MainThread) [custom_components.yasno_outages.coordinator] Transforming event: DEFINITE_OUTAGE (2024-11-28 04:00:00+02:00 -> 2024-11-28 08:00:00+02:00)
2024-11-27 10:56:03.008 DEBUG (MainThread) [custom_components.yasno_outages.coordinator] Transforming event: POSSIBLE_OUTAGE (2024-11-28 08:00:00+02:00 -> 2024-11-28 11:00:00+02:00)
2024-11-27 10:56:03.008 DEBUG (MainThread) [custom_components.yasno_outages.coordinator] Next events: [CalendarEvent(start=datetime.datetime(2024, 11, 28, 0, 0, tzinfo=zoneinfo.ZoneInfo(key='Europe/Kiev')), end=datetime.datetime(2024, 11, 28, 2, 0, tzinfo=zoneinfo.ZoneInfo(key='Europe/Kiev')), summary='POSSIBLE_OUTAGE', description='POSSIBLE_OUTAGE', location=None, uid=None, recurrence_id=None, rrule=None), CalendarEvent(start=datetime.datetime(2024, 11, 28, 4, 0, tzinfo=zoneinfo.ZoneInfo(key='Europe/Kiev')), end=datetime.datetime(2024, 11, 28, 8, 0, tzinfo=zoneinfo.ZoneInfo(key='Europe/Kiev')), summary='DEFINITE_OUTAGE', description='DEFINITE_OUTAGE', location=None, uid=None, recurrence_id=None, rrule=None), CalendarEvent(start=datetime.datetime(2024, 11, 28, 8, 0, tzinfo=zoneinfo.ZoneInfo(key='Europe/Kiev')), end=datetime.datetime(2024, 11, 28, 11, 0, tzinfo=zoneinfo.ZoneInfo(key='Europe/Kiev')), summary='POSSIBLE_OUTAGE', description='POSSIBLE_OUTAGE', location=None, uid=None, recurrence_id=None, rrule=None)]
2024-11-27 10:56:03.008 DEBUG (MainThread) [custom_components.yasno_outages.coordinator] Next outage: CalendarEvent(start=datetime.datetime(2024, 11, 28, 4, 0, tzinfo=zoneinfo.ZoneInfo(key='Europe/Kiev')), end=datetime.datetime(2024, 11, 28, 8, 0, tzinfo=zoneinfo.ZoneInfo(key='Europe/Kiev')), summary='DEFINITE_OUTAGE', description='DEFINITE_OUTAGE', location=None, uid=None, recurrence_id=None, rrule=None)
2024-11-27 10:56:03.013 DEBUG (MainThread) [custom_components.yasno_outages.coordinator] Transforming event: POSSIBLE_OUTAGE (2024-11-28 00:00:00+02:00 -> 2024-11-28 02:00:00+02:00)
2024-11-27 10:56:03.013 DEBUG (MainThread) [custom_components.yasno_outages.coordinator] Transforming event: DEFINITE_OUTAGE (2024-11-28 04:00:00+02:00 -> 2024-11-28 08:00:00+02:00)
2024-11-27 10:56:03.014 DEBUG (MainThread) [custom_components.yasno_outages.coordinator] Transforming event: POSSIBLE_OUTAGE (2024-11-28 08:00:00+02:00 -> 2024-11-28 11:00:00+02:00)
2024-11-27 10:56:03.014 DEBUG (MainThread) [custom_components.yasno_outages.coordinator] Next events: [CalendarEvent(start=datetime.datetime(2024, 11, 28, 0, 0, tzinfo=zoneinfo.ZoneInfo(key='Europe/Kiev')), end=datetime.datetime(2024, 11, 28, 2, 0, tzinfo=zoneinfo.ZoneInfo(key='Europe/Kiev')), summary='POSSIBLE_OUTAGE', description='POSSIBLE_OUTAGE', location=None, uid=None, recurrence_id=None, rrule=None), CalendarEvent(start=datetime.datetime(2024, 11, 28, 4, 0, tzinfo=zoneinfo.ZoneInfo(key='Europe/Kiev')), end=datetime.datetime(2024, 11, 28, 8, 0, tzinfo=zoneinfo.ZoneInfo(key='Europe/Kiev')), summary='DEFINITE_OUTAGE', description='DEFINITE_OUTAGE', location=None, uid=None, recurrence_id=None, rrule=None), CalendarEvent(start=datetime.datetime(2024, 11, 28, 8, 0, tzinfo=zoneinfo.ZoneInfo(key='Europe/Kiev')), end=datetime.datetime(2024, 11, 28, 11, 0, tzinfo=zoneinfo.ZoneInfo(key='Europe/Kiev')), summary='POSSIBLE_OUTAGE', description='POSSIBLE_OUTAGE', location=None, uid=None, recurrence_id=None, rrule=None)]
2024-11-27 10:56:03.014 DEBUG (MainThread) [custom_components.yasno_outages.coordinator] Next possible outage: CalendarEvent(start=datetime.datetime(2024, 11, 28, 0, 0, tzinfo=zoneinfo.ZoneInfo(key='Europe/Kiev')), end=datetime.datetime(2024, 11, 28, 2, 0, tzinfo=zoneinfo.ZoneInfo(key='Europe/Kiev')), summary='POSSIBLE_OUTAGE', description='POSSIBLE_OUTAGE', location=None, uid=None, recurrence_id=None, rrule=None)
2024-11-27 10:56:03.014 DEBUG (MainThread) [custom_components.yasno_outages.coordinator] Transforming event: POSSIBLE_OUTAGE (2024-11-28 00:00:00+02:00 -> 2024-11-28 02:00:00+02:00)
2024-11-27 10:56:03.014 DEBUG (MainThread) [custom_components.yasno_outages.coordinator] Transforming event: DEFINITE_OUTAGE (2024-11-28 04:00:00+02:00 -> 2024-11-28 08:00:00+02:00)
2024-11-27 10:56:03.015 DEBUG (MainThread) [custom_components.yasno_outages.coordinator] Transforming event: POSSIBLE_OUTAGE (2024-11-28 08:00:00+02:00 -> 2024-11-28 11:00:00+02:00)
2024-11-27 10:56:03.015 DEBUG (MainThread) [custom_components.yasno_outages.coordinator] Next events: [CalendarEvent(start=datetime.datetime(2024, 11, 28, 0, 0, tzinfo=zoneinfo.ZoneInfo(key='Europe/Kiev')), end=datetime.datetime(2024, 11, 28, 2, 0, tzinfo=zoneinfo.ZoneInfo(key='Europe/Kiev')), summary='POSSIBLE_OUTAGE', description='POSSIBLE_OUTAGE', location=None, uid=None, recurrence_id=None, rrule=None), CalendarEvent(start=datetime.datetime(2024, 11, 28, 4, 0, tzinfo=zoneinfo.ZoneInfo(key='Europe/Kiev')), end=datetime.datetime(2024, 11, 28, 8, 0, tzinfo=zoneinfo.ZoneInfo(key='Europe/Kiev')), summary='DEFINITE_OUTAGE', description='DEFINITE_OUTAGE', location=None, uid=None, recurrence_id=None, rrule=None), CalendarEvent(start=datetime.datetime(2024, 11, 28, 8, 0, tzinfo=zoneinfo.ZoneInfo(key='Europe/Kiev')), end=datetime.datetime(2024, 11, 28, 11, 0, tzinfo=zoneinfo.ZoneInfo(key='Europe/Kiev')), summary='POSSIBLE_OUTAGE', description='POSSIBLE_OUTAGE', location=None, uid=None, recurrence_id=None, rrule=None)]
2024-11-27 10:56:03.015 DEBUG (MainThread) [custom_components.yasno_outages.coordinator] Next possible outage: CalendarEvent(start=datetime.datetime(2024, 11, 28, 0, 0, tzinfo=zoneinfo.ZoneInfo(key='Europe/Kiev')), end=datetime.datetime(2024, 11, 28, 2, 0, tzinfo=zoneinfo.ZoneInfo(key='Europe/Kiev')), summary='POSSIBLE_OUTAGE', description='POSSIBLE_OUTAGE', location=None, uid=None, recurrence_id=None, rrule=None)
2024-11-27 10:56:03.019 DEBUG (MainThread) [custom_components.yasno_outages.coordinator] Transforming event: POSSIBLE_OUTAGE (2024-11-28 00:00:00+02:00 -> 2024-11-28 02:00:00+02:00)
2024-11-27 10:56:03.020 DEBUG (MainThread) [custom_components.yasno_outages.coordinator] Transforming event: DEFINITE_OUTAGE (2024-11-28 04:00:00+02:00 -> 2024-11-28 08:00:00+02:00)
2024-11-27 10:56:03.020 DEBUG (MainThread) [custom_components.yasno_outages.coordinator] Transforming event: POSSIBLE_OUTAGE (2024-11-28 08:00:00+02:00 -> 2024-11-28 11:00:00+02:00)
2024-11-27 10:56:03.020 DEBUG (MainThread) [custom_components.yasno_outages.coordinator] Next events: [CalendarEvent(start=datetime.datetime(2024, 11, 28, 0, 0, tzinfo=zoneinfo.ZoneInfo(key='Europe/Kiev')), end=datetime.datetime(2024, 11, 28, 2, 0, tzinfo=zoneinfo.ZoneInfo(key='Europe/Kiev')), summary='POSSIBLE_OUTAGE', description='POSSIBLE_OUTAGE', location=None, uid=None, recurrence_id=None, rrule=None), CalendarEvent(start=datetime.datetime(2024, 11, 28, 4, 0, tzinfo=zoneinfo.ZoneInfo(key='Europe/Kiev')), end=datetime.datetime(2024, 11, 28, 8, 0, tzinfo=zoneinfo.ZoneInfo(key='Europe/Kiev')), summary='DEFINITE_OUTAGE', description='DEFINITE_OUTAGE', location=None, uid=None, recurrence_id=None, rrule=None), CalendarEvent(start=datetime.datetime(2024, 11, 28, 8, 0, tzinfo=zoneinfo.ZoneInfo(key='Europe/Kiev')), end=datetime.datetime(2024, 11, 28, 11, 0, tzinfo=zoneinfo.ZoneInfo(key='Europe/Kiev')), summary='POSSIBLE_OUTAGE', description='POSSIBLE_OUTAGE', location=None, uid=None, recurrence_id=None, rrule=None)]
2024-11-27 10:56:03.020 DEBUG (MainThread) [custom_components.yasno_outages.coordinator] Next connectivity: CalendarEvent(start=datetime.datetime(2024, 11, 28, 0, 0, tzinfo=zoneinfo.ZoneInfo(key='Europe/Kiev')), end=datetime.datetime(2024, 11, 28, 2, 0, tzinfo=zoneinfo.ZoneInfo(key='Europe/Kiev')), summary='POSSIBLE_OUTAGE', description='POSSIBLE_OUTAGE', location=None, uid=None, recurrence_id=None, rrule=None)
2024-11-27 10:56:03.021 DEBUG (MainThread) [custom_components.yasno_outages.coordinator] Transforming event: POSSIBLE_OUTAGE (2024-11-28 00:00:00+02:00 -> 2024-11-28 02:00:00+02:00)
2024-11-27 10:56:03.021 DEBUG (MainThread) [custom_components.yasno_outages.coordinator] Transforming event: DEFINITE_OUTAGE (2024-11-28 04:00:00+02:00 -> 2024-11-28 08:00:00+02:00)
2024-11-27 10:56:03.021 DEBUG (MainThread) [custom_components.yasno_outages.coordinator] Transforming event: POSSIBLE_OUTAGE (2024-11-28 08:00:00+02:00 -> 2024-11-28 11:00:00+02:00)
2024-11-27 10:56:03.021 DEBUG (MainThread) [custom_components.yasno_outages.coordinator] Next events: [CalendarEvent(start=datetime.datetime(2024, 11, 28, 0, 0, tzinfo=zoneinfo.ZoneInfo(key='Europe/Kiev')), end=datetime.datetime(2024, 11, 28, 2, 0, tzinfo=zoneinfo.ZoneInfo(key='Europe/Kiev')), summary='POSSIBLE_OUTAGE', description='POSSIBLE_OUTAGE', location=None, uid=None, recurrence_id=None, rrule=None), CalendarEvent(start=datetime.datetime(2024, 11, 28, 4, 0, tzinfo=zoneinfo.ZoneInfo(key='Europe/Kiev')), end=datetime.datetime(2024, 11, 28, 8, 0, tzinfo=zoneinfo.ZoneInfo(key='Europe/Kiev')), summary='DEFINITE_OUTAGE', description='DEFINITE_OUTAGE', location=None, uid=None, recurrence_id=None, rrule=None), CalendarEvent(start=datetime.datetime(2024, 11, 28, 8, 0, tzinfo=zoneinfo.ZoneInfo(key='Europe/Kiev')), end=datetime.datetime(2024, 11, 28, 11, 0, tzinfo=zoneinfo.ZoneInfo(key='Europe/Kiev')), summary='POSSIBLE_OUTAGE', description='POSSIBLE_OUTAGE', location=None, uid=None, recurrence_id=None, rrule=None)]
2024-11-27 10:56:03.021 DEBUG (MainThread) [custom_components.yasno_outages.coordinator] Next connectivity: CalendarEvent(start=datetime.datetime(2024, 11, 28, 0, 0, tzinfo=zoneinfo.ZoneInfo(key='Europe/Kiev')), end=datetime.datetime(2024, 11, 28, 2, 0, tzinfo=zoneinfo.ZoneInfo(key='Europe/Kiev')), summary='POSSIBLE_OUTAGE', description='POSSIBLE_OUTAGE', location=None, uid=None, recurrence_id=None, rrule=None)
arthur-kalmykov commented 2 days ago

все згідно з Ясно: з 10 до 13 не буде світла.

Але і в 3й групі до 14 відключення

andrewjswan commented 2 days ago

image

ALERTua commented 2 days ago

8a5d442 10-14 fixed next connectivity fixed current outage fixed. дуже дякую! від мене поки багів немає. дивлюсь далі. (@denysdovhan це вже можна мерджити, як на мене)

tarik02 commented 2 days ago

@denysdovhan мерж попрошу зробити зі squash або пінганути мене щоб я зробив це вручну

ALERTua commented 2 days ago

все згідно з Ясно: з 10 до 13 не буде світла.

Але і в 3й групі до 14 відключення

так, але завжди (і зараз теж. тільки що прийшла нотифікація) вмикають на початку останнього відрізку, а не на його кінці.

tarik02 commented 2 days ago

так, але завжди (і зараз теж. тільки що прийшла нотифікація) вмикають на початку останнього відрізку, а не на його кінці.

ну це так щастить, 3тя група і ще не включили, а вже 13:11 на графіку година чорного кольору - світла немає

andrewjswan commented 1 day ago

Хто-небудь знає коли буде merge (якщо буде), або fork відразу ставити і не морочаться?

ardeus-ua commented 1 day ago

Хто-небудь знає коли буде merge (якщо буде), або fork відразу ставити і не морочаться?

та замініть два файли і перезавантажте ХА, а коли буде мерж то оновите і все

andrewjswan commented 1 day ago

та замініть два файли і перезавантажте ХА, а коли буде мерж то оновите і все

Це зрозуміло, як світло дадуть, так і поставлю та заміню, але раптом merge буде раніше ніж дадуть світло:) тоді і присідати не треба.

ALERTua commented 1 hour ago

мені все ж подобалося, коли естімація відновлення була на мінус годину від реального графіку, бо це співпадає із реальністю image я розумію, що графіки Ясно відображають відключення типу до кінця години, але я думаю, що це спеціально зроблено, щоб не було скарг щодо "не увімкнули чітко в 00 хвилин", а зате типу увімкнули раніше на годину. але завжди в голові "якщо пишуть, що до 14 — увімкнуть о 13.", і кожен раз о 12.30 приходить сповіщення, що через пів години увімкнуть. я не бачу сенсу орієнтуватися на ці 14, бо вони хибні.

andrewjswan commented 51 minutes ago

розумію, що графіки Ясно відображають відключення типу до кінця години, але я думаю, що це спеціально зроблено

Не знаю як у вас, але у мене, у батьків, на роботі, частіше навпаки, Ясно написав до 12:00 немає світла, ось о 12 чи о 12:30 він і з'явиться. Групи 3 і 6. Вважаю якщо це графіки відключень, то нехай вони будуть такими як їх публікує Ясно, а в НА, можна хоч шаблоном зробити коригування. Ну або взагалі зробити різницю між реальністю та графіком, автоматично її підраховувати та вносити коригування.