Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"tap_action" needs differently defined "entity_id" #13827

Open
3 tasks done
ildar170975 opened this issue Sep 20, 2022 · 14 comments
Open
3 tasks done

"tap_action" needs differently defined "entity_id" #13827

ildar170975 opened this issue Sep 20, 2022 · 14 comments

Comments

@ildar170975
Copy link
Contributor

ildar170975 commented Sep 20, 2022

Checklist

  • I have updated to the latest available Home Assistant version.
  • I have cleared the cache of my browser.
  • I have tried a different browser to see if it is related to my browser.

Describe the issue you are experiencing

Check these docs (https://www.home-assistant.io/dashboards/actions/#tap-action):

image

Means - I must define entity_id inside data section:

    tap_action:
      action: call-service
      service: input_boolean.toggle
      data:
        entity_id: input_boolean.test_boolean

But in practice I may use data, service_data, target:

type: entities
entities:
  - input_boolean.test_boolean
  - entity: sun.sun
    name: using data
    tap_action:
      action: call-service
      service: input_boolean.toggle
      data:
        entity_id: input_boolean.test_boolean
  - entity: sun.sun
    name: using service_data
    tap_action:
      action: call-service
      service: input_boolean.toggle
      service_data:
        entity_id: input_boolean.test_boolean
  - entity: sun.sun
    name: using target
    tap_action:
      action: call-service
      service: input_boolean.toggle
      target:
        entity_id: input_boolean.test_boolean

image

Seems that using data, service_data, target gives same result.
Probably we should use ONE method and it must be reflected in docs correspondingly.

Now check a picture-entities card:

type: picture-elements
elements:
  - type: state-badge
    entity: sun.sun
    tap_action:
      action: call-service
      service: input_boolean.toggle
      target:
        entity_id: input_boolean.test_boolean
    style:
      top: 10%
      left: 10%
  - type: state-badge
    entity: sun.sun
    tap_action:
      action: call-service
      service: input_boolean.toggle
      data:
        entity_id: input_boolean.test_boolean
    style:
      top: 10%
      left: 50%
  - type: state-badge
    entity: sun.sun
    tap_action:
      action: call-service
      service: input_boolean.toggle
      service_data:
        entity_id: input_boolean.test_boolean
    style:
      top: 10%
      left: 30%
  - type: service-button
    title: input_boolean.toggle (target)
    service: input_boolean.toggle
    target:
      entity_id: input_boolean.test_boolean
    style:
      top: 22%
      left: 50%
  - type: service-button
    title: input_boolean.toggle (data)
    service: input_boolean.toggle
    data:
      entity_id: input_boolean.test_boolean
    style:
      top: 27%
      left: 50%
  - type: service-button
    title: input_boolean.toggle (service_data)
    service: input_boolean.toggle
    service_data:
      entity_id: input_boolean.test_boolean
    style:
      top: 32%
      left: 50%
image: /local/images/test/white.jpg

image

The state-badge element works with data, service_data, target, the service-button works with service_data only (as it is described in docs).

Here a similar situation: we should use ONE method which must be documented in docs.

Describe the behavior you expected

See above

Steps to reproduce the issue

See above

What version of Home Assistant Core has the issue?

2022.9.5

What was the last working version of Home Assistant Core?

No response

In which browser are you experiencing the issue with?

Chrome 105.0.5195.127

Which operating system are you using to run this browser?

Win10x64

State of relevant entities

No response

Problem-relevant frontend configuration

No response

Javascript errors shown in your browser console/inspector

No response

Additional information

No response

@Mariusthvdb
Copy link
Contributor

Mariusthvdb commented Sep 20, 2022

yeah, since core frontend use of service_data: on actions was changed to data:, this should at least be consistent throughout all core Frontend cards:

on Picture elements https://www.home-assistant.io/dashboards/picture-elements/#service-call-button, please streamline that to data:

@ildar170975
Copy link
Contributor Author

ildar170975 commented Sep 20, 2022

since core frontend use of service_data: on actions was changed to data:

There must be ONE method since in other places like here it is using target:
image

It is confusing - using one syntax in Dev tools & automations, another in frontend.

@Mariusthvdb
Copy link
Contributor

yes, Frontend is a different beast than Backend. if that would be it, it would be ok-ish. But al least all Frontend should be consistent.
Backend is for the most part.

@ildar170975
Copy link
Contributor Author

Ideally, Dev tools should be useful for building Lovelace & building backend.
Here we can observe a scenario:

  1. I need to add a button with some service-call.
  2. Need to check this call first.
  3. Go to Dev tools -> Services -> select my service, select other data -> then "show as yaml" -> copy/paste into Lovelace.
  4. And the code may NOT work since there is a different syntax for frontend & backend. Luckily, currently frontend DOES support target & data (except service-button in piture-elements).

@github-actions
Copy link

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale label Jan 18, 2023
@ildar170975
Copy link
Contributor Author

Up

@github-actions github-actions bot removed the stale label Jan 19, 2023
@github-actions
Copy link

github-actions bot commented Jul 1, 2023

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale label Jul 1, 2023
@ildar170975
Copy link
Contributor Author

up

@github-actions github-actions bot removed the stale label Jul 10, 2023
@github-actions
Copy link

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale label Oct 18, 2023
@parautenbach
Copy link

.

@github-actions github-actions bot removed the stale label Oct 19, 2023
Copy link

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale label Jan 17, 2024
@ildar170975
Copy link
Contributor Author

up

Copy link

There hasn't been any activity on this issue recently. Due to the high number of incoming GitHub notifications, we have to clean some of the old issues, as many of them have already been resolved with the latest updates.
Please make sure to update to the latest Home Assistant version and check if that solves the issue. Let us know if that works for you by adding a comment 👍
This issue has now been marked as stale and will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the stale label Apr 16, 2024
@parautenbach
Copy link

.

@github-actions github-actions bot removed the stale label Apr 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants