161 lines
15 KiB
JSON
161 lines
15 KiB
JSON
[
|
|
{
|
|
"id": "Musicbox - Controls",
|
|
"automation": "- alias: Musicbox - Controls\n description: ''\n triggers:\n - topic: musicbox/controls\n trigger: mqtt\n conditions: []\n actions:\n - variables:\n action: '{{ trigger.payload }}'\n - choose:\n - alias: Volume Up\n conditions:\n - condition: template\n value_template: '{{ action == ''volume_up'' }}'\n sequence:\n - action: media_player.volume_up\n metadata: {}\n data: {}\n target:\n entity_id:\n - media_player.spotify_tobias_munzert\n - media_player.music_player_daemon\n - media_player.49pus6401\n - alias: Volume Down\n conditions:\n - condition: template\n value_template: '{{ action == ''volume_down'' }}'\n sequence:\n - action: media_player.volume_down\n metadata: {}\n data: {}\n target:\n entity_id:\n - media_player.49pus6401\n - media_player.music_player_daemon\n - media_player.spotify_tobias_munzert\n - alias: Repeat (Play/Pause)\n conditions:\n - condition: template\n value_template: '{{ action == ''playpause'' }}'\n sequence:\n - choose:\n - conditions:\n - condition: state\n entity_id: media_player.music_player_daemon\n attribute: repeat\n state: all\n sequence:\n - action: media_player.repeat_set\n metadata: {}\n data:\n repeat: one\n target:\n entity_id:\n - media_player.music_player_daemon\n - media_player.spotify_tobias_munzert\n default:\n - action: media_player.repeat_set\n metadata: {}\n data:\n repeat: all\n target:\n entity_id:\n - media_player.music_player_daemon\n - choose:\n - conditions:\n - condition: state\n entity_id: media_player.spotify_tobias_munzert\n attribute: source\n state: sk61\n sequence:\n - action: media_player.repeat_set\n metadata: {}\n data:\n repeat: one\n target:\n entity_id: media_player.spotify_tobias_munzert\n - alias: Previous Song\n conditions:\n - condition: template\n value_template: '{{ action == ''prev'' }}'\n sequence:\n - choose:\n - conditions:\n - condition: device\n device_id: 524a3b4d21dbe5984af4e0b2bd2c3a5d\n domain: media_player\n entity_id: 81920bfa76a06fe06068b75dfb2b912b\n type: is_playing\n sequence:\n - action: media_player.media_previous_track\n metadata: {}\n data: {}\n target:\n entity_id: media_player.music_player_daemon\n - conditions:\n - condition: device\n device_id: a5ba5cb5fa2d0828600fca7fd1d30e2e\n domain: media_player\n entity_id: 44286d1faf0e2fd39b95ed26fe57cdcb\n type: is_playing\n - condition: state\n entity_id: media_player.spotify_tobias_munzert\n attribute: source\n state: sk61\n sequence:\n - action: media_player.media_previous_track\n metadata: {}\n data: {}\n target:\n entity_id: media_player.spotify_tobias_munzert\n - alias: Next Song\n conditions:\n - condition: template\n value_template: '{{ action == ''next'' }}'\n sequence:\n - choose:\n - conditions:\n - condition: device\n device_id: 524a3b4d21dbe5984af4e0b2bd2c3a5d\n domain: media_player\n entity_id: 81920bfa76a06fe06068b75dfb2b912b\n type: is_playing\n sequence:\n - action: media_player.media_next_track\n metadata: {}\n data: {}\n target:\n entity_id: media_player.music_player_daemon\n - conditions:\n - condition: device\n device_id: a5ba5cb5fa2d0828600fca7fd1d30e2e\n domain: media_player\n entity_id: 44286d1faf0e2fd39b95ed26fe57cdcb\n type: is_playing\n - condition: state\n entity_id: media_player.spotify_tobias_munzert\n attribute: source\n state: sk61\n sequence:\n - action: media_player.media_next_track\n metadata: {}\n data: {}\n target:\n entity_id: media_player.spotify_tobias_munzert\n default:\n - action: system_log.write\n metadata: {}\n data:\n level: error\n message: 'Unknown action: {{ action }}'\n mode: single",
|
|
"config": [
|
|
{
|
|
"name": "spotify tobias munzert",
|
|
"room": "living_room",
|
|
"type": "media_player",
|
|
"id": {
|
|
"entity_id": "media_player.spotify_tobias_munzert",
|
|
"device_id": null
|
|
}
|
|
},
|
|
{
|
|
"name": "music player daemon",
|
|
"room": "living_room",
|
|
"type": "media_player",
|
|
"id": {
|
|
"entity_id": "media_player.music_player_daemon",
|
|
"device_id": null
|
|
}
|
|
},
|
|
{
|
|
"name": "49pus6401 tv",
|
|
"room": "living_room",
|
|
"type": "media_player",
|
|
"id": {
|
|
"entity_id": "media_player.49pus6401",
|
|
"device_id": null
|
|
}
|
|
},
|
|
{
|
|
"name": "music player device 1",
|
|
"room": "living_room",
|
|
"type": "media_player",
|
|
"id": {
|
|
"entity_id": "81920bfa76a06fe06068b75dfb2b912b",
|
|
"device_id": "524a3b4d21dbe5984af4e0b2bd2c3a5d"
|
|
}
|
|
},
|
|
{
|
|
"name": "music player device 2",
|
|
"room": "living_room",
|
|
"type": "media_player",
|
|
"id": {
|
|
"entity_id": "44286d1faf0e2fd39b95ed26fe57cdcb",
|
|
"device_id": "a5ba5cb5fa2d0828600fca7fd1d30e2e"
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"id": "Musicbox MPD Single Playback",
|
|
"automation": "- alias: Musicbox MPD Single Playback\n description: Pause other media players when one starts playing.\n triggers:\n - entity_id:\n - media_player.music_player_daemon\n to: playing\n trigger: state\n conditions:\n - condition: state\n entity_id: media_player.spotify_tobias_munzert\n attribute: source\n state: sk61\n actions:\n - action: media_player.media_pause\n metadata: {}\n data: {}\n target:\n entity_id: media_player.spotify_tobias_munzert\n mode: single",
|
|
"config": [
|
|
{
|
|
"name": "spotify tobias munzert",
|
|
"room": "living_room",
|
|
"type": "media_player",
|
|
"id": {
|
|
"entity_id": "media_player.spotify_tobias_munzert",
|
|
"device_id": null
|
|
}
|
|
},
|
|
{
|
|
"name": "music player daemon",
|
|
"room": "living_room",
|
|
"type": "media_player",
|
|
"id": {
|
|
"entity_id": "media_player.music_player_daemon",
|
|
"device_id": null
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"id": "Musicbox - Playback Controller",
|
|
"automation": "- alias: Musicbox - Playback Controller\n description: ''\n triggers:\n - topic: musicbox/playback\n trigger: mqtt\n actions:\n - variables:\n data: '{{ trigger.payload | from_json }}\n\n '\n data_id: '{{ data.id }}\n\n '\n action: '{{ data.action }}\n\n '\n content_tag: '{{ data.content }}\n\n '\n content_ha: '{{ state_attr(''tag.'' + (data_id | string), ''friendly_name'')\n }}\n\n '\n content: '{{ content_tag or content_ha}}\n\n '\n content_uri: '{{ content.split('':'') }}\n\n '\n content_domain: '{{ content_uri[0] }}\n\n '\n content_type: '{{ content_uri[1] }}\n\n '\n content_id: '{{ content_uri[2] }}\n\n '\n - choose:\n - conditions:\n - condition: template\n value_template: '{{ content_ha == ''Tag '' + (data_id | string) }}'\n - condition: template\n value_template: '{{ content_tag != '''' }}'\n sequence: []\n - choose:\n - conditions:\n - condition: template\n value_template: '{{ action == ''start_playback'' }}'\n alias: action == 'start_playback'\n sequence:\n - alias: Start Playback\n choose:\n - conditions:\n - condition: template\n value_template: '{{ content_domain == ''spotify'' }}'\n alias: content_domain == 'spotify'\n sequence:\n - action: automation.trigger\n metadata: {}\n data:\n variables:\n content: '{{ content }}'\n content_type: '{{ content_type }}'\n content_id: '{{ content_id }}'\n target:\n entity_id: automation.musicbox_spotify_start_playback\n alias: Trigger Spotify Start Playback\n alias: Domain - Spotify\n - conditions:\n - condition: template\n value_template: '{{ content_domain == ''mpd'' }}'\n alias: content_domain == 'mpd'\n sequence:\n - action: automation.trigger\n metadata: {}\n data:\n variables:\n content: '{{ content }}'\n content_type: '{{ content_type }}'\n content_id: '{{ content_id }}'\n target:\n entity_id: automation.musicbox_start_playback_mpd\n alias: Trigger MPD Start Playback\n alias: Domain - MPD\n alias: Action - Start Playback\n - conditions:\n - condition: template\n value_template: '{{ action == ''resume_playback'' }}'\n alias: action == 'resume_playback'\n sequence:\n - alias: Resume Playback\n choose:\n - conditions:\n - condition: template\n value_template: '{{ content_domain == ''spotify'' }}'\n alias: content_domain == 'spotify'\n sequence:\n - action: automation.trigger\n metadata: {}\n data:\n variables:\n content: '{{ content }}'\n target:\n entity_id: automation.musicbox_spotify_resume_playback\n alias: Trigger Spotify Resume Playback\n alias: Domain - Spotify\n - conditions:\n - condition: template\n value_template: '{{ content_domain == ''mpd'' }}'\n alias: content_domain == 'mpd'\n sequence:\n - action: automation.trigger\n metadata: {}\n data:\n variables:\n content: '{{ content }}'\n target:\n entity_id: automation.musicbox_mpd_resume_playback\n alias: Trigger MPD Resume Playback\n alias: Domain - MPD\n alias: Action - Resume Playback\n - conditions:\n - condition: template\n value_template: '{{ action == ''pause_playback'' }}'\n alias: action == 'pause_playback'\n sequence:\n - alias: Pause Playback\n choose:\n - conditions:\n - condition: template\n value_template: '{{ content_domain == ''spotify'' }}'\n alias: content_domain == 'spotify'\n sequence:\n - action: automation.trigger\n metadata: {}\n data:\n variables:\n content: '{{ content }}'\n target:\n entity_id: automation.musicbox_spotify_pause_playback\n alias: Trigger Spotify Pause Playback\n alias: Domain - Spotify\n - conditions:\n - condition: template\n value_template: '{{ content_domain == ''mpd'' }}'\n alias: content_domain == 'mpd'\n sequence:\n - action: automation.trigger\n metadata: {}\n data:\n variables:\n content: '{{ content }}'\n target:\n entity_id: automation.musicbox_mpd_pause_playback\n alias: Trigger MPD Pause Playback\n alias: Domain - MPD\n alias: Action - Pause Playback\n default:\n - data:\n name: Musicbox Controller\n message: 'Unsupported action {{ action }} or domain {{ content_domain }}\n\n '\n action: logbook.log\n alias: Log Unsupported\n mode: single",
|
|
"config": [
|
|
{
|
|
"name": "musicbox spotify start playback",
|
|
"room": null,
|
|
"type": "automation",
|
|
"id": {
|
|
"entity_id": "automation.musicbox_spotify_start_playback",
|
|
"device_id": null
|
|
}
|
|
},
|
|
{
|
|
"name": "musicbox start playback mpd",
|
|
"room": null,
|
|
"type": "automation",
|
|
"id": {
|
|
"entity_id": "automation.musicbox_start_playback_mpd",
|
|
"device_id": null
|
|
}
|
|
},
|
|
{
|
|
"name": "musicbox spotify resume playback",
|
|
"room": null,
|
|
"type": "automation",
|
|
"id": {
|
|
"entity_id": "automation.musicbox_spotify_resume_playback",
|
|
"device_id": null
|
|
}
|
|
},
|
|
{
|
|
"name": "musicbox mpd resume playback",
|
|
"room": null,
|
|
"type": "automation",
|
|
"id": {
|
|
"entity_id": "automation.musicbox_mpd_resume_playback",
|
|
"device_id": null
|
|
}
|
|
},
|
|
{
|
|
"name": "musicbox spotify pause playback",
|
|
"room": null,
|
|
"type": "automation",
|
|
"id": {
|
|
"entity_id": "automation.musicbox_spotify_pause_playback",
|
|
"device_id": null
|
|
}
|
|
},
|
|
{
|
|
"name": "musicbox mpd pause playback",
|
|
"room": null,
|
|
"type": "automation",
|
|
"id": {
|
|
"entity_id": "automation.musicbox_mpd_pause_playback",
|
|
"device_id": null
|
|
}
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"id": "Musicbox Spotify Single Playback",
|
|
"automation": "- alias: Musicbox Spotify Single Playback\n description: Pause other media players when one starts playing.\n triggers:\n - entity_id:\n - media_player.spotify_tobias_munzert\n to: playing\n trigger: state\n conditions:\n - condition: state\n entity_id: media_player.spotify_tobias_munzert\n attribute: source\n state: sk61\n actions:\n - action: media_player.media_pause\n metadata: {}\n data: {}\n target:\n entity_id: media_player.music_player_daemon\n mode: single",
|
|
"config": [
|
|
{
|
|
"name": "spotify tobias munzert",
|
|
"room": "living_room",
|
|
"type": "media_player",
|
|
"id": {
|
|
"entity_id": "media_player.spotify_tobias_munzert",
|
|
"device_id": null
|
|
}
|
|
},
|
|
{
|
|
"name": "music player daemon",
|
|
"room": "living_room",
|
|
"type": "media_player",
|
|
"id": {
|
|
"entity_id": "media_player.music_player_daemon",
|
|
"device_id": null
|
|
}
|
|
}
|
|
]
|
|
}
|
|
] |