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

HomeKit TV Remote Widget Volume Control Not Working #63043

Closed
pavolholes opened this issue Dec 29, 2021 · 20 comments
Closed

HomeKit TV Remote Widget Volume Control Not Working #63043

pavolholes opened this issue Dec 29, 2021 · 20 comments
Assignees

Comments

@pavolholes
Copy link

The problem

Hello,
I can't control volume of the TV via the Remote widget on my iPhone using the side hardware buttons. All other controls visible on the screen are working and I was able to catch them via event homekit_tv_remote_key_pressed. But when I press the hardware volume buttons the event is not received nor the volume of entity is changed. I'm able to control the volume via media_player entity in Lovelace and also via service:

service: media_player.volume_up
target:
  entity_id: media_player.tv_obyvacka

I think the supported_features includes mandatory SUPPORT_VOLUME_MUTE, SUPPORT_VOLUME_SET and SUPPORT_VOLUME_STEP bits. Here is the TV entity info:

source_list: TV, HDMI, Plex, Kuki, YouTube
volume_level: 0.08
is_volume_muted: false
media_content_type: app
media_title: Plex
app_id: 3201512006963
source: Plex
ip_address: 192.168.2.111
device_class: tv
entity_picture: /api/media_player_proxy/media_player.tv_obyvacka?token=REDACTED&cache=REDACTED
icon: mdi:television
friendly_name: Obyvacka TV
supported_features: 24509
dwains_dashboard_popup: dwains-dashboard/addons/popups/media_player/obyvackaTv_popup.yaml

Below you can find my yaml configuration of the HomeKit Bridge in accessory mode.

I've enabled debug logging for HomeKit using below which I found here:

logger:
  default: warning
  logs:
    homeassistant.components.homekit: debug
    pyhap: debug

and below you can find the debug log. During the debugging I've done this in the Remote widget:

  • tap 5 times arrow_down on the screen
  • press 5 times volume_down
  • press 5 times volume_up
  • tap 5 times arrow_up on the screen

I don't understant all from the logs but I think I can see there only five taps of arrow_down ({'characteristics': [{'aid': 1, 'iid': 15, 'value': 5}]}) and five taps of arrow_up ({'aid': 1, 'iid': 15, 'value': 4}), not the volume buttons presses between them.

Can you please help me with this?

Thanks a lot.

Regards,
Pavol

What version of Home Assistant Core has the issue?

core-2021.12.7

What was the last working version of Home Assistant Core?

No response

What type of installation are you running?

Home Assistant Supervised

Integration causing the issue

homekit

Link to integration documentation on our website

https://www.home-assistant.io/integrations/homekit/#cant-control-volume-of-your-tv-media-player

Example YAML snippet

homekit:
  - name: HA Bridge TVs
    mode: accessory
    port: 51828
    filter:
      include_entities:
        - media_player.tv_obyvacka
    entity_config:
      media_player.tv_obyvacka:
        feature_list:
          - feature: on_off
          - feature: play_pause
          - feature: play_stop
          - feature: toggle_mute

Anything in the logs that might be useful for us?

