I want to create a conditional card in Lovelace that displays a remote with only the relevant buttons showing based on which activity was selected. However, I seem to only test if the state of remote.harmony_hub is on or off. I would like to test if the current_activity is Watch TV or what ever the current_activity is.
I installed the Harmony integration from the Integration tab and did not config it in the configuration.yaml.
You would then be able to adjust your conditional card visibility using this sensor.
An alternative custom card is the states switch card, probably better suited to this application as it supports showing multiple cards for multiple states. You can use the template sensor or put the template directly in this card.
Thanks, I was looking into this as a way to go, your posting convinces me I need to try it out.
Ultimately, I want to create a remote for the TV in Lovelace that only presents button options for what you activity you set. My wife wants something she doesn’t need a training session to use.
tom_l your sensor suggestion work like a charm. So now I managed to use the Service developer tools to verify the syntax for turning on my TV system to the Watch TV activity; and I can also turn it off.
So I decided to test the code in a simple card but for some reason, I can’t get it to work in a simple button-card just to test my code.
icon: 'mdi:power'
name: Power On
tap_action:
action:
service: remote.turn_on
entity: remote.harmony_hub
service data:
entity_id: remote.harmony_hub
activity: Watch TV
type: 'custom:button-card'
I’ve tried several different variants of the above code and nothing works.
I had first used service_data: and when that didn’t work I changed it to what you see which also didn’t work so that is when I posted. I know it is some little thing that I’m missing because it does work when I use the developer tools to call the service.
Mar16 impressive and a lot more than I had started out to do. Now you have given me some thoughts on how/what can be implemented. I definitely will be studying your post.