Share your Lovelace Home Theater Remote Setup

I am kind of surprised this thread doesn’t exist already. I’m starting to create a Lovelace UI to control my home theater system which includes a harmony remote, TV, AVR, Chromecast and Chromecast audio, U-Verse tv box, DVD player, and Kodi. This my very, very basic setup for the moment but I know some of you have very elaborate setups and I am looking for inspiration to improve mine.

EDIT:
Since posting this I have been inspired to improve my setup and this is how it currently looks.
I took the screenshots on a phone this time because that is the main way I will be using the remotes.
The first screenshot is of the remote in the off state. It shows a simplified view just displaying the Harmony Activities.


Then when you select an activity the input selector Media Mode changes to display the correct remote menus, like this simple one for the Chromecast.

This just shows the volume control and Chromecast controls.
A similar setup is used for the Listen to Music Activity. A few chromecast audios are used one connected to the AVR and the others connected to always on speakers in different rooms. This setup is slightly different and allows the user to play a set of 6 playlists to the Chromecast Audio Group. This is done with the SpotCast custom component and Scripts.

The DVD and VCR remotes are also fairly straightforward giving the user control over the basic player functions through the Harmony commands.

The last setup is the most complicated because of the number of buttons needed to operate the AT&T box. For this I use a second input selector to change between the the different remote modes:




Here is a link to the yaml: https://pastebin.com/RBgqHwKS
Also the Kodi remote is not shown because it is currently not in use but will probably look similar to the AT&T TV remote setup.

10 Likes

Would you mind sharing the Kodi elements?

The Kodi API bakes my brain sometimes with the length of the calls but I always wanted to put some simple controls for it on my front end besides iframing the Chorus page!

I actually don’t have any of the kodi controls in yet because I just starting this build UI remote. That being said I might just use my Harmony Hub to control the Kodi over Bluetooth and not control the Kodi directly. However I will update this when i have a more complete setup.

Cheers :slight_smile: I must try something similar on mine!

Mind showing your harmony setup. I still haven’t been able to figure out how to create buttons to control the harmony hub. Here is my home theater lovelace ui so far…

I follow the guide below to get buttons to control my harmony hub. But it basically entails creating a binary-sensor that looks for the press of the UI button that can then trigger any service command. I then just use it to trigger each of the Harmony command services that I need.
Here is the yaml for a basic volume control: Harmony Remote YAML - Pastebin.com
That is just using the glance card but my screenshot above used the custom button card.
The Device ID and command label can be found in the config/[harmoney_hub].config file.

Correction: I used the above post to get started but then i also reference this guide: AV Remote Card | Share the love

1 Like

Dr I’d you use the lovelace editor? That’s what I’m trying to figure out how to use because it will make changes easier going forward.

I don’t quite understand what you are asking

Using the new lovelace UI editor.

Great idea! Now I get to humble brag about my setup again. I keep the Home Assistant dashboard simple and remove If you have a TV and AV receiver supported by Home Assistant, you can track power state, input and create some really cool automations. Logitech Harmony is no longer needed in my setup.

  • Power state is reflected in the button cards. Green means the device is turned on. In this case, the AV receiver and TV are both on.
  • THe buttons Xbox, Ps4, Switch initiate a script to turn on receiver and TV and switch to correct inputs. It’s basically like the Logitech Harmony function. Buttons are highlighted if it detects if the AV receiver and TV are on the appropriate input.
  • On the right column, I can see what is currently playing on the TV, receiver, smart display and Google Home speakers. I use the Playstation4 component to display current game playing
3 Likes

Oh I see! Unfortunately the Harmony tie in doesn’t give you straight forward control in terms of being able to add buttons or anything. If you copy my code above and use the ‘Manual Card’ option then substitute the device id field and the commands.Oh and you will need to change the Binary Sensor to match yours as well, or just create a binary sensor with the same name.

a different take… use google home/IFTTT to turn amp and projector on via broadlink blackbean mini, and android box on via wakeonlan. Then yeelight lightstrip.

normal remote is used to control kodi, but the lightstrip will fade/brighten depending on what is happening…

script.yaml

movietime:
  sequence:
    - service: switch.turn_on
      entity_id:
        - switch.yamaha_amp_power
        - switch.benq_proj_power
    - service: light.turn_on
      data:
        entity_id: light.rupusstriplight
        transition: 9
        brightness: 255
    - service: wake_on_lan.send_magic_packet
      data:
        mac: d0:76:58:0b:e6:8a
        broadcast_address: 192.168.1.255
    - delay:
        seconds: 15
    - service: switch.turn_on
      entity_id:
        - switch.yamaha_amp_dtv
    - service: light.turn_on
      data:
        entity_id: light.rupusstriplight
        transition: 1
        effect: "Twitter"
    - service: tts.google_say
      data:
        entity_id: media_player.rumpas_room
        message: 'Ready to Go!'
    - delay:
        seconds: 5
    - service: switch.turn_on
      entity_id:
        - switch.benq_proj_mute

startmovie:
  sequence:
    - service: tts.google_say
      data:
        entity_id: media_player.rumpas_room
        message: 'Enjoy the film!'
    - service: light.turn_off
      data:
        entity_id: light.rupusstriplight
        transition: 5

automations.yaml

- alias: 'LIGHT: turn UP the strip light when Kodi pauses for at least 3 seconds'
  initial_state: true
  trigger:
    - platform: state
      entity_id: media_player.m8spro_kodi
      to: 'paused'
      for:
        seconds: 3
  action:
    - service: light.turn_on
      data:
        entity_id: light.rupusstriplight
        transition: 5
        profile: 'relax'

- alias: 'LIGHT: turn ON the strip light when Kodi goes from play to idle for at least 3 seconds'
  initial_state: true
  trigger:
    - platform: state
      entity_id: media_player.m8spro_kodi
      from: 'playing'
      to: 'idle'
      for:
        seconds: 3
  action:
    - service: light.turn_on
      data:
        entity_id: light.rupusstriplight
        transition: 5
        profile: 'reading'

- alias: 'LIGHT: turn ON the strip light when Kodi goes from paused to idle for at least 3 seconds'
  initial_state: true
  trigger:
    - platform: state
      entity_id: media_player.m8spro_kodi
      from: 'paused'
      to: 'idle'
      for:
        seconds: 3
  action:
    - service: light.turn_on
      data:
        entity_id: light.rupusstriplight
        transition: 5
        profile: 'reading'

- alias: 'LIGHT: turn OFF the strip light when Kodi starts playing'
  initial_state: true
  trigger:
    - platform: state
      entity_id: media_player.m8spro_kodi
      to: 'playing'
  action:
    - delay:
        seconds: '2'
    - service: light.turn_off
      data:
        entity_id: light.rupusstriplight
        transition: 5

Currently I just use the mini media player with buttons that execute Harmony remote scripts. While currently simple I have the scripts already made for any Harmony function, but I need to be inspired as you mentioned in the op

Here’s a sample screenshot from my Harmony remote setup:

Thread with more information and a link to my full setup:

7 Likes

Using a Broadlink RM mini3 wired on my ceiling to control my logitech speakers (vol/source) and samsug TV.
Tv controls also work on firestick 4k and kodi through HDMI-CEC

Lastly kodi http commands for kodi operation through http api.
In order to be able to select more kodi devices depending on room and device IP, i have set up this input_select and template_sensor:


input_select:
  kodi_device:
    name: Kodi Device
    options:
      - Living Room
      - Bed Room
      - Backup
      - PC
      
sensor:
  - platform: template
    sensors:
      kodi_control_ip:
        friendly_name: "Kodi Ip Address"
        value_template: >-
          {% if is_state("input_select.kodi_device", "Living Room") %}
            xxx.xxx.xxx.xxx
          {% elif is_state("input_select.kodi_device", "Bed Room") %}
            xxx.xxx.xxx.xxx
          {% elif is_state("input_select.kodi_device", "Backup") %}
            xxx.xxx.xxx.xxx
          {% elif is_state("input_select.kodi_device", "PC") %}
            xxx.xxx.xxx.xxx
          {% endif %}

My shell commands are written in this manner in order to change depending on the above template_sensor value:

shell_command:
  kodi_up: 'curl -u "UN:PW" --header "Content-Type: application/json" --data "{\"jsonrpc\":\"2.0\",\"method\":\"Input.Up\"}" "http://{{states.sensor.kodi_control_ip.state}}:8080/jsonrpc"'

The specific IR commands for my samsung inputs were found here.
Just sharing again cause it took me some digging to find the ones working for my TV.

They do work to enable the source directly but, unfortunately, because of the fact that the TV creates new (duplicate) sources when a cec device is connected (ie hdmi2 and firestick-CEC device) the direct source commands take me to the simple hdmi source and do not enable cec control. So i still have to manually browse to select the cec option.

1 Like

Cool, and I just moved the light strip last night (falling off behind a radiator) - so this will do nicely for a new job under the TV stand :slight_smile:

Cheers!

I really like this idea actually! I might add this for audio controls when watching the chromecast! Thanks for the idea.

Mine is very plain lovelace but it works! remote is a mixture of harmony hub and some custom scripts for manipulating my PS4 via the ps4 component.

I’m interested in your Samsung TV config.
Any chance of posting the Lovelace and (more importantly) the scripts behind the buttons?

Thanks.

Here is a link to my lovelace remote card: https://gist.github.com/gavindsilver/fedfba71d571dc05d14b80f0e52b4d10

and it looks like i just have the one script to turn on the ps4 and then change the media player source of the ps4 via media player select source to “netflix”: (requires ps4 component)

'1557274579907':
  alias: PS4 Start Netflix
  sequence:
  - data:
      entity_id: media_player.playstation_4
    service: media_player.turn_on
  - wait_template: '{{ is_state(''media_player.playstation_4'', ''on'') }}'
  - data:
      entity_id: media_player.playstation_4
      source: Netflix
    service: media_player.select_source
2 Likes