custom-cards / button-card

❇️ Lovelace button-card for home assistant
MIT License
1.93k stars 233 forks source link

Sony Bravia Tv controls #720

Closed gozdagno closed 1 year ago

gozdagno commented 1 year ago

Is your feature request related to a problem? Please describe. Hi. I want to make a simple Remote for Sony Bravia TV. When I create the normal button to call the service, it works ok, but I can't get it to work with Custom buttons. I need it for placing buttons in the array, so they look similar to real life remote. When I press the custom button with code pasted from working normal button, it says required key not provided @ data 'command'. Any help would be great.

Describe the solution you'd like I would just be happy if the remote.send_command action works with Custom buttons.

Describe alternatives you've considered Custom buttons would be the best solution, as they are fully customiseable. There are some other remote integrations, but i want my custom one.

Additional context

xZetsubou commented 1 year ago

Don't use target and data keys use service_data for both. this should work for you:

type: custom:button-card
tap_action:
  action: call-service
  service: remote.send_command
  service_data:
    command: TvPower
    entity_id: remote.sony_xr_75x92j
entity: remote.sony_xr_75x92j
show_name: false
RomRider commented 1 year ago

Or use the latest beta which I just released, which supports both data and target :D

gozdagno commented 1 year ago

Don't use target and data keys use service_data for both. this should work for you:

type: custom:button-card
tap_action:
  action: call-service
  service: remote.send_command
  service_data:
    command: TvPower
    entity_id: remote.sony_xr_75x92j
entity: remote.sony_xr_75x92j
show_name: false

That works perfectly, thank you!