Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Не устанавливается расширение YandexWeather #97

Closed
4 tasks done
MaxFixx opened this issue Jan 28, 2024 · 10 comments
Closed
4 tasks done
Labels
Home Assistant Home Assistant related issues need more info Further information is requested

Comments

@MaxFixx
Copy link

MaxFixx commented Jan 28, 2024

В чем проблема?

Установил HACS - Версия интеграции1.34.0. Далее выбрал YandexWeather и после скачивания появилась служба YandexUpdate. Больше ничего. Скачивание и копирование файлов интеграции в ручную не принесло результата.

При использовании какой версии интеграции возникает проблема?

v3.1.2

Какая версия Home Assistant используется?

2024.1.5

Какой способ установки Home Assistant используется?

Home Assistant OS

Самопроверка по созданию ключа

  • при добавлении ключа в кабинете разработчика он добавлялся как "тестовый"
  • тип ключа в кабинете разработчика был изменен на "погода для сайта"
  • после изменения типа ключа прошло не менее 20 минут
  • в кабинете разработчка я вижу что с запросы делаются именно с этим ключом

Есть что-нибудь полезное в логе?

No response

Дополнительная информация

No response

@IATkachenko IATkachenko added the Home Assistant Home Assistant related issues label Jan 30, 2024
@IATkachenko
Copy link
Owner

IATkachenko commented Jan 30, 2024

Доброго дня,

а можно лог загрузки HA посмотреть? (вы же его перезапускали после установки интеграции?)

@IATkachenko IATkachenko added the need more info Further information is requested label Jan 30, 2024
@MaxFixx
Copy link
Author

MaxFixx commented Jan 30, 2024

2024-01-30 22:26:28.543 WARNING (SyncWorker_2) [homeassistant.loader] We found a custom integration hacs which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2024-01-30 22:26:28.543 WARNING (SyncWorker_2) [homeassistant.loader] We found a custom integration yandex_weather which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant
2024-01-30 22:27:03.116 ERROR (MainThread) [homeassistant.helpers.event] Error while processing template: Template<template=({{ as_timestamp(states('sensor.date_time_iso')) | timestamp_custom('%d.%m.%Y') }}) renders=2>
Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 1820, in forgiving_as_timestamp
    return dt_util.as_timestamp(value)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/util/dt.py", line 132, in as_timestamp
    raise ValueError("not a valid date/time.")