2021-12-29 21:53:40 DEBUG (MainThread) [pyhap.hap_protocol] ('192.168.2.138', 49463) (509882e4-0903-4ac4-9f1b-e7828aaee1d2): Send encrypted: b'HTTP/1.1 204 No Content\r\n\r\n'
2021-12-29 21:53:40 DEBUG (MainThread) [pyhap.hap_protocol] ('192.168.2.138', 49463) (509882e4-0903-4ac4-9f1b-e7828aaee1d2): h11 Event: NEED_DATA
2021-12-29 21:53:43 DEBUG (MainThread) [pyhap.hap_protocol] ('192.168.2.112', 61642) (509882e4-0903-4ac4-9f1b-e7828aaee1d2): Recv decrypted: b'PUT /characteristics HTTP/1.1\r\nHost: Obyvacka\\032TV\\032D978C2._hap._tcp.local\r\nContent-Length: 50\r\nContent-Type: application/hap+json\r\n\r\n{"characteristics":[{"aid":1,"iid":15,"value":5}]}'
2021-12-29 21:53:43 DEBUG (MainThread) [pyhap.hap_protocol] ('192.168.2.112', 61642) (509882e4-0903-4ac4-9f1b-e7828aaee1d2): h11 Event: PAUSED
2021-12-29 21:53:43 DEBUG (MainThread) [pyhap.hap_protocol] ('192.168.2.112', 61642) (509882e4-0903-4ac4-9f1b-e7828aaee1d2): h11 Event: Request(method=b'PUT', target=b'/characteristics', headers=<Headers([(b'host', b'Obyvacka\\032TV\\032D978C2._hap._tcp.local'), (b'content-length', b'50'), (b'content-type', b'application/hap+json')])>, http_version=b'1.1')
2021-12-29 21:53:43 DEBUG (MainThread) [pyhap.hap_protocol] ('192.168.2.112', 61642) (509882e4-0903-4ac4-9f1b-e7828aaee1d2): h11 Event: Data(data=bytearray(b'{"characteristics":[{"aid":1,"iid":15,"value":5}]}'), chunk_start=False, chunk_end=False)
2021-12-29 21:53:43 DEBUG (MainThread) [pyhap.hap_protocol] ('192.168.2.112', 61642) (509882e4-0903-4ac4-9f1b-e7828aaee1d2): h11 Event: EndOfMessage(headers=<Headers([])>)
2021-12-29 21:53:43 DEBUG (MainThread) [pyhap.hap_handler] ('192.168.2.112', 61642): Request PUT for path '/characteristics': {'host': 'Obyvacka\\032TV\\032D978C2._hap._tcp.local', 'content-length': '50', 'content-type': 'application/hap+json'}
2021-12-29 21:53:43 DEBUG (MainThread) [pyhap.hap_handler] ('192.168.2.112', 61642): Set characteristics content: {'characteristics': [{'aid': 1, 'iid': 15, 'value': 5}]}
2021-12-29 21:53:43 DEBUG (MainThread) [pyhap.characteristic] client_update_value: RemoteKey to 5 (original: 5) from client: ('192.168.2.112', 61642)
2021-12-29 21:53:43 DEBUG (MainThread) [homeassistant.components.homekit.type_media_players] media_player.tv_obyvacka: Set remote key to 5
2021-12-29 21:53:43 DEBUG (MainThread) [pyhap.hap_protocol] ('192.168.2.112', 61642) (509882e4-0903-4ac4-9f1b-e7828aaee1d2): Send encrypted: b'HTTP/1.1 204 No Content\r\n\r\n'
2021-12-29 21:53:43 DEBUG (MainThread) [pyhap.hap_protocol] ('192.168.2.112', 61642) (509882e4-0903-4ac4-9f1b-e7828aaee1d2): h11 Event: NEED_DATA
2021-12-29 21:53:43 DEBUG (MainThread) [pyhap.hap_protocol] ('192.168.2.112', 61642) (509882e4-0903-4ac4-9f1b-e7828aaee1d2): Recv decrypted: b'PUT /characteristics HTTP/1.1\r\nHost: Obyvacka\\032TV\\032D978C2._hap._tcp.local\r\nContent-Length: 50\r\nContent-Type: application/hap+json\r\n\r\n{"characteristics":[{"aid":1,"iid":11,"value":1}]}'
2021-12-29 21:53:43 DEBUG (MainThread) [pyhap.hap_protocol] ('192.168.2.112', 61642) (509882e4-0903-4ac4-9f1b-e7828aaee1d2): h11 Event: PAUSED
2021-12-29 21:53:43 DEBUG (MainThread) [pyhap.hap_protocol] ('192.168.2.112', 61642) (509882e4-0903-4ac4-9f1b-e7828aaee1d2): h11 Event: Request(method=b'PUT', target=b'/characteristics', headers=<Headers([(b'host', b'Obyvacka\\032TV\\032D978C2._hap._tcp.local'), (b'content-length', b'50'), (b'content-type', b'application/hap+json')])>, http_version=b'1.1')
2021-12-29 21:53:43 DEBUG (MainThread) [pyhap.hap_protocol] ('192.168.2.112', 61642) (509882e4-0903-4ac4-9f1b-e7828aaee1d2): h11 Event: Data(data=bytearray(b'{"characteristics":[{"aid":1,"iid":11,"value":1}]}'), chunk_start=False, chunk_end=False)
2021-12-29 21:53:43 DEBUG (MainThread) [pyhap.hap_protocol] ('192.168.2.112', 61642) (509882e4-0903-4ac4-9f1b-e7828aaee1d2): h11 Event: EndOfMessage(headers=<Headers([])>)
2021-12-29 21:53:43 DEBUG (MainThread) [pyhap.hap_handler] ('192.168.2.112', 61642): Request PUT for path '/characteristics': {'host': 'Obyvacka\\032TV\\032D978C2._hap._tcp.local', 'content-length': '50', 'content-type': 'application/hap+json'}
2021-12-29 21:53:43 DEBUG (MainThread) [pyhap.hap_handler] ('192.168.2.112', 61642): Set characteristics content: {'characteristics': [{'aid': 1, 'iid': 11, 'value': 1}]}
2021-12-29 21:53:43 DEBUG (MainThread) [pyhap.characteristic] client_update_value: Active to 1 (original: 1) from client: ('192.168.2.112', 61642)
2021-12-29 21:53:43 DEBUG (MainThread) [homeassistant.components.homekit.type_media_players] media_player.tv_obyvacka: Set switch state for "on_off" to 1
2021-12-29 21:53:43 DEBUG (MainThread) [pyhap.hap_protocol] ('192.168.2.112', 61642) (509882e4-0903-4ac4-9f1b-e7828aaee1d2): Send encrypted: b'HTTP/1.1 204 No Content\r\n\r\n'
2021-12-29 21:53:43 DEBUG (MainThread) [pyhap.hap_protocol] ('192.168.2.112', 61642) (509882e4-0903-4ac4-9f1b-e7828aaee1d2): h11 Event: NEED_DATA
2021-12-29 21:53:44 DEBUG (MainThread) [pyhap.hap_protocol] ('192.168.2.112', 61642) (509882e4-0903-4ac4-9f1b-e7828aaee1d2): Recv decrypted: b'PUT /characteristics HTTP/1.1\r\nHost: Obyvacka\\032TV\\032D978C2._hap._tcp.local\r\nContent-Length: 50\r\nContent-Type: application/hap+json\r\n\r\n{"characteristics":[{"aid":1,"iid":15,"value":5}]}'
2021-12-29 21:53:44 DEBUG (MainThread) [pyhap.hap_protocol] ('192.168.2.112', 61642) (509882e4-0903-4ac4-9f1b-e7828aaee1d2): h11 Event: PAUSED
2021-12-29 21:53:44 DEBUG (MainThread) [pyhap.hap_protocol] ('192.168.2.112', 61642) (509882e4-0903-4ac4-9f1b-e7828aaee1d2): h11 Event: Request(method=b'PUT', target=b'/characteristics', headers=<Headers([(b'host', b'Obyvacka\\032TV\\032D978C2._hap._tcp.local'), (b'content-length', b'50'), (b'content-type', b'application/hap+json')])>, http_version=b'1.1')
2021-12-29 21:53:44 DEBUG (MainThread) [pyhap.hap_protocol] ('192.168.2.112', 61642) (509882e4-0903-4ac4-9f1b-e7828aaee1d2): h11 Event: Data(data=bytearray(b'{"characteristics":[{"aid":1,"iid":15,"value":5}]}'), chunk_start=False, chunk_end=False)
2021-12-29 21:53:44 DEBUG (MainThread) [pyhap.hap_protocol] ('192.168.2.112', 61642) (509882e4-0903-4ac4-9f1b-e7828aaee1d2): h11 Event: EndOfMessage(headers=<Headers([])>)
2021-12-29 21:53:44 DEBUG (MainThread) [pyhap.hap_handler] ('192.168.2.112', 61642): Request PUT for path '/characteristics': {'host': 'Obyvacka\\032TV\\032D978C2._hap._tcp.local', 'content-length': '50', 'content-type': 'application/hap+json'}
2021-12-29 21:53:44 DEBUG (MainThread) [pyhap.hap_handler] ('192.168.2.112', 61642): Set characteristics content: {'characteristics': [{'aid': 1, 'iid': 15, 'value': 5}]}
2021-12-29 21:53:44 DEBUG (MainThread) [pyhap.characteristic] client_update_value: RemoteKey to 5 (original: 5) from client: ('192.168.2.112', 61642)
2021-12-29 21:53:44 DEBUG (MainThread) [homeassistant.components.homekit.type_media_players] media_player.tv_obyvacka: Set remote key to 5
2021-12-29 21:53:44 DEBUG (MainThread) [pyhap.hap_protocol] ('192.168.2.112', 61642) (509882e4-0903-4ac4-9f1b-e7828aaee1d2): Send encrypted: b'HTTP/1.1 204 No Content\r\n\r\n'
2021-12-29 21:53:44 DEBUG (MainThread) [pyhap.hap_protocol] ('192.168.2.112', 61642) (509882e4-0903-4ac4-9f1b-e7828aaee1d2): h11 Event: NEED_DATA
2021-12-29 21:53:44 DEBUG (MainThread) [pyhap.hap_protocol] ('192.168.2.112', 61642) (509882e4-0903-4ac4-9f1b-e7828aaee1d2): Recv decrypted: b'PUT /characteristics HTTP/1.1\r\nHost: Obyvacka\\032TV\\032D978C2._hap._tcp.local\r\nContent-Length: 50\r\nContent-Type: application/hap+json\r\n\r\n{"characteristics":[{"aid":1,"iid":15,"value":5}]}'
2021-12-29 21:53:44 DEBUG (MainThread) [pyhap.hap_protocol] ('192.168.2.112', 61642) (509882e4-0903-4ac4-9f1b-e7828aaee1d2): h11 Event: PAUSED
2021-12-29 21:53:44 DEBUG (MainThread) [pyhap.hap_protocol] ('192.168.2.112', 61642) (509882e4-0903-4ac4-9f1b-e7828aaee1d2): h11 Event: Request(method=b'PUT', target=b'/characteristics', headers=<Headers([(b'host', b'Obyvacka\\032TV\\032D978C2._hap._tcp.local'), (b'content-length', b'50'), (b'content-type', b'application/hap+json')])>, http_version=b'1.1')
2021-12-29 21:53:44 DEBUG (MainThread) [pyhap.hap_protocol] ('192.168.2.112', 61642) (509882e4-0903-4ac4-9f1b-e7828aaee1d2): h11 Event: Data(data=bytearray(b'{"characteristics":[{"aid":1,"iid":15,"value":5}]}'), chunk_start=False, chunk_end=False)
2021-12-29 21:53:44 DEBUG (MainThread) [pyhap.hap_protocol] ('192.168.2.112', 61642) (509882e4-0903-4ac4-9f1b-e7828aaee1d2): h11 Event: EndOfMessage(headers=<Headers([])>)
2021-12-29 21:53:44 DEBUG (MainThread) [pyhap.hap_handler] ('192.168.2.112', 61642): Request PUT for path '/characteristics': {'host': 'Obyvacka\\032TV\\032D978C2._hap._tcp.local', 'content-length': '50', 'content-type': 'application/hap+json'}
2021-12-29 21:53:44 DEBUG (MainThread) [pyhap.hap_handler] ('192.168.2.112', 61642): Set characteristics content: {'characteristics': [{'aid': 1, 'iid': 15, 'value': 5}]}
2021-12-29 21:53:44 DEBUG (MainThread) [pyhap.characteristic] client_update_value: RemoteKey to 5 (original: 5) from client: ('192.168.2.112', 61642)
2021-12-29 21:53:44 DEBUG (MainThread) [homeassistant.components.homekit.type_media_players] media_player.tv_obyvacka: Set remote key to 5
2021-12-29 21:53:44 DEBUG (MainThread) [pyhap.hap_protocol] ('192.168.2.112', 61642) (509882e4-0903-4ac4-9f1b-e7828aaee1d2): Send encrypted: b'HTTP/1.1 204 No Content\r\n\r\n'
2021-12-29 21:53:44 DEBUG (MainThread) [pyhap.hap_protocol] ('192.168.2.112', 61642) (509882e4-0903-4ac4-9f1b-e7828aaee1d2): h11 Event: NEED_DATA
2021-12-29 21:53:45 DEBUG (MainThread) [pyhap.hap_protocol] ('192.168.2.112', 61642) (509882e4-0903-4ac4-9f1b-e7828aaee1d2): Recv decrypted: b'PUT /characteristics HTTP/1.1\r\nHost: Obyvacka\\032TV\\032D978C2._hap._tcp.local\r\nContent-Length: 50\r\nContent-Type: application/hap+json\r\n\r\n{"characteristics":[{"aid":1,"iid":15,"value":5}]}'
2021-12-29 21:53:45 DEBUG (MainThread) [pyhap.hap_protocol] ('192.168.2.112', 61642) (509882e4-0903-4ac4-9f1b-e7828aaee1d2): h11 Event: PAUSED
2021-12-29 21:53:45 DEBUG (MainThread) [pyhap.hap_protocol] ('192.168.2.112', 61642) (509882e4-0903-4ac4-9f1b-e7828aaee1d2): h11 Event: Request(method=b'PUT', target=b'/characteristics', headers=<Headers([(b'host', b'Obyvacka\\032TV\\032D978C2._hap._tcp.local'), (b'content-length', b'50'), (b'content-type', b'application/hap+json')])>, http_version=b'1.1')
2021-12-29 21:53:45 DEBUG (MainThread) [pyhap.hap_protocol] ('192.168.2.112', 61642) (509882e4-0903-4ac4-9f1b-e7828aaee1d2): h11 Event: Data(data=bytearray(b'{"characteristics":[{"aid":1,"iid":15,"value":5}]}'), chunk_start=False, chunk_end=False)
2021-12-29 21:53:45 DEBUG (MainThread) [pyhap.hap_protocol] ('192.168.2.112', 61642) (509882e4-0903-4ac4-9f1b-e7828aaee1d2): h11 Event: EndOfMessage(headers=<Headers([])>)
2021-12-29 21:53:45 DEBUG (MainThread) [pyhap.hap_handler] ('192.168.2.112', 61642): Request PUT for path '/characteristics': {'host': 'Obyvacka\\032TV\\032D978C2._hap._tcp.local', 'content-length': '50', 'content-type': 'application/hap+json'}
2021-12-29 21:53:45 DEBUG (MainThread) [pyhap.hap_handler] ('192.168.2.112', 61642): Set characteristics content: {'characteristics': [{'aid': 1, 'iid': 15, 'value': 5}]}
2021-12-29 21:53:45 DEBUG (MainThread) [pyhap.characteristic] client_update_value: RemoteKey to 5 (original: 5) from client: ('192.168.2.112', 61642)
2021-12-29 21:53:45 DEBUG (MainThread) [homeassistant.components.homekit.type_media_players] media_player.tv_obyvacka: Set remote key to 5
2021-12-29 21:53:45 DEBUG (MainThread) [pyhap.hap_protocol] ('192.168.2.112', 61642) (509882e4-0903-4ac4-9f1b-e7828aaee1d2): Send encrypted: b'HTTP/1.1 204 No Content\r\n\r\n'
2021-12-29 21:53:45 DEBUG (MainThread) [pyhap.hap_protocol] ('192.168.2.112', 61642) (509882e4-0903-4ac4-9f1b-e7828aaee1d2): h11 Event: NEED_DATA
2021-12-29 21:53:46 DEBUG (MainThread) [pyhap.hap_protocol] ('192.168.2.112', 61642) (509882e4-0903-4ac4-9f1b-e7828aaee1d2): Recv decrypted: b'PUT /characteristics HTTP/1.1\r\nHost: Obyvacka\\032TV\\032D978C2._hap._tcp.local\r\nContent-Length: 50\r\nContent-Type: application/hap+json\r\n\r\n{"characteristics":[{"aid":1,"iid":15,"value":5}]}'
2021-12-29 21:53:46 DEBUG (MainThread) [pyhap.hap_protocol] ('192.168.2.112', 61642) (509882e4-0903-4ac4-9f1b-e7828aaee1d2): h11 Event: PAUSED
2021-12-29 21:53:46 DEBUG (MainThread) [pyhap.hap_protocol] ('192.168.2.112', 61642) (509882e4-0903-4ac4-9f1b-e7828aaee1d2): h11 Event: Request(method=b'PUT', target=b'/characteristics', headers=<Headers([(b'host', b'Obyvacka\\032TV\\032D978C2._hap._tcp.local'), (b'content-length', b'50'), (b'content-type', b'application/hap+json')])>, http_version=b'1.1')
2021-12-29 21:53:46 DEBUG (MainThread) [pyhap.hap_protocol] ('192.168.2.112', 61642) (509882e4-0903-4ac4-9f1b-e7828aaee1d2): h11 Event: Data(data=bytearray(b'{"characteristics":[{"aid":1,"iid":15,"value":5}]}'), chunk_start=False, chunk_end=False)
2021-12-29 21:53:46 DEBUG (MainThread) [pyhap.hap_protocol] ('192.168.2.112', 61642) (509882e4-0903-4ac4-9f1b-e7828aaee1d2): h11 Event: EndOfMessage(headers=<Headers([])>)
2021-12-29 21:53:46 DEBUG (MainThread) [pyhap.hap_handler] ('192.168.2.112', 61642): Request PUT for path '/characteristics': {'host': 'Obyvacka\\032TV\\032D978C2._hap._tcp.local', 'content-length': '50', 'content-type': 'application/hap+json'}
2021-12-29 21:53:46 DEBUG (MainThread) [pyhap.hap_handler] ('192.168.2.112', 61642): Set characteristics content: {'characteristics': [{'aid': 1, 'iid': 15, 'value': 5}]}
2021-12-29 21:53:46 DEBUG (MainThread) [pyhap.characteristic] client_update_value: RemoteKey to 5 (original: 5) from client: ('192.168.2.112', 61642)
2021-12-29 21:53:46 DEBUG (MainThread) [homeassistant.components.homekit.type_media_players] media_player.tv_obyvacka: Set remote key to 5
2021-12-29 21:53:46 DEBUG (MainThread) [pyhap.hap_protocol] ('192.168.2.112', 61642) (509882e4-0903-4ac4-9f1b-e7828aaee1d2): Send encrypted: b'HTTP/1.1 204 No Content\r\n\r\n'
2021-12-29 21:53:46 DEBUG (MainThread) [pyhap.hap_protocol] ('192.168.2.112', 61642) (509882e4-0903-4ac4-9f1b-e7828aaee1d2): h11 Event: NEED_DATA
2021-12-29 21:53:52 DEBUG (MainThread) [pyhap.hap_protocol] ('192.168.2.112', 61642) (509882e4-0903-4ac4-9f1b-e7828aaee1d2): Recv decrypted: b'PUT /characteristics HTTP/1.1\r\nHost: Obyvacka\\032TV\\032D978C2._hap._tcp.local\r\nContent-Length: 50\r\nContent-Type: application/hap+json\r\n\r\n{"characteristics":[{"aid":1,"iid":15,"value":4}]}'
2021-12-29 21:53:52 DEBUG (MainThread) [pyhap.hap_protocol] ('192.168.2.112', 61642) (509882e4-0903-4ac4-9f1b-e7828aaee1d2): h11 Event: PAUSED
2021-12-29 21:53:52 DEBUG (MainThread) [pyhap.hap_protocol] ('192.168.2.112', 61642) (509882e4-0903-4ac4-9f1b-e7828aaee1d2): h11 Event: Request(method=b'PUT', target=b'/characteristics', headers=<Headers([(b'host', b'Obyvacka\\032TV\\032D978C2._hap._tcp.local'), (b'content-length', b'50'), (b'content-type', b'application/hap+json')])>, http_version=b'1.1')
2021-12-29 21:53:52 DEBUG (MainThread) [pyhap.hap_protocol] ('192.168.2.112', 61642) (509882e4-0903-4ac4-9f1b-e7828aaee1d2): h11 Event: Data(data=bytearray(b'{"characteristics":[{"aid":1,"iid":15,"value":4}]}'), chunk_start=False, chunk_end=False)
2021-12-29 21:53:52 DEBUG (MainThread) [pyhap.hap_protocol] ('192.168.2.112', 61642) (509882e4-0903-4ac4-9f1b-e7828aaee1d2): h11 Event: EndOfMessage(headers=<Headers([])>)
2021-12-29 21:53:52 DEBUG (MainThread) [pyhap.hap_handler] ('192.168.2.112', 61642): Request PUT for path '/characteristics': {'host': 'Obyvacka\\032TV\\032D978C2._hap._tcp.local', 'content-length': '50', 'content-type': 'application/hap+json'}
2021-12-29 21:53:52 DEBUG (MainThread) [pyhap.hap_handler] ('192.168.2.112', 61642): Set characteristics content: {'characteristics': [{'aid': 1, 'iid': 15, 'value': 4}]}
2021-12-29 21:53:52 DEBUG (MainThread) [pyhap.characteristic] client_update_value: RemoteKey to 4 (original: 4) from client: ('192.168.2.112', 61642)
2021-12-29 21:53:52 DEBUG (MainThread) [homeassistant.components.homekit.type_media_players] media_player.tv_obyvacka: Set remote key to 4
2021-12-29 21:53:52 DEBUG (MainThread) [pyhap.hap_protocol] ('192.168.2.112', 61642) (509882e4-0903-4ac4-9f1b-e7828aaee1d2): Send encrypted: b'HTTP/1.1 204 No Content\r\n\r\n'
2021-12-29 21:53:52 DEBUG (MainThread) [pyhap.hap_protocol] ('192.168.2.112', 61642) (509882e4-0903-4ac4-9f1b-e7828aaee1d2): h11 Event: NEED_DATA
2021-12-29 21:53:53 DEBUG (MainThread) [pyhap.hap_protocol] ('192.168.2.112', 61642) (509882e4-0903-4ac4-9f1b-e7828aaee1d2): Recv decrypted: b'PUT /characteristics HTTP/1.1\r\nHost: Obyvacka\\032TV\\032D978C2._hap._tcp.local\r\nContent-Length: 50\r\nContent-Type: application/hap+json\r\n\r\n{"characteristics":[{"aid":1,"iid":15,"value":4}]}'
2021-12-29 21:53:53 DEBUG (MainThread) [pyhap.hap_protocol] ('192.168.2.112', 61642) (509882e4-0903-4ac4-9f1b-e7828aaee1d2): h11 Event: PAUSED
2021-12-29 21:53:53 DEBUG (MainThread) [pyhap.hap_protocol] ('192.168.2.112', 61642) (509882e4-0903-4ac4-9f1b-e7828aaee1d2): h11 Event: Request(method=b'PUT', target=b'/characteristics', headers=<Headers([(b'host', b'Obyvacka\\032TV\\032D978C2._hap._tcp.local'), (b'content-length', b'50'), (b'content-type', b'application/hap+json')])>, http_version=b'1.1')
2021-12-29 21:53:53 DEBUG (MainThread) [pyhap.hap_protocol] ('192.168.2.112', 61642) (509882e4-0903-4ac4-9f1b-e7828aaee1d2): h11 Event: Data(data=bytearray(b'{"characteristics":[{"aid":1,"iid":15,"value":4}]}'), chunk_start=False, chunk_end=False)
2021-12-29 21:53:53 DEBUG (MainThread) [pyhap.hap_protocol] ('192.168.2.112', 61642) (509882e4-0903-4ac4-9f1b-e7828aaee1d2): h11 Event: EndOfMessage(headers=<Headers([])>)
2021-12-29 21:53:53 DEBUG (MainThread) [pyhap.hap_handler] ('192.168.2.112', 61642): Request PUT for path '/characteristics': {'host': 'Obyvacka\\032TV\\032D978C2._hap._tcp.local', 'content-length': '50', 'content-type': 'application/hap+json'}
2021-12-29 21:53:53 DEBUG (MainThread) [pyhap.hap_handler] ('192.168.2.112', 61642): Set characteristics content: {'characteristics': [{'aid': 1, 'iid': 15, 'value': 4}]}
2021-12-29 21:53:53 DEBUG (MainThread) [pyhap.characteristic] client_update_value: RemoteKey to 4 (original: 4) from client: ('192.168.2.112', 61642)
2021-12-29 21:53:53 DEBUG (MainThread) [homeassistant.components.homekit.type_media_players] media_player.tv_obyvacka: Set remote key to 4
2021-12-29 21:53:53 DEBUG (MainThread) [pyhap.hap_protocol] ('192.168.2.112', 61642) (509882e4-0903-4ac4-9f1b-e7828aaee1d2): Send encrypted: b'HTTP/1.1 204 No Content\r\n\r\n'
2021-12-29 21:53:53 DEBUG (MainThread) [pyhap.hap_protocol] ('192.168.2.112', 61642) (509882e4-0903-4ac4-9f1b-e7828aaee1d2): h11 Event: NEED_DATA
2021-12-29 21:53:53 DEBUG (MainThread) [pyhap.hap_protocol] ('192.168.2.112', 61642) (509882e4-0903-4ac4-9f1b-e7828aaee1d2): Recv decrypted: b'PUT /characteristics HTTP/1.1\r\nHost: Obyvacka\\032TV\\032D978C2._hap._tcp.local\r\nContent-Length: 50\r\nContent-Type: application/hap+json\r\n\r\n{"characteristics":[{"aid":1,"iid":15,"value":4}]}'
2021-12-29 21:53:53 DEBUG (MainThread) [pyhap.hap_protocol] ('192.168.2.112', 61642) (509882e4-0903-4ac4-9f1b-e7828aaee1d2): h11 Event: PAUSED
2021-12-29 21:53:53 DEBUG (MainThread) [pyhap.hap_protocol] ('192.168.2.112', 61642) (509882e4-0903-4ac4-9f1b-e7828aaee1d2): h11 Event: Request(method=b'PUT', target=b'/characteristics', headers=<Headers([(b'host', b'Obyvacka\\032TV\\032D978C2._hap._tcp.local'), (b'content-length', b'50'), (b'content-type', b'application/hap+json')])>, http_version=b'1.1')
2021-12-29 21:53:53 DEBUG (MainThread) [pyhap.hap_protocol] ('192.168.2.112', 61642) (509882e4-0903-4ac4-9f1b-e7828aaee1d2): h11 Event: Data(data=bytearray(b'{"characteristics":[{"aid":1,"iid":15,"value":4}]}'), chunk_start=False, chunk_end=False)
2021-12-29 21:53:53 DEBUG (MainThread) [pyhap.hap_protocol] ('192.168.2.112', 61642) (509882e4-0903-4ac4-9f1b-e7828aaee1d2): h11 Event: EndOfMessage(headers=<Headers([])>)
2021-12-29 21:53:53 DEBUG (MainThread) [pyhap.hap_handler] ('192.168.2.112', 61642): Request PUT for path '/characteristics': {'host': 'Obyvacka\\032TV\\032D978C2._hap._tcp.local', 'content-length': '50', 'content-type': 'application/hap+json'}
2021-12-29 21:53:53 DEBUG (MainThread) [pyhap.hap_handler] ('192.168.2.112', 61642): Set characteristics content: {'characteristics': [{'aid': 1, 'iid': 15, 'value': 4}]}
2021-12-29 21:53:53 DEBUG (MainThread) [pyhap.characteristic] client_update_value: RemoteKey to 4 (original: 4) from client: ('192.168.2.112', 61642)
2021-12-29 21:53:53 DEBUG (MainThread) [homeassistant.components.homekit.type_media_players] media_player.tv_obyvacka: Set remote key to 4
2021-12-29 21:53:53 DEBUG (MainThread) [pyhap.hap_protocol] ('192.168.2.112', 61642) (509882e4-0903-4ac4-9f1b-e7828aaee1d2): Send encrypted: b'HTTP/1.1 204 No Content\r\n\r\n'
2021-12-29 21:53:53 DEBUG (MainThread) [pyhap.hap_protocol] ('192.168.2.112', 61642) (509882e4-0903-4ac4-9f1b-e7828aaee1d2): h11 Event: NEED_DATA
2021-12-29 21:53:54 DEBUG (MainThread) [pyhap.hap_protocol] ('192.168.2.112', 61642) (509882e4-0903-4ac4-9f1b-e7828aaee1d2): Recv decrypted: b'PUT /characteristics HTTP/1.1\r\nHost: Obyvacka\\032TV\\032D978C2._hap._tcp.local\r\nContent-Length: 50\r\nContent-Type: application/hap+json\r\n\r\n{"characteristics":[{"aid":1,"iid":15,"value":4}]}'
2021-12-29 21:53:54 DEBUG (MainThread) [pyhap.hap_protocol] ('192.168.2.112', 61642) (509882e4-0903-4ac4-9f1b-e7828aaee1d2): h11 Event: PAUSED
2021-12-29 21:53:54 DEBUG (MainThread) [pyhap.hap_protocol] ('192.168.2.112', 61642) (509882e4-0903-4ac4-9f1b-e7828aaee1d2): h11 Event: Request(method=b'PUT', target=b'/characteristics', headers=<Headers([(b'host', b'Obyvacka\\032TV\\032D978C2._hap._tcp.local'), (b'content-length', b'50'), (b'content-type', b'application/hap+json')])>, http_version=b'1.1')
2021-12-29 21:53:54 DEBUG (MainThread) [pyhap.hap_protocol] ('192.168.2.112', 61642) (509882e4-0903-4ac4-9f1b-e7828aaee1d2): h11 Event: Data(data=bytearray(b'{"characteristics":[{"aid":1,"iid":15,"value":4}]}'), chunk_start=False, chunk_end=False)
2021-12-29 21:53:54 DEBUG (MainThread) [pyhap.hap_protocol] ('192.168.2.112', 61642) (509882e4-0903-4ac4-9f1b-e7828aaee1d2): h11 Event: EndOfMessage(headers=<Headers([])>)
2021-12-29 21:53:54 DEBUG (MainThread) [pyhap.hap_handler] ('192.168.2.112', 61642): Request PUT for path '/characteristics': {'host': 'Obyvacka\\032TV\\032D978C2._hap._tcp.local', 'content-length': '50', 'content-type': 'application/hap+json'}
2021-12-29 21:53:54 DEBUG (MainThread) [pyhap.hap_handler] ('192.168.2.112', 61642): Set characteristics content: {'characteristics': [{'aid': 1, 'iid': 15, 'value': 4}]}
2021-12-29 21:53:54 DEBUG (MainThread) [pyhap.characteristic] client_update_value: RemoteKey to 4 (original: 4) from client: ('192.168.2.112', 61642)
2021-12-29 21:53:54 DEBUG (MainThread) [homeassistant.components.homekit.type_media_players] media_player.tv_obyvacka: Set remote key to 4
2021-12-29 21:53:54 DEBUG (MainThread) [pyhap.hap_protocol] ('192.168.2.112', 61642) (509882e4-0903-4ac4-9f1b-e7828aaee1d2): Send encrypted: b'HTTP/1.1 204 No Content\r\n\r\n'
2021-12-29 21:53:54 DEBUG (MainThread) [pyhap.hap_protocol] ('192.168.2.112', 61642) (509882e4-0903-4ac4-9f1b-e7828aaee1d2): h11 Event: NEED_DATA
2021-12-29 21:53:54 DEBUG (MainThread) [pyhap.hap_protocol] ('192.168.2.112', 61642) (509882e4-0903-4ac4-9f1b-e7828aaee1d2): Recv decrypted: b'PUT /characteristics HTTP/1.1\r\nHost: Obyvacka\\032TV\\032D978C2._hap._tcp.local\r\nContent-Length: 50\r\nContent-Type: application/hap+json\r\n\r\n{"characteristics":[{"aid":1,"iid":15,"value":4}]}'
2021-12-29 21:53:54 DEBUG (MainThread) [pyhap.hap_protocol] ('192.168.2.112', 61642) (509882e4-0903-4ac4-9f1b-e7828aaee1d2): h11 Event: PAUSED
2021-12-29 21:53:54 DEBUG (MainThread) [pyhap.hap_protocol] ('192.168.2.112', 61642) (509882e4-0903-4ac4-9f1b-e7828aaee1d2): h11 Event: Request(method=b'PUT', target=b'/characteristics', headers=<Headers([(b'host', b'Obyvacka\\032TV\\032D978C2._hap._tcp.local'), (b'content-length', b'50'), (b'content-type', b'application/hap+json')])>, http_version=b'1.1')
2021-12-29 21:53:54 DEBUG (MainThread) [pyhap.hap_protocol] ('192.168.2.112', 61642) (509882e4-0903-4ac4-9f1b-e7828aaee1d2): h11 Event: Data(data=bytearray(b'{"characteristics":[{"aid":1,"iid":15,"value":4}]}'), chunk_start=False, chunk_end=False)
2021-12-29 21:53:54 DEBUG (MainThread) [pyhap.hap_protocol] ('192.168.2.112', 61642) (509882e4-0903-4ac4-9f1b-e7828aaee1d2): h11 Event: EndOfMessage(headers=<Headers([])>)
2021-12-29 21:53:54 DEBUG (MainThread) [pyhap.hap_handler] ('192.168.2.112', 61642): Request PUT for path '/characteristics': {'host': 'Obyvacka\\032TV\\032D978C2._hap._tcp.local', 'content-length': '50', 'content-type': 'application/hap+json'}
2021-12-29 21:53:54 DEBUG (MainThread) [pyhap.hap_handler] ('192.168.2.112', 61642): Set characteristics content: {'characteristics': [{'aid': 1, 'iid': 15, 'value': 4}]}
2021-12-29 21:53:54 DEBUG (MainThread) [pyhap.characteristic] client_update_value: RemoteKey to 4 (original: 4) from client: ('192.168.2.112', 61642)
2021-12-29 21:53:54 DEBUG (MainThread) [homeassistant.components.homekit.type_media_players] media_player.tv_obyvacka: Set remote key to 4
2021-12-29 21:53:54 DEBUG (MainThread) [pyhap.hap_protocol] ('192.168.2.112', 61642) (509882e4-0903-4ac4-9f1b-e7828aaee1d2): Send encrypted: b'HTTP/1.1 204 No Content\r\n\r\n'
2021-12-29 21:53:54 DEBUG (MainThread) [pyhap.hap_protocol] ('192.168.2.112', 61642) (509882e4-0903-4ac4-9f1b-e7828aaee1d2): h11 Event: NEED_DATA

