#Tuning TV channels using custom sentences

1 messages · Page 1 of 1 (latest)

dapper gorge
#

Does anyone know how to configure an option to go to any TV channel by saying the channel name in a custom sentence using media_content_id, but without configuring each channel per name?

rough terrace
#

I thing that you should check this document..this can probably be done by pointing to the channel names: https://www.home-assistant.io/voice_control/custom_sentences/#setting-up-sentences-in-the-config-directory
It's also worth taking a look here for a detailed description:
https://www.home-assistant.io/integrations/intent_script/

Home Assistant

Instructions on how to setup scripts to run on intents.

Home Assistant

Open source home automation that puts local control and privacy first. Powered by a worldwide community of tinkerers and DIY enthusiasts. Perfect to run on a Raspberry Pi or a local server.

dapper gorge
#

I already did that, and it doesn't work!

intent_script:
  ChangeChannel:
    speech:
      text: Changing the channel to {{ channel }}
    action:
      - service: media_player.play_media
        target:
          entity_id: media_player.lg_tv
        data:
          media_content_type: channel
          media_content_id: "{{ channel }}"

intents.yaml:

intents:
  ChangeChannel:
    - Turn to {channel}
    - Turn TV to {channel}
    - Turn the TV to {channel}
    - Turn the living room TV to {channel}
    - Turn living room TV to {channel}

configuration.yaml:

intent_script:
  ChangeChannel:
    speech:
      text: Changing the channel to {{ channel }}
    action:
      - service: media_player.play_media
        target:
          entity_id: media_player.lg_tv
        data:
          media_content_type: channel
          media_content_id: "{{ channel }}"
#

Unexpected error during intent recognition
Traceback (most recent call last):
File "/usr/src/homeassistant/homeassistant/components/assist_pipeline/pipeline.py", line 1015, in recognize_intent
conversation_result = await conversation.async_converse(
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

                 ^

File "/usr/local/lib/python3.12/site-packages/hassil/recognize.py", line 1107, in match_expression
raise MissingListError(f"Missing slot list {{{list_ref.list_name}}}")
hassil.recognize.MissingListError: Missing slot list {channel}

coral tendon
#

You need to define slot for "channel" field. Assist needs to know what's there in {channel}

dapper gorge
#

That's the last thing I did in my configuration:

intent_script:
  ChangeChannel:
    speech:
      text: Changing the channel to {channel}
    action:
      - service: media_player.play_media
        target:
          entity_id: media_player.lg_tv
        data:
          media_content_type: channel
          media_content_id: "{channel}"
    slot_lists:
      channel:
        - "Al Ahly"
        - "Al Arabiya"
        - "Al Jazeera"
        - "Al Jazeera Documentary"
        - "Al Jazeera English"
        - "Al Jazeera Mubasher"
        - "Al Masryia HD"
        - "Al Oula HD"
        - "Al Qahera News SD"
        - "ALASKANDARIA"
        - "Alhayat"
        - "BBC Arabic"
        - "beIN SPORTS"
        - "CBC"
        - "CBC Sofra"
        - "CNN"
        - "Dmc"
        - "Dubai One HD"
        - "ELMEHWAR"
        - "Maspero Zaman"
        - "MBC MASR"
        - "MBC 2"
        - "Misr Quran Kareem"
        - "Mix"
        - "ON E HD"
        - "ONTIME SPORTS HD"
        - "Rotana Cinema EGY"
        - "Rotana Classic"
        - "TeN TV"
#
conversation:
  intents:
    ChangeChannel:
      - Turn to {channel}
      - Turn TV to {channel}
      - Turn the TV to {channel}
      - Turn the living room TV to {channel}
      - Turn living room TV to {channel}
      - Change to {channel}
      - Change TV to {channel}
      - Change the TV to {channel}
      - Change the living room TV to {channel}
      - Change living room TV to {channel}
      - Tune to {channel}
      - Tune TV to {channel}
      - Tune the TV to {channel}
      - Tune the living room TV to {channel}
      - Tune living room TV to {channel}
coral tendon
#

It looks incorrect. Did you do it with ChatGPT?

dapper gorge
#

I actually asked it, yes

dapper gorge
#

As I checked the document also

dapper gorge
#

I corrected it but encountered a different error: