Oggi vediamo come creare un telecomando in lovelace e sfrutteremo il mio progetto con nodemcu a questo LINK e io avendo una chromecast e kodi su RPi3 B+ collegati alla tv unisco i due player per poter vedere cosa sto vedendo in tv.

ecco il codice per il player universale:

[php light=”true”] – platform: universal
name: TV Camera
children:
– media_player.kodi
– media_player.rwchrome
commands:
turn_on:
service: script.toggle
data:
entity_id: script.spegni_accendi
turn_off:
service: script.toggle
data:
entity_id: script.spegni_accendi
volume_up:
service: script.toggle
data:
entity_id: script.av
volume_down:
service: script.toggle
data:
entity_id: script.bv
volume_mute:
service: script.toggle
data:
entity_id: script.mv
[/php]

Tramite questo player puoi accendere/spegnere, mettere muto/alzare/abbassare il volume e avviare/stoppare/avanti/indietro il player, qui stiamo attivando tutti gli script del package del mio progetto però potete adattarlo per le vostre configurazioni.

Qui ecco la configurazione da inserire in lovelace:

[php light=”true”] – type: vertical-stack
cards:
– type: media-control
entity: media_player.tv_camera
– type: horizontal-stack
cards:
– type: entity-button
entity: script.timer_spegnimento
– type: entity-button
entity: script.spegni_accendi
– type: entity-button
entity: script.source
– type: horizontal-stack
cards:
– type: entity-button
entity: script.pc
– type: entity-button
entity: script.mc
– type: entity-button
entity: script.rc
– type: horizontal-stack
cards:
– type: entity-button
entity: script.av
– type: entity-button
entity: script.bv
– type: entity-button
entity: script.mv
– type: horizontal-stack
cards:
– type: entity-button
entity: input_select.numeri_canali
– type: entity-button
entity: script.seleziona_numero
– type: horizontal-stack
cards:
– type: entity-button
entity: input_select.canali_preferiti
– type: entity-button
entity: script.seleziona_preferiti
– type: horizontal-stack
cards:
– type: entity-button
entity: script.ok
– type: entity-button
entity: script.info
[/php]

Qui stiamo usando una card vertical-stack e molte card horizontal-stack, con card media-control e molte card entiy-button.

ecco come viene graficamente il telecomando:

Per avere aiuto io e altri abbiamo creato un canale Discord e un gruppo telegram dove potete collegarvi e ci aiutiamo a vicenda https://discord.gg/CTCrSm5 https://t.me/HomeAssistant_Rpi

Se volete Donare per avere più progetti: paypal.me/itchsblog