From 5352ea4511dda9764fdb48f9aabf8babd03cc360 Mon Sep 17 00:00:00 2001 From: Martijn Date: Sat, 30 Nov 2024 18:26:46 +0100 Subject: [PATCH] added music card documentation --- package/cards/music.md | 44 ++++++++++++++++++++++++++++++++++++++++ package/cards/music.yaml | 37 ++++++++++++++++++++++++++++++++- 2 files changed, 80 insertions(+), 1 deletion(-) create mode 100644 package/cards/music.md diff --git a/package/cards/music.md b/package/cards/music.md new file mode 100644 index 0000000..0571317 --- /dev/null +++ b/package/cards/music.md @@ -0,0 +1,44 @@ +# ESPHome Button+ - Music card + +## Usage + +* Add the music card file to youre files and supply the `entity_id` + ``` + substitutions: + music_card_enity_id: 'media_player.media_keuken_2' + package: + remote_package_files: + url: https://github.com/dixi83/ESPHome_ButtonPlus + files: [,'package/cards/music.yaml'] + ``` +* Add the music card to the main display `lambda` and give it the position you want + ``` + id(music_card).execute(20, 125); + ``` + +* Add the icons buttons to the BAR's + + Select one of the folowing types: + * `volume_up` + * `volume_down` + * `next` + * `prev` + * `playpause` + * `power` + + ``` + id(music_card_bar).execute('volume_up') + ``` + +* add actions to the buttons + Select the a matching action for the button: + * `music_card_vol_up` + * `music_card_vol_down` + * `music_card_next` + * `music_card_prev` + * `music_card_playpause` + * `music_card_power` + + ``` + id(music_card_vol_up).execute() + ``` diff --git a/package/cards/music.yaml b/package/cards/music.yaml index d1a89b8..0f624c8 100644 --- a/package/cards/music.yaml +++ b/package/cards/music.yaml @@ -163,4 +163,39 @@ script: id(main_display).image(80, 2, id(icon_music_on), ImageAlign::TOP_CENTER, id(music_card_icon_bar_color)); } } - \ No newline at end of file + - id: music_card_vol_up + then: + - homeassistant.action: + action: media_player.volume_up + data: + entity_id: ${music_card_enity_id} + - id: music_card_vol_dowen + then: + - homeassistant.action: + action: media_player.volume_down + data: + entity_id: ${music_card_enity_id} + - id: music_card_next + then: + - homeassistant.action: + action: media_player.media_next_track + data: + entity_id: ${music_card_enity_id} + - id: music_card_prev + then: + - homeassistant.action: + action: media_player.media_previous_track + data: + entity_id: ${music_card_enity_id} + - id: music_card_playpause + then: + - homeassistant.action: + action: media_player.media_play_pause + data: + entity_id: ${music_card_enity_id} + - id: music_card_power + then: + - homeassistant.action: + action: media_player.toggle + data: + entity_id: ${music_card_enity_id}