ValueError: not a valid date/time.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 567, in async_render
    render_result = _render_with_context(self.template, compiled, **kwargs)
                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 2305, in _render_with_context
    return template.render(**kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/jinja2/environment.py", line 1301, in render
    self.environment.handle_exception()
  File "/usr/local/lib/python3.11/site-packages/jinja2/environment.py", line 936, in handle_exception
    raise rewrite_traceback_stack(source=source)
  File "<template>", line 1, in top-level template code
  File "/usr/local/lib/python3.11/site-packages/jinja2/sandbox.py", line 393, in call
    return __context.call(__obj, *args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 1823, in forgiving_as_timestamp
    raise_no_default("as_timestamp", value)
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 1625, in raise_no_default
    raise ValueError(
ValueError: Template error: as_timestamp got invalid input 'unknown' when rendering template '{{ as_timestamp(states('sensor.date_time_iso')) | timestamp_custom('%d.%m.%Y') }}' but no default was specified

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 693, in async_render_to_info
    render_info._result = self.async_render(
                          ^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/helpers/template.py", line 569, in async_render
    raise TemplateError(err) from err
homeassistant.exceptions.TemplateError: ValueError: Template error: as_timestamp got invalid input 'unknown' when rendering template '{{ as_timestamp(states('sensor.date_time_iso')) | timestamp_custom('%d.%m.%Y') }}' but no default was specified
2024-01-30 22:27:03.119 ERROR (MainThread) [homeassistant.components.template.template_entity] TemplateError('ValueError: Template error: as_timestamp got invalid input 'unknown' when rendering template '{{ as_timestamp(states('sensor.date_time_iso')) | timestamp_custom('%d.%m.%Y') }}' but no default was specified') while processing template 'Template<template=({{ as_timestamp(states('sensor.date_time_iso')) | timestamp_custom('%d.%m.%Y') }}) renders=4>' for attribute '_attr_native_value' in entity 'sensor.date_formatted'
2024-01-30 22:27:03.133 ERROR (MainThread) [homeassistant.components.automation.qwe] Error setting up trigger qwe
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/site-packages/voluptuous/schema_builder.py", line 272, in __call__
    return self._compiled([], data)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/voluptuous/schema_builder.py", line 818, in validate_callable
    return schema(data)
           ^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/homeassistant/triggers/numeric_state.py", line 43, in validate_above_below
    raise vol.Invalid(
voluptuous.error.Invalid: A value can never be above 50.0 and below 40.0 at the same time. You probably want two different triggers.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/src/homeassistant/homeassistant/components/device_automation/trigger.py", line 64, in async_attach_trigger
    return await platform.async_attach_trigger(hass, config, action, trigger_info)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/sensor/device_trigger.py", line 222, in async_attach_trigger
    numeric_state_config = await numeric_state_trigger.async_validate_trigger_config(
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/src/homeassistant/homeassistant/components/homeassistant/triggers/numeric_state.py", line 76, in async_validate_trigger_config
    config = _TRIGGER_SCHEMA(config)
             ^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/voluptuous/validators.py", line 232, in __call__
    return self._exec((Schema(val) for val in self.validators), v)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/voluptuous/validators.py", line 355, in _exec
    raise e if self.msg is None else AllInvalid(self.msg, path=path)
  File "/usr/local/lib/python3.11/site-packages/voluptuous/validators.py", line 351, in _exec
    v = func(v)
        ^^^^^^^
  File "/usr/local/lib/python3.11/site-packages/voluptuous/schema_builder.py", line 276, in __call__
    raise er.MultipleInvalid([e])
voluptuous.error.MultipleInvalid: A value can never be above 50.0 and below 40.0 at the same time. You probably want two different triggers.

@MaxFixx
Copy link
Author

MaxFixx commented Jan 30, 2024

Лог прилагаю. В нем есть ошибки с моими шаблонами, но основной посыл в том, что НА считает интеграцию не стабильной, если дословно переводить. Скажите, что еще нужно выгрузить,, чтобы решить проблему? Я правильно понимаю - перезапуск это перезагрузка НА?

@IATkachenko
Copy link
Owner

2024-01-30 22:26:28.543 WARNING (SyncWorker_2) [homeassistant.loader] We found a custom integration yandex_weather which has not been tested by Home Assistant. This component might cause stability problems, be sure to disable it if you experience issues with Home Assistant

это стандартное сообщение HA для всех сторонних интеграций, к делу отношения не имеет.

В логе я не вижу загрузки интеграции.
Вы ее через настройки -> устройства и службы -> добавить интеграцию в HA добавили? (Yandex Weather, если что, на английском, русское название не найдет)

@MaxFixx
Copy link
Author

MaxFixx commented Jan 30, 2024

Ну конечно же нет) Получается update интеграции прошел и я не посмотрел, что нужно ее стандартным способом добавить. Сейчас добавил, но система не принимает ключ, пишет "Не могу получить данные. Проверьте корректность API-ключа в кабинете разработчика и убедитесь что выбран тариф 'Погода для сайта'. Может потребоваться до 30 минут, чтобы изменения настроек ключа вступили в силу на стороне Яндекса." хотя ключ я создал пару дней назад...

@MaxFixx
Copy link
Author

MaxFixx commented Jan 30, 2024

2024-01-30 23:32:00.604 ERROR (MainThread) [custom_components.yandex_weather.updater] Could not get data from API: <ClientResponse(https://api.weather.yandex.ru/v2/informers?lat=47.270806851171436&lon=39.66656684875489&lang=en_US) [403 Forbidden]>
<CIMultiDictProxy('Content-Encoding': 'gzip', 'Content-Length': '52', 'Content-Type': 'text/plain; charset=utf-8', 'Date': 'Tue, 30 Jan 2024 20:32:00 GMT', 'Vary': 'Accept-Encoding', 'X-Content-Type-Options': 'nosniff', 'X-Req-Id': '1706646720585645-12018634355860661318-i4tbgmnon5oj7iub-BAL')>

2024-01-30 23:32:00.605 ERROR (MainThread) [custom_components.yandex_weather.updater] Error requesting Yandex Weather updater data: (403, '{"message":"forbidden"}\n')

@ikstema
Copy link

ikstema commented Jan 31, 2024

Ну конечно же нет) Получается update интеграции прошел и я не посмотрел, что нужно ее стандартным способом добавить. Сейчас добавил, но система не принимает ключ, пишет "Не могу получить данные. Проверьте корректность API-ключа в кабинете разработчика и убедитесь что выбран тариф 'Погода для сайта'. Может потребоваться до 30 минут, чтобы изменения настроек ключа вступили в силу на стороне Яндекса." хотя ключ я создал пару дней назад...

Только что победил эту проблему вводом координат вручную вместо подтянутых автоматически из HA при настройке интеграции.

@MaxFixx
Copy link
Author

MaxFixx commented Jan 31, 2024

В общем у меня всё завелось. Игорь, спасибо большое за обратную связь!

@MaxFixx MaxFixx closed this as completed Jan 31, 2024
@IATkachenko
Copy link
Owner

2024-01-30 23:32:00.604 ERROR (MainThread) [custom_components.yandex_weather.updater] Could not get data from API: <ClientResponse(https://api.weather.yandex.ru/v2/informers?lat=47.270806851171436&lon=39.66656684875489&lang=en_US) [403 Forbidden]>
<CIMultiDictProxy('Content-Encoding': 'gzip', 'Content-Length': '52', 'Content-Type': 'text/plain; charset=utf-8', 'Date': 'Tue, 30 Jan 2024 20:32:00 GMT', 'Vary': 'Accept-Encoding', 'X-Content-Type-Options': 'nosniff', 'X-Req-Id': '1706646720585645-12018634355860661318-i4tbgmnon5oj7iub-BAL')>

2024-01-30 23:32:00.605 ERROR (MainThread) [custom_components.yandex_weather.updater] Error requesting Yandex Weather updater data: (403, '{"message":"forbidden"}\n')

Обычно это бывает когда сразу выбирают тариф погода для сайта, а не как сказано в инструкции
изображение

В #95, например, была такая проблема.

@IATkachenko
Copy link
Owner

Только что победил эту проблему вводом координат вручную вместо подтянутых автоматически из HA при настройке интеграции.

Я беру координаты домашней зоны HA. Не самый лучший вариант, улучшение в #66 но времени обо нет переделать...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Home Assistant Home Assistant related issues need more info Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants