frontend
frontend copied to clipboard
"tap_action" needs differently defined "entity_id"
Checklist
- [X] I have updated to the latest available Home Assistant version.
- [X] I have cleared the cache of my browser.
- [X] 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):
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
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
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
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:
since core frontend use of
service_data:
on actions was changed todata:
There must be ONE method since in other places like here it is using target
:
It is confusing - using one syntax in Dev tools & automations, another in frontend.
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.
Ideally, Dev tools should be useful for building Lovelace & building backend. Here we can observe a scenario:
- I need to add a button with some
service-call
. - Need to check this call first.
- Go to Dev tools -> Services -> select my service, select other data -> then "show as yaml" -> copy/paste into Lovelace.
- 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).
this issue (i don't know when it started allso prevents automatic dashboard and visual editor from working
in fact if i use visual editor it writes the code like this
but as you can see it doesn't work
and i have to manually rewrite it like this
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.
Up
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.
up
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.
.
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.
up
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.
.
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.