Home Assistant - Button Entities as activity commands or key mappings

Would it be possible for a Home Assitant button entity to be useable as a command in an activity. I have a SkyQ Satellite box, the remote control commands are media_player service commands that are not available in the remote UI. However I could link each service call to a button entity. The button entity is available in the remote UI, but I can’t use it as a command within the UI, I think it possibly appears as a blank “available command” but I can’t choose it. Hope this makes sense ?

I had the same problem, not be able to use the button entity so i created a bug report here: Home Assistant "input_button" entity type (simple button) not working · Issue #13 · unfoldedcircle/bug-reports · GitHub

Can you assign a Home Assistant script to a remote button? If so, you could have a HA script for each remote control command and then assign that script to a remote button. Since you were apparently going to have to assign them to something anyway, that shouldn’t be too much more work.

I don’t think that’s possible, but I’d love someone to tell me I’m wrong and tell me how to do it.

I really hope it’s possible, because it’s the only way I’m going to be able to get this remote to work in my environment. Since you can’t change the physical remote to a different layout via API, I need a way to dynamically assign an action to a key based on stuff in HA. That means a script? Why do I need that? Because I have some things that run that can change the state of my media devices based on other inputs, and if I can’t change the remote to match then I need to leave the remote static and have HA know what state things are in and act accordingly. I know this is a bit of an edge case, as the Unfolded Circle folks have been clear that this a thing that controls other things, not something that responds to other things. But without one of these two, I’ll end up having to pass on this remote. It’ll be useless for me.

I didn’t back it, so I’m waiting for pre-ordering to happen. Hopefully that’ll give things some time to change in ways that are useful for me.

1 Like

Yes, you can associate a HA script with a physical button. This is how I have mapped the buttons to my AppleTV, AVR, Blu-ray, etc based upon the current activity.

Today I tested the HA connection with Android TV (MI TV) and remote2.
It is possible to map everything with HA. In HA, you need to write scripts to run a given function: for example, script from volume_up:

  • service: remote.send_command
    command: VOLUME_UP
    num_repeats: 1
    delay_secs: 0.4
    hold_secs: 0
    device_id: 23100479d0d384937fbe9d5cb1875ade

then you need to create a “volume_up_tv” switch that runs this script. sample yaml code for switch to volume_up_tv:

  • platform: template
    service: script.volume_up_salon
    service: script.volume_up_salon

Then all that remains is to map the appropriate physical keys or commands from the interface to the activity.
Of course, these are examples of quickly made scripts. You have to adapt them to your needs.

Yes, I’ve done similar to this.
A button instead of a switch might be more logical, but I’m sure it doesn’t make a big difference, or a switch that goes auto-off.

I’ve associated some of my scripts to the physical buttons without creating a HA button/switch entity. Simpler, but you have to be mindful of tracking your device state(s).