question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

How to pass `target` when calling a service?

See original GitHub issue

I believe recent Home Assistant versions added support for target when calling a service:

However, I can’t find a way to do so when using this custom component. The following example works in the developer tools page:

service: light.turn_on
data:
  transition: 60
  color_temp: 450
  brightness_pct: 100
target:
  entity_id:
    - light.foo
    - light.bar

And the following code works using the built-in buttons type:

type: entities
entities:
  - type: buttons
    entities:
      - entity: light.bedroom_lights
        name: 1min
        icon: 'mdi:lightbulb-on'
        tap_action:
          action: call-service
          service: light.turn_on
          service_data:
            transition: 60
            color_temp: 450
            brightness_pct: 100
          target:
            entity_id:
              - light.bedroom_lights
              - light.foobar
…

But I am unable to add target to custom:paper-buttons-row.

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:1
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
denilsonsacommented, Mar 15, 2021

Interestingly it’s not listed on Home Assistants action docs

Yep, I’ve already reported it: https://github.com/home-assistant/home-assistant.io/issues/16992

0reactions
ristomatticommented, Dec 17, 2021

@denilsonsa If you’d like to help, you could test if my changes work as you’d expect. I set up my so that it can be installed as a custom HACS repository (for personal testing purposes) https://github.com/ristomatti/lovelace-paper-buttons-row

Read more comments on GitHub >

github_iconTop Results From Across the Web

how to pass e.target value when i call the same function ...
Then you just invoke this checkValidation function whenever you need to validate something. Remember to refactor your code in events object.
Read more >
Target Endpoint/Server callout - Google Cloud Community
Solved: I need to make a callout to Target Endpoint or Target Server in one of my flows and apply load balancing rules....
Read more >
Service Calls - Home Assistant
Passing data to the service call. You can also specify other parameters beside the entity to target. For example, the light.turn_on service allows ......
Read more >
PutTargets - Amazon EventBridge - AWS Documentation
Set that account's event bus as a target of the rules in your account. To send the matched events to the other account,...
Read more >
FAQs - Jobs at Target
Login to Workday, select the “Career” app from the home page, then “Careers at Target – Current Job Openings” to view and apply...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found