Issues with Harmony remote and Lovelace Picture Elements Card

Noob here…I am trying to create the ability to click on my TV in the photo of my living room and have it turn on the “Watch TV” activity in Harmony. Ideally, I could toggle it off, but I would at least like to get this part working before I get too fancy lol.

In my ui-lovelace.yaml, I have the following:

- icon: mdi:home
    title: Test
    cards:
     - type: custom:plan-coordinates  
      - type: picture-elements
        image: /local/images/living-room.png
        elements:
          - type: state-icon
            tap_action: toggle
            entity: light.fireplace_hue
            style:
              top: 20%
              left: 65%
          - type: state-icon
            tap_action: toggle
            entity: light.couch_hue
            style:
              top: 68%
              left: 9%
          - type: state-icon
            tap_action: toggle
            entity: light.window_hue
            style:
              top: 41%
              left: 8%
              
          - type: service-button
            title: TV
            service: remote.turn_on
            entity_id: remote.harmony_hub
            data:
             activity: "Watch TV"
            #tap_action: call-service
            style:
              top: 40%
              left: 88%            
              
          - type: state-label
            entity: binary_sensor.liquor_cabinet
            style:
              top: 90%
              left: 95%
          - type: service-button
            title: ALL OFF
            style:
              top: 98%
              left: 90%
            service: light.turn_off
            #data:
            entity_id: 
              - light.fireplace_hue
              - light.couch_hue
              - light.window_hue
          - type: icon
            icon: mdi:home
            tap_action: navigate
            navigation_path: /lovelace/0
            style:
              top: 5%
              left: 5%

Everything else works according to plan, except for the harmony portion. My config.yaml has the following for harmony:

remote:
 - platform: harmony
    name: Harmony Hub 
    #activity: Watch TV

Any help getting this working would be much appreciated.

First, you should learn how to format code when posting here. The spacing/format is removed when you don’t do it properly. Just take a look at your post, you have bullets everywhere. To format properly, click on the link in the blue ribbon that’s at the top of every post.

Second, this post here pretty much sums up how to add lovelace buttons for harmony.

Sorry about the formatting issues. Should be fixed now. I looked at the link, and that makes a lot of sense for more complex actions. Is there a way to simply turn the TV on and/or off in the Lovelace yaml file as I’ve attempted above?

Is there something wrong with this code?

      - type: service-button
        title: TV
        service: remote.turn_on
        entity_id: remote.harmony_hub
        data:
         activity: "Watch TV"
        #tap_action: call-service
        style:
          top: 40%
          left: 88%

I know it sound trivial but… you’re missing a space before activity. I know, I know… but it will mess things up.

That should work but it will not show the state of it being on. The only thing you are missing is the entity_id inside the data.

      - type: service-button
        title: TV
        service: remote.turn_on
        entity_id: remote.harmony_hub
        data:
          entity_id: remote.harmony_hub
          activity: "Watch TV"
        #tap_action: call-service
        style:
          top: 40%
          left: 88%

Just to warn you, if you have more than 1 service-button that calls out a different activity, when you turn 1 on, all will appear to be on. This is because the entity_id you are referencing for the state is ‘remote.harmony_hub’. If you want the buttons to appear on individually, you’ll need to implement what I posted in the link. It’s actually the reason I posted it.

I get the following error:

Log Details (ERROR)

Tue Dec 04 2018 14:29:15 GMT-0600 (CST)

No activity specified with turn_on service