Additional information

No response

@probot-home-assistant
Copy link

homekit documentation
homekit source
(message by IssueLinks)

@probot-home-assistant
Copy link

Hey there @bdraco, mind taking a look at this issue as it has been labeled with an integration (homekit) you are listed as a code owner for? Thanks!
(message by CodeOwnersMention)

@bdraco
Copy link
Member

bdraco commented Dec 30, 2021

The volume level or step is set via a service call for these

https://github.com/home-assistant/core/blob/dev/homeassistant/components/homekit/type_media_players.py#L290

@pavolholes
Copy link
Author

pavolholes commented Dec 30, 2021

Hi @bdraco , I'm not sure if that meant that I should enable full HA debug and provide more logs, but I've done that.
During the debugging I've done via Remote widget these steps:

  • tap arrow_down 3x
  • tap media_play_pause 3x
  • push volume_down 3x
  • push volume_up 3x
  • tap arrow_up 3x

In the log I see debug log lines Set remote key to for all taps. But the debug logs for the push of the buttons Step volume by are not there.

2021-12-30 22:19:06 DEBUG (MainThread) [homeassistant.components.homekit.type_media_players] media_player.tv_obyvacka: Set remote key to 5
...
2021-12-30 22:19:06 DEBUG (MainThread) [homeassistant.components.homekit.type_media_players] media_player.tv_obyvacka: Set remote key to 5
...
2021-12-30 22:19:07 DEBUG (MainThread) [homeassistant.components.homekit.type_media_players] media_player.tv_obyvacka: Set remote key to 5
...
2021-12-30 22:19:08 DEBUG (MainThread) [homeassistant.components.homekit.type_media_players] media_player.tv_obyvacka: Set remote key to 11
...
2021-12-30 22:19:08 DEBUG (MainThread) [homeassistant.components.homekit.type_media_players] media_player.tv_obyvacka: Set remote key to 11
...
2021-12-30 22:19:09 DEBUG (MainThread) [homeassistant.components.homekit.type_media_players] media_player.tv_obyvacka: Set remote key to 11
...
2021-12-30 22:19:13 DEBUG (MainThread) [homeassistant.components.homekit.type_media_players] media_player.tv_obyvacka: Set remote key to 4
...
2021-12-30 22:19:13 DEBUG (MainThread) [homeassistant.components.homekit.type_media_players] media_player.tv_obyvacka: Set remote key to 4
...
2021-12-30 22:19:14 DEBUG (MainThread) [homeassistant.components.homekit.type_media_players] media_player.tv_obyvacka: Set remote key to 4

Here is the debug log:
home-assistant.log

Would that mean that the Remote widget is not sending the press of the hardware volume buttons to HomeKit?

Thanks!

EDIT:
If I understant correctly, this Recv decrypted: b'PUT /characteristics HTTP/1.1\r\nHost: Obyvacka is what was received by HomeKit from the iOS device. And with that message I was able to find only the taps which I mentioned above. So would that really mean that iOS device is not sending the presses of the volume buttons? 🤔

@bdraco
Copy link
Member

bdraco commented Jan 6, 2022

So would that really mean that iOS device is not sending the presses of the volume buttons?

That is what is appears is happening.

@pavolholes
Copy link
Author

That is what is appears is happening.

And do youm, please, have any clue why is it happening? Or where I should start investigating? Is that because of my Samsung TV integration? Or is that because the volume press is not monitored by the event in Home Assistant? I have no clue what to do now to make it work 😪 Thanks in advance.

@bdraco
Copy link
Member

bdraco commented Jan 14, 2022

Honestly I don't have enough information to guess how to debug this since Apple doesn't provide docs for the television accessory unless you are MFI certified

@bdraco
Copy link
Member

bdraco commented Feb 7, 2022

We just added diagnostics for HomeKit which may help figure this out.

Can you try updating to 2022.2.3 and send diagnostics for the config entry ?

@pavolholes
Copy link
Author

Sure, it's awesome new function 🚀. Please see the diagnostics attached :)
config_entry-homekit-35b04e47978358cf94f0b5c7543e0661.json.txt

@bdraco
Copy link
Member

bdraco commented Feb 8, 2022

              {
                "iid": 55,
                "type": "E9",
                "perms": [
                  "pr",
                  "ev"
                ],
                "format": "uint8",
                "valid-values": [
                  0,
                  1,
                  2,
                  3
                ],
                "value": 1
              },
              {
                "iid": 56,
                "type": "EA",
                "perms": [
                  "pw"
                ],
                "format": "uint8",
                "valid-values": [
                  0,
                  1
                ]
              },

So the VolumeSelector (EA) and VolumeControlType (E9) look like they are there.

@bdraco
Copy link
Member

bdraco commented Feb 8, 2022

Here is what an certified device shows

{
					"iid": 25,
					"type": "00000113-0000-1000-8000-0026BB765291",  # Speaker
					"primary": false,
					"hidden": false,
					"linked": [],
					"characteristics": [{
							"iid": 26,
							"type": "00000119-0000-1000-8000-0026BB765291",  # Volume
							"format": "uint8",
							"value": 20,
							"perms": [
								"pr",
								"pw",
								"ev"
							],
							"ev": false,
							"unit": "percentage",
							"minValue": 0,
							"maxValue": 100,
							"minStep": 1
						},
						{
							"iid": 27,
							"type": "0000011A-0000-1000-8000-0026BB765291",  # Mute
							"format": "bool",
							"value": 0,
							"perms": [
								"pr",
								"pw",
								"ev"
							],
							"ev": false
						},
						{
							"iid": 28,
							"type": "000000B0-0000-1000-8000-0026BB765291",  # Active
							"format": "uint8",
							"value": 1,
							"perms": [
								"pr",
								"pw",
								"ev"
							],
							"ev": true,
							"minValue": 0,
							"maxValue": 1,
							"minStep": 1
						},
						{
							"iid": 29,
							"type": "E9",  # VolumeControlType
							"format": "uint8",  
							"value": 3,
							"perms": [
								"pr",
								"ev"
							],
							"ev": false,
							"minValue": 0,
							"maxValue": 3,
							"minStep": 1
						},
						{
							"iid": 30,
							"type": "EA",  # VolumeSelector
							"format": "uint8",
							"perms": [
								"pw"
							],
							"minValue": 0,
							"maxValue": 1,
							"minStep": 1
						}
					]
				},

@bdraco
Copy link
Member

bdraco commented Feb 8, 2022

Here is how Home Assistant is presenting your device's speaker

          {
            "iid": 51,
            "type": "113",
            "characteristics": [
              {
                "iid": 52,
                "type": "11A",
                "perms": [
                  "pr",
                  "pw",
                  "ev"
                ],
                "format": "bool",
                "value": false
              },
              {
                "iid": 53,
                "type": "23",
                "perms": [
                  "pr"
                ],
                "format": "string",
                "value": "Obyvacka TV Volume"
              },
              {
                "iid": 54,
                "type": "B0",
                "perms": [
                  "pr",
                  "pw",
                  "ev"
                ],
                "format": "uint8",
                "valid-values": [
                  0,
                  1
                ],
                "value": 1
              },
              {
                "iid": 55,
                "type": "E9",
                "perms": [
                  "pr",
                  "ev"
                ],
                "format": "uint8",
                "valid-values": [
                  0,
                  1,
                  2,
                  3
                ],
                "value": 1
              },
              {
                "iid": 56,
                "type": "EA",
                "perms": [
                  "pw"
                ],
                "format": "uint8",
                "valid-values": [
                  0,
                  1
                ]
              },
              {
                "iid": 57,
                "type": "119",
                "perms": [
                  "pr",
                  "pw",
                  "ev"
                ],
                "format": "uint8",
                "minValue": 0,
                "minStep": 1,
                "unit": "percentage",
                "maxValue": 100,
                "value": 0
              }
            ]
          }

@bdraco
Copy link
Member

bdraco commented Feb 8, 2022

This is how volume is presented by Home Assistant for your device

..nothing here... since the device doesn't appear to support Volume

This is what an certified device looks like

{
							"iid": 26,
							"type": "00000119-0000-1000-8000-0026BB765291",  # Volume
							"format": "uint8",
							"value": 20,
							"perms": [
								"pr",
								"pw",
								"ev"
							],
							"ev": false,
							"unit": "percentage",
							"minValue": 0,
							"maxValue": 100,
							"minStep": 1
						},

@bdraco
Copy link
Member

bdraco commented Feb 8, 2022

I think the supported_features includes mandatory SUPPORT_VOLUME_MUTE, SUPPORT_VOLUME_SET and SUPPORT_VOLUME_STEP bits. Here is the TV entity info:

So volume is only added if

            if features & SUPPORT_VOLUME_SET:
                self.chars_speaker.append(CHAR_VOLUME)

@pavolholes
Copy link
Author

pavolholes commented Feb 14, 2022

Hi @ollo69,
I don't know if I can do anything to fix the issue or something needs to be changed in your SamsungTV Smart Component. Can you please look at Nick's findings above and let me know if I can help? This issue is child of the ollo69/ha-samsungtv-smart#96.
Thanks!
@bdraco thanks a lot for the analysis!

@glassbase
Copy link

This may be related or not.

My volume control via iOS remote works fine for about a day, then is either extremely delayed (30+ seconds) or stops working completely until I reboot HA.

Power and source changing continues to work via Apple Home app during this time. Volume control continues to work via HA media player card, so it’s not a matter of an issue between HA and the TV.

I have one HomeKit hub being an Apple TV 4K connected via Ethernet.

(I’m mobile right now, but will capture some logs)

@glassbase
Copy link

glassbase commented May 12, 2022

EDIT:
Of course, this morning, a HA reboot did not resolve like it has been for a few weeks.
Even stranger is one of my TVs is working via iOS Remote widget volume control, but 2 others are not. Will continue to investigate.

Living Room TV diagnostics (this TV is not working)
config_entry-homekit-f4419042382b1ae10fa90ddeeadd78c9.json.txt

Sofia TV diagnostics (working)
config_entry-homekit-b5529fcffbfb8208a3f26f5e6638324a.json.txt

EDIT 2:
Deleted the TV from Apple Home app, re-paired and is working for now.

@PurdieNZ
Copy link

PurdieNZ commented Aug 2, 2022

Was there any progress on this? I have a similar issue

@pavolholes
Copy link
Author

It started to work with update to 0.7.5 :)

95C387D5-D04E-4147-8A6C-7E25F61090CE

@ollo69
Copy link
Contributor

ollo69 commented Aug 27, 2022

Really good to know, but I don't think that is related to last component version. More probably is due to some changes in HA or eventually in your TV software.

@github-actions github-actions bot locked and limited conversation to collaborators Sep 26, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants