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

Яндекс ТВ станция про громкость #402

Open
voron92 opened this issue Oct 31, 2023 · 9 comments
Open

Яндекс ТВ станция про громкость #402

voron92 opened this issue Oct 31, 2023 · 9 comments
Labels
bug Something isn't working

Comments

@voron92
Copy link

voron92 commented Oct 31, 2023

Адекватно не регулируется громкость на телевизоре, при нажатии на уровень громкости примерно по середине шкалы, громкость на телевизоре становится равной 100%, громкость регулируется в пределах от 1 до 10, в то время как шкала в карточке имеет 100 делений громкости, если ставишь громкость например 11, громкость на телевизоре становится 100%.
Думаю дело в том что на обычных колонках 10 уровней громкости, а на тв станции 100.

@Hipokys
Copy link

Hipokys commented Nov 5, 2023

Громкость через volume_level сломана.
Подозреваю, что сделано как костыль с Яндекс модулями и TV, для обхода проблем тандема: module( TV )+колонка.
Сделал управление, через работающие голосовые команды.
Не работает: "Громкость модуль 10", остальные 20/30/40/50/60/70/80/90/100 работают.
Приятная особенность, если не послать команду озвучки текста следом, включится рандомная песня из Яндекс Музыки.
Разработчики Яндекс - топ позорища!

yandex.yaml

input_number:
  hall_volume:
    name: Громкость Hall
    #initial: 100
    min: 20
    max: 100
    step: 20

automation:
  - alias: "Hall Volume"
    trigger:
      - platform: state
        entity_id: input_number.hall_volume
        to:
    action:
      - service: media_player.play_media
        entity_id: media_player.yandex_module_1
        data:
          media_content_id: Громкость модуль "{{ trigger.to_state.state | int }}"
          media_content_type: command
      - service: media_player.play_media
        entity_id: media_player.yandex_module_1
        data:
          media_content_id: громкость модуля "{{ trigger.to_state.state | int }}"
          media_content_type: text

Если используете - custom:mini-media-player
добавьте, для скрытия слайдера громкости:

hide:
   volume: true

ниже карточки плеера, требует установки кастомной карточки через HACS:

- type: custom:mushroom-number-card
  entity: input_number.hall_volume
  icon_color: deep-purple
  primary_info: none

@AlexxIT AlexxIT added the bug Something isn't working label Nov 6, 2023
@AlexxIT
Copy link
Owner

AlexxIT commented Nov 6, 2023

Без физического доступа к устройству не смогу такое починить. Может кто-то из владельцев сможет

@Hipokys
Copy link

Hipokys commented Nov 6, 2023

Могу предоставить информационную выборку с 2 модулей и 1 tv.
Работает одинаково на всех.

@voron92
Copy link
Author

voron92 commented Nov 6, 2023

Могу так же дать необходимые файлы, adb доступ настроен

@AlexxIT
Copy link
Owner

AlexxIT commented Nov 6, 2023

Чинить такие вещи вслепую отнимает очень много сил

@Hipokys
Copy link

Hipokys commented Nov 6, 2023

Разобрался:
Работает:
1
Громкость 10

и дальше по градации 0.02-0,1

Через карточку YandexStation и custom Player: 1/2/3/4/5/6/7/8/9/10
2

2.mp4

При этом в дебаге:

2023-11-06 19:09:55.689 DEBUG (MainThread) [custom_components.yandex_station.core.yandex_glagol] Module_Hall => local | {'command': 'setVolume', 'volume': 0.1}
2023-11-06 19:10:00.572 DEBUG (MainThread) [custom_components.yandex_station.core.yandex_glagol] Module_Hall => local | {'command': 'setVolume', 'volume': 0.2}
2023-11-06 19:10:04.221 DEBUG (MainThread) [custom_components.yandex_station.core.yandex_glagol] Module_Hall => local | {'command': 'setVolume', 'volume': 0.3}
2023-11-06 19:10:07.335 DEBUG (MainThread) [custom_components.yandex_station.core.yandex_glagol] Module_Hall => local | {'command': 'setVolume', 'volume': 0.4}
2023-11-06 19:10:10.508 DEBUG (MainThread) [custom_components.yandex_station.core.yandex_glagol] Module_Hall => local | {'command': 'setVolume', 'volume': 0.5}
2023-11-06 19:10:13.708 DEBUG (MainThread) [custom_components.yandex_station.core.yandex_glagol] Module_Hall => local | {'command': 'setVolume', 'volume': 0.6}
2023-11-06 19:10:17.520 DEBUG (MainThread) [custom_components.yandex_station.core.yandex_glagol] Module_Hall => local | {'command': 'setVolume', 'volume': 0.7}
2023-11-06 19:10:20.947 DEBUG (MainThread) [custom_components.yandex_station.core.yandex_glagol] Module_Hall => local | {'command': 'setVolume', 'volume': 0.8}
2023-11-06 19:10:24.524 DEBUG (MainThread) [custom_components.yandex_station.core.yandex_glagol] Module_Hall => local | {'command': 'setVolume', 'volume': 0.9}
2023-11-06 19:10:27.077 DEBUG (MainThread) [custom_components.yandex_station.core.yandex_glagol] Module_Hall => local | {'command': 'setVolume', 'volume': 1.0}

@Hipokys
Copy link

Hipokys commented Nov 6, 2023

Все, вопрос для меня снят.

input_number:
  hall_volume:
    name: Громкость Hall
    #initial: 100
    min: 0
    max: 100
    step: 10


automation:
  - alias: "Hall Volume"
    trigger:
      - platform: state
        entity_id: input_number.hall_volume
        to:
    action:
      - service: media_player.volume_set
        data:
          entity_id: media_player.yandex_module_1
          volume_level: "{{ trigger.to_state.state | int / 1000 }}"

Обратная связь:

- alias: "Hall Volume Feedback"
  trigger:
    - platform: state
      entity_id: media_player.yandex_module_1
      attribute: volume_level
  action:
    - delay:
        seconds: 2
    - service: input_number.set_value
      target:
        entity_id: input_number.hall_volume
      data:
        value: "{{ state_attr(trigger.entity_id, 'volume_level') * 100 }}"
  mode: queued
  max_exceeded: silent

Можно сделать большую задержку, чтобы не было обратного переключения.

@sokrata
Copy link

sokrata commented Mar 9, 2024

Попробовал

Все, вопрос для меня снят.

input_number:
  hall_volume:
    name: Громкость Hall
    #initial: 100
    min: 0
    max: 100
    step: 10


automation:
  - alias: "Hall Volume"
    trigger:
      - platform: state
        entity_id: input_number.hall_volume
        to:
    action:
      - service: media_player.volume_set
        data:
          entity_id: media_player.yandex_module_1
          volume_level: "{{ trigger.to_state.state | int / 1000 }}"

Обратная связь:

- alias: "Hall Volume Feedback"
  trigger:
    - platform: state
      entity_id: media_player.yandex_module_1
      attribute: volume_level
  action:
    - delay:
        seconds: 2
    - service: input_number.set_value
      target:
        entity_id: input_number.hall_volume
      data:
        value: "{{ state_attr(trigger.entity_id, 'volume_level') * 100 }}"
  mode: queued
  max_exceeded: silent

Можно сделать большую задержку, чтобы не было обратного переключения.

Купил ТВ станцию Про и столкнулся с такой же проблемой. Пробовал делать скрипты как у вас, не получается поставить больше 1, то есть максимальная громкость 10 и дальше ни в какую. Как можно подебажить/посмотреть почему при установке больше 1 команды не уходят на станцию?

@AlexxIT
Copy link
Owner

AlexxIT commented Mar 12, 2024

Скачайте диагностику устройства для проблемных станций. Можно или приложить тут или прислать мне в Телегу.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants