Adding Harmony buttons to toggle activities with Lovelace

I’m trrying to add a Lovelace button that turn on a given harmony activirty. Right now, it only turns on the default activity even when I specify another one like this:

- type: entity-button
        service: remote.turn_on
        activity: "Watch PC"
        entity: remote.studio_hub
        tap_action: call-service
        data:
          activity: "Watch PC"

What’s the correct syntax for just turning on an activity other than the default? I’ve tried a few different ways of specifying the activity (by number, without the data: prefix) and it still doesn’t work. No errors appear and it just launches the default activity.

I suggest you read the entity-button docs. You seem to be adding random config items and should troubleshoot any service-calls using the Services in Developer tools

- type: entity-button
            name: play switch
            icon: mdi:gamepad
            entity: [remote.studio_hub]
            tap_action:
              action: call-service
              service: remote.turn_on
              service_data:
                entity_id: remote.studio_hub
                activity: "Play Switch"
1 Like

this is a link to a setup I used in the past, it’s outdated from what I currently use but it should be what you are looking for.

The general idea behind it is to make template switches that act as radio buttons. I.E only 1 can be on at a time. This is covered in the link. Once you have those template switches, those are what you use in lovelace. Place them into a picture glace and you’ll have a nice end product.

EDIT: You can ignore all the receiver stuff in the link and focus on the harmony remote items.

Hi @petro, could You be so kind to tell/share what setting to use Harmony remote You currently use?
I am trying to work-out missing harmony toggle service with script but maybe there is better solution.

I’m not sure what you mean. Setting in harmony or setting in the harmony integration?

@petro Your settings in HA to control Harmony devices.

There are no settings… it’s an IP address, that’s it. What do you mean by settings?

Code that enable turn on/off devices. It works great using Logitech Harmony Integration for remote.turn_on/off but I am looking for possibilities to toggle (as it is implemented in Harmony).
E.g. while activity A is power-on, clicking activity B is turning off activity A and turning on activity B.
I saw that You were implementing this in You project by templating switches. I was wonder do You change something in that. I am looking how to implement it by script.

Yep, all that code is in the link I posted.

hey all

new to this discussion and to HA all together.
i m here cause i struggle with the basics of getting any command that is not the “default last scene” to work.
i tried coping with what i found posted - but no luck.
could someone plz give me the “idiot proof” instruction that i obviously need…? :slight_smile:
on the devoloper tools i can use the services tab, with:
service: remote.toggle
and the
entity_id: remote.harmony_bedroom
i was able to add to the “service data”
activity: Watch bedroom TV
to actually start that scene.

i also got the config file for the 2 hubs i added (if that helps)
any other instructions will be appriciated
:slight_smile:
thanks

You can’t use remote.toggle. You have to use remote.turn_on with the activity to turn on. And remote.turn_on with PowerOff as the activity to turn off said activity. Check out the link I posted above, it goes into specific configurations to make it so you can have a switch to turn on and off the activity.

ohhh i know that thread…

and i envy you for it… :innocent:

ok, so first - thanks for the reply.

now ill move over there, try it out again, and write to you there if (lets be serious - its more like… “when”) ill need more help…

Hey.
Could someone please help me to configurate all of this so i can make a “remote control” in HA to control my tv setup.

Today i can turn volume up/down, and change channel, and turn a activity on and off.

But i cant change inputs ect.

would really appriciate all the help i can get