Olá.
Obrigado @Gatoricardo e @Peixeiro pela partilha, adaptei o comando à minha box e está a funcionar na perfeição.
Subi um pouco a fasquia e “ensinei” a Alexa a mudar o canal pelo nome (apenas os que consumimos cá em casa). Deixo o meu contributo:
input_booleans para trigger dos canais:
eurosport:
name: Eurosport
icon: mdi:remote-tv
eurosport_2:
name: Eurosport 2
icon: mdi:remote-tv
disney_channel:
name: Disney Channel
icon: mdi:remote-tv
cartoon_network:
name: Cartoon Network
icon: mdi:remote-tv
nickelodeon:
name: Nickelodeon
icon: mdi:remote-tv
disney_junior:
name: Disney Junior
icon: mdi:remote-tv
canal_panda:
name: Canal Panda
icon: mdi:remote-tv
hollywood:
name: Hollywood
icon: mdi:remote-tv
fox_movies:
name: FOX Movies
icon: mdi:remote-tv
axn_movies:
name: AXN Movies
icon: mdi:remote-tv
fox:
name: FOX
icon: mdi:remote-tv
fox_comedy:
name: FOX Comedy
icon: mdi:remote-tv
axn:
name: AXN
icon: mdi:remote-tv
discovery:
name: Discovery
icon: mdi:remote-tv
historia:
name: História
icon: mdi:remote-tv
national_geographic:
name: National Geographic
icon: mdi:remote-tv
twenty_four_kitchen:
name: Twenty Four Kitchen
icon: mdi:remote-tv
Script para enviar o número do canal para a TV:
alias: "Meo: Chanel selection"
sequence:
- alias: Check for triple digit
if:
- condition: template
value_template: "{{chanel_number // 100 > 0}}"
alias: "> 99"
then:
- action: remote.send_command
metadata: {}
data:
command: "{{ chanel_number // 100 }}"
target:
entity_id: remote.meobox_4k_diw3930
alias: Send hundreths digit
- alias: Check for double digit
if:
- alias: "> 10"
condition: template
value_template: "{{ (chanel_number % 100) // 10 > 0}}"
then:
- alias: Send tens digit
action: remote.send_command
metadata: {}
data:
command: "{{ (chanel_number % 100) // 10 }}"
target:
entity_id: remote.meobox_4k_diw3930
- action: remote.send_command
metadata: {}
data:
command: "{{ chanel_number % 10 }}"
target:
entity_id: remote.meobox_4k_diw3930
alias: Send unitsdigit
- alias: Send enter
action: remote.send_command
metadata: {}
data:
command: DPAD_CENTER
target:
entity_id: remote.meobox_4k_diw3930
fields:
chanel_number:
selector:
number:
min: 1
max: 199
name: chanel number
required: true
Automação:
alias: "MEO: Channel Selection"
description: ""
triggers:
- trigger: state
entity_id:
- input_boolean.eurosport
to: "on"
- trigger: state
entity_id:
- input_boolean.eurosport_2
to: "on"
- trigger: state
entity_id:
- input_boolean.disney_channel
to: "on"
- trigger: state
entity_id:
- input_boolean.cartoon_network
to: "on"
- trigger: state
entity_id:
- input_boolean.nickelodeon
to: "on"
- trigger: state
entity_id:
- input_boolean.disney_junior
to: "on"
- trigger: state
entity_id:
- input_boolean.canal_panda
to: "on"
- trigger: state
entity_id:
- input_boolean.hollywood
to: "on"
- trigger: state
entity_id:
- input_boolean.fox_movies
to: "on"
- trigger: state
entity_id:
- input_boolean.axn_movies
to: "on"
- trigger: state
entity_id:
- input_boolean.fox
to: "on"
- trigger: state
entity_id:
- input_boolean.fox_comedy
to: "on"
- trigger: state
entity_id:
- input_boolean.axn
to: "on"
- trigger: state
entity_id:
- input_boolean.discovery
to: "on"
- trigger: state
entity_id:
- input_boolean.historia
to: "on"
- trigger: state
entity_id:
- input_boolean.national_geographic
to: "on"
- trigger: state
entity_id:
- input_boolean.twenty_four_kitchen
to: "on"
conditions: []
actions:
- variables:
channel_map: >-
{{ { 'Eurosport' : 38, 'Eurosport 2' : 39, 'Disney Channel' : 40,
'Cartoon Network' : 41, 'Nickelodeon' : 44, 'Disney Junior' : 45,
'Canal Panda' : 46, 'Hollywood' : 61, 'FOX Movies' : 62, 'AXN Movies' :
64, 'FOX' : 70, 'FOX Comedy' : 73, 'AXN' : 74, 'Discovery' : 90,
'História' : 91, 'National Geographic' : 95, 'Twenty Four Kitchen' : 123
} }}
- variables:
selected_channel: "{{ channel_map[trigger.to_state.name] | int }}"
- action: script.meo_chanel_selection
metadata: {}
data:
chanel_number: "{{ selected_channel }}"
- action: input_boolean.turn_off
metadata: {}
data: {}
target:
entity_id: "{{trigger.entity_id}}"
mode: single
Partilha dos input_boolean com a alexa
alexa:
smart_home:
filter:
include_entities:
# SCRIPT ACTIVATORS
- input_boolean.eurosport
- input_boolean.eurosport_2
- input_boolean.disney_channel
- input_boolean.cartoon_network
- input_boolean.nickelodeon
- input_boolean.disney_junior
- input_boolean.canal_panda
- input_boolean.hollywood
- input_boolean.fox_movies
- input_boolean.axn_movies
- input_boolean.fox
- input_boolean.fox_comedy
- input_boolean.axn
- input_boolean.discovery
- input_boolean.historia
- input_boolean.national_geographic
- input_boolean.twenty_four_kitchen
Eventualmente ainda irei acrescentar uns passos na automação, como ligar a TV ou a Box se estiverem desligadas, ou o caso quando a box está num canal bloqueado e preciso accionar o “back button”.
Feedback é bem vindo.