Malta,
na exploração que estou a fazer das potencialidades das 24 cartas do novo lovelace, acabei por começar a gostar de uma combinação em particular: Stacks com Glaces. Isto porque é uma excelente forma de condensar varias entidades e acções num espaço reduzido. Uso o HA no telemovel e gosto de ter tudo à mão. Por isso acabei por fazer um comando condensado para a sala de estar… tirando proveito do broadlink mini que tenho e recorrendo apenas a cartas lovelace… sem scripts ou coisas fancy.
A coisa vai a meio… ainda me faltam adicionar mais controlos como “Menu”, “Navegar Esquerda”, “Navegar Direita”, o “Ok”, o “retroceder”… mas deixo o resultado até agora:
No ficheiro configuration.yaml adicionam o vosso broadlink e as entidades com os comandos on/off, por cada icon que querem no lovelace tem que criar aqui uma entidade. (Se calhar dá para fazer isto com cartas de “Picture” que não exijam a criação de entidades… eu tentei mas não consegui).
switch:
- platform: broadlink
host: xxx.xxx.xxx.xxx
mac: ‘xx:xx:xx:xx:xx:xx’
timeout: 15
switches:
lr_tv:
command_on: ‘JgDSAJSUEzcSNxM3EhISExISEhMSEhI3EzcSOBISEhISExISEhITNxISEhMROBI4EhISExE4EhMROBI4EhISEhI4EjgSEhIABgCUlBI3EzcSOBISEhISExISEhISOBI3EzcSEhITEhISExISEjcTEhISEjgSNxITERMSOBISEjcSOBISExISNxI4EhISAAYAlJQSOBI3EzcSEhITEhISEhITEjcSOBI3ExISEhITERMSEhI4EhISExE4EjgSEhISEjgSEhI4EjcTEhISEjgSNxITEgANBQAAAAAAAA==’
command_off: ‘JgDSAJaUEzYTNxI4EhISEhMSERMRExI4EjgSNxMSEBQSEhITEBQRExITERMRNhU3EhMQFBI3EzcSOBM2EhMRExI3EjgSEhIABgCUlBI4EzYUNhITERMSEhITEBQSNxM3EjgTERISEhMRExISERQRExISEjgSOBMRERMRORI3EzcTNxETERMRORI3ExISAAYAlJQTNhI4EzYUERISEhMRExISEjgSNxM3EhISExETEhITEhETEhMRExI3EjgTERITETgSOBI3EzcSEhITETgTNxISEgANBQAAAAAAAA==’
lr_meobox:
command_on: ‘JgBoAAgUFRgRFxMOBxYTFQoLCQwTGBINBxcHAAtpCBgSFhQWEgwJFhMYBwwIDRMWEw0HFwgAC2gJGBMUFRUTDAoVFBcGDQcOFBUUCggYCQALaQgWExUUFhQLBxgUFgUQCQoUFhQMCBYIAA0F’
command_off: ‘JgCCAAgXExcSFxMLCRcTGAYMCAwUFhQLCRYJAAtpBxYVFRMWEQ4JFhMWCQwIDhIWEwwGGQgAC2kHGRMVFRQTDAgWFBcGEAgMEhYUCwkXCAALaQcXExYUFhINBxcUFQgNCA4SFhIOCBcHAAtoBxkTFhQVFQsIFxIXCA0IDBMWEwwIFwUADQUAAAAAAAA=’
lr_meobox_channelup:
command_on: ‘JgBgAAgXFRUTFhMMBRoTFQYREhcTFQgNEwALdAgVExcSFxIMBxkSFwcOExYRGQcMEwALcwcZExYSFhMMCBkRGAYNExcSGAUPEwALcwYXFBYTFhMMCRYUFQkMFBYTFgcOEgANBQAAAAAAAAAA’
command_off: ‘JgBIAAcYFBkPFxQMCRUVFAoMEhcUCwgXEwALcgcXFBYTFhQLChUUFggLFRUTDAkXEwALcQkXEhYVFRQLBxgTFwgMExYTDAUaFAANBQ==’
lr_meobox_channeldown:
command_on: ‘JgBgAAgXFRUTFhMMBRoTFQYREhcTFQgNEwALdAgVExcSFxIMBxkSFwcOExYRGQcMEwALcwcZExYSFhMMCBkRGAYNExcSGAUPEwALcwYXFBYTFhMMCRYUFQkMFBYTFgcOEgANBQAAAAAAAAAA’
command_off: ‘JgBIAAcYFBkPFxQMCRUVFAoMEhcUCwgXEwALcgcXFBYTFhQLChUUFggLFRUTDAkXEwALcQkXEhYVFRQLBxgTFwgMExYTDAUaFAANBQ==’
Depois no customize.yaml adiciono os nomes e icons
switch.lr_tv:
friendly_name: Tv Power
icon: mdi:television-box
switch.lr_meobox:
friendly_name: Meo Box Power
icon: mdi:audio-video
switch.lr_meobox_channelup:
friendly_name: Channel Up
icon: mdi:arrow-up-bold
switch.lr_meobox_channeldown:
friendly_name: Channel Down
icon: mdi:arrow-down-bold
E depois no GUI do lovelace adicionei um Stack com o código.
cards:
- cards:
- columns: 5
title: Living Room Remote
entities:
- entity: light.lr_yeelight_couch
name: Couch
tap_action:
action: toggle- entity: switch.lr_tv
name: Tv
tap_action:
action: toggle- entity: switch.lr_soundbar
name: SoundBar
tap_action:
action: toggle- entity: switch.lr_meobox
name: MeoBox
tap_action:
action: toggle- entity: switch.lr_ac
name: AC
tap_action:
action: toggle
show_state: false
show_name: false
type: glance
type: horizontal-stack- cards:
- columns: 12
entities:
- entity: switch.lr_soundbar_volumeup
name: SoundUp
tap_action:
action: call-service
service: switch.broadlink_send_packet_192_168_1_xxx
service_data:
packet:
- >-
JgBQAAABKJMSExITEhMTOBI4EzcTNxITEjkSOBM3EhMTEhMSEhMTOBITEzcSOBM3EzgTEhMSExISOBITExITExITEjgSOBM3EgAFJAABJksSAA0FAAAAAAAAAAA=- entity: switch.lr_soundbar_volumedown
name: SoundDown
tap_action:
action: call-service
service: switch.broadlink_send_packet_192_168_1_xxx
service_data:
packet:
- >-
JgBQAAABKJMSExITEhQSOBI4EzcSOBMTEjgSOBI4EhMTEhIUEhMTNxM3EzcTNxM4EzcSExITEhMSExMTEhMSExITEzcTNxM3FAAFIgABJ0sSAA0FAAAAAAAAAAA=- entity: switch.lr_meobox_channelup
name: SoundDown
tap_action:
action: call-service
service: switch.broadlink_send_packet_192_168_1_xxx
service_data:
packet:
- >-
JgBgAAgXFRUTFhMMBRoTFQYREhcTFQgNEwALdAgVExcSFxIMBxkSFwcOExYRGQcMEwALcwcZExYSFhMMCBkRGAYNExcSGAUPEwALcwYXFBYTFhMMCRYUFQkMFBYTFgcOEgANBQAAAAAAAAAA- entity: switch.lr_meobox_channeldown
name: SoundDown
tap_action:
action: call-service
service: switch.broadlink_send_packet_192_168_1_xxx
service_data:
packet:
- >-
JgBIAAcYFBkPFxQMCRUVFAoMEhcUCwgXEwALcgcXFBYTFhQLChUUFggLFRUTDAkXEwALcQkXEhYVFRQLBxgTFwgMExYTDAUaFAANBQ==
show_state: false
show_name: false
type: glance
type: horizontal-stack
type: vertical-stack