-
|
I have not been able to find an answer to this but I would like to have multiple actions tied to a single button press. For example, if I hit the netflix icon, I want to the tv to power on if its off and switch to netflix. I understand I can do this with a single action by recalling a script but I dont feel like creating a script for every button on every remote card I have. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
|
The best way to do this is using a script with variables. The script: alias: Turn On TV and Open App
sequence:
- action: remote.turn_on
metadata: {}
data:
target:
entity_id: remote.lounge_google_tv
- action: remote.turn_on
metadata: {}
data:
activity: "{{ app }}"
target:
entity_id: remote.lounge_google_tv
description: ""The custom action: type: button
name: netflix
icon: mdi:netflix
tap_action:
action: perform-action
perform_action: script.turn_on
target:
entity_id: script.turn_on_tv_and_open_app
data:
variables:
app: netflix://You can use the default sources lists to get the information needed to open different apps. You may need to tweak the script and add delays between the turn on TV and open app actions. |
Beta Was this translation helpful? Give feedback.
-
|
Or as an alternative to scripts, you can use the this.hass.callService('remote', 'turn_on', { entity_id: "remote.lounge_google_tv" }).then(() => {
this.hass.callService('remote', 'turn_on', { entity_id: "remote.lounge_google_tv", activity: "netflix://" })
})This is a bit more hacky than using a script with variables, but it's completely contained within the card. You still may have to add some logic to add a delay between the two commands. |
Beta Was this translation helpful? Give feedback.
The best way to do this is using a script with variables.
The script:
The custom action:
You can use the default sources lists to get the information needed to open different apps. Y…