Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- "trace": {
- "last_step": "sequence/21/repeat/sequence/0",
- "run_id": "19eaee2520a50975ad641d4124c7bbff",
- "state": "stopped",
- "script_execution": "finished",
- "timestamp": {
- "start": "2022-11-28T09:04:46.192502+00:00",
- "finish": "2022-11-28T09:05:04.119715+00:00"
- },
- "domain": "script",
- "item_id": "google_home_resume",
- "trace": {
- "sequence/0": [
- {
- "path": "sequence/0",
- "timestamp": "2022-11-28T09:04:46.194078+00:00",
- "changed_variables": {
- "settings": {
- "players_screen": null,
- "primary_spotcast": "robert_soldano",
- "default_volume_level": 0.5,
- "dummy_player": "media_player.vlc_telnet",
- "default_resume_delay": {
- "seconds": 20
- },
- "enable_automation": true,
- "dashboard_cast": true,
- "announce_volume_automation": 0.8
- },
- "this": {
- "entity_id": "script.google_home_resume",
- "state": "off",
- "attributes": {
- "last_triggered": "2022-11-28T08:07:29.374345+00:00",
- "mode": "parallel",
- "current": 0,
- "max": 10,
- "icon": "mdi:cast-audio",
- "friendly_name": "00 - Google Home Resume",
- "settings": {
- "players_screen": null,
- "primary_spotcast": "robert_soldano",
- "default_volume_level": 0.5,
- "dummy_player": "media_player.vlc_telnet",
- "default_resume_delay": {
- "seconds": 20
- },
- "enable_automation": true,
- "dashboard_cast": true,
- "announce_volume_automation": 0.8
- }
- },
- "last_changed": "2022-11-28T08:07:47.327937+00:00",
- "last_updated": "2022-11-28T08:07:47.327937+00:00",
- "context": {
- "id": "01GJYME9BZ4ZP7Q18VJ36B9QNF",
- "parent_id": null,
- "user_id": null
- }
- },
- "action": {
- "service": "tts.google_translate_say",
- "target": {
- "entity_id": "media_player.ufficio_milena"
- },
- "data": {
- "message": "Milen ce, se hai mangiato di piu, basta fare un perf hacking...ti sentirai subito piu leggera!",
- "language": "it"
- },
- "extra": {
- "volume": 0.8
- }
- },
- "context": {
- "id": "01GJYQPM3G7JY69QVKH0XVADT5",
- "parent_id": null,
- "user_id": "2a298aebc80446749be35680bdc494b1"
- }
- }
- }
- ],
- "sequence/1": [
- {
- "path": "sequence/1",
- "timestamp": "2022-11-28T09:04:46.194123+00:00",
- "changed_variables": {
- "version": "2022.11.8"
- }
- }
- ],
- "sequence/1/if": [
- {
- "path": "sequence/1/if",
- "timestamp": "2022-11-28T09:04:46.194154+00:00",
- "result": {
- "result": false
- }
- }
- ],
- "sequence/1/if/condition/0": [
- {
- "path": "sequence/1/if/condition/0",
- "timestamp": "2022-11-28T09:04:46.194181+00:00",
- "result": {
- "result": false,
- "entities": [
- "script.google_home_resume"
- ]
- }
- }
- ],
- "sequence/2": [
- {
- "path": "sequence/2",
- "timestamp": "2022-11-28T09:04:46.194538+00:00"
- }
- ],
- "sequence/3": [
- {
- "path": "sequence/3",
- "timestamp": "2022-11-28T09:04:46.195067+00:00",
- "changed_variables": {
- "event_script": false,
- "automation": false,
- "service_calls": [
- {
- "service": "tts.google_translate_say",
- "target": {
- "entity_id": "media_player.ufficio_milena"
- },
- "data": {
- "message": "Milen ce, se hai mangiato di piu, basta fare un perf hacking...ti sentirai subito piu leggera!",
- "language": "it"
- },
- "extra": {
- "volume": 0.8
- }
- }
- ],
- "no_service_count": 0
- }
- }
- ],
- "sequence/3/choose/0": [
- {
- "path": "sequence/3/choose/0",
- "timestamp": "2022-11-28T09:04:46.195116+00:00",
- "result": {
- "result": false
- }
- }
- ],
- "sequence/3/choose/0/conditions/0": [
- {
- "path": "sequence/3/choose/0/conditions/0",
- "timestamp": "2022-11-28T09:04:46.195136+00:00",
- "result": {
- "result": false,
- "entities": []
- }
- }
- ],
- "sequence/3/choose/1": [
- {
- "path": "sequence/3/choose/1",
- "timestamp": "2022-11-28T09:04:46.195217+00:00",
- "result": {
- "result": false
- }
- }
- ],
- "sequence/3/choose/1/conditions/0": [
- {
- "path": "sequence/3/choose/1/conditions/0",
- "timestamp": "2022-11-28T09:04:46.195236+00:00",
- "result": {
- "result": false,
- "entities": []
- }
- }
- ],
- "sequence/4": [
- {
- "path": "sequence/4",
- "timestamp": "2022-11-28T09:04:46.195324+00:00"
- }
- ],
- "sequence/5": [
- {
- "path": "sequence/5",
- "timestamp": "2022-11-28T09:04:46.196074+00:00",
- "changed_variables": {
- "start_time": "2022-11-28 11:04:46.195394+02:00",
- "speaker_group_list": [],
- "speaker_groups": {
- "no group": [
- "no members"
- ]
- },
- "cast_entities": [
- "media_player.ufficio_milena"
- ],
- "spotify_entities": [
- "media_player.spotify_robert_soldano",
- "media_player.spotify_milena_dacheva"
- ],
- "mass_entities": [],
- "cast_mass_playing": [],
- "mass_playing": [],
- "primary_spotcast_check": true,
- "ytube_music_entities": []
- }
- }
- ],
- "sequence/6": [
- {
- "path": "sequence/6",
- "timestamp": "2022-11-28T09:04:46.196812+00:00",
- "changed_variables": {
- "data_source": "resume_script",
- "target_list": [
- "media_player.ufficio_milena"
- ]
- },
- "result": {
- "choice": "then"
- }
- }
- ],
- "sequence/6/if": [
- {
- "path": "sequence/6/if",
- "timestamp": "2022-11-28T09:04:46.196841+00:00",
- "result": {
- "result": true
- }
- }
- ],
- "sequence/6/if/condition/0": [
- {
- "path": "sequence/6/if/condition/0",
- "timestamp": "2022-11-28T09:04:46.196854+00:00",
- "result": {
- "result": true,
- "entities": []
- }
- }
- ],
- "sequence/6/then/0": [
- {
- "path": "sequence/6/then/0",
- "timestamp": "2022-11-28T09:04:46.197096+00:00",
- "result": {
- "params": {
- "domain": "homeassistant",
- "service": "update_entity",
- "service_data": {},
- "target": {
- "entity_id": [
- "media_player.spotify_robert_soldano",
- "media_player.spotify_milena_dacheva"
- ]
- }
- },
- "running_script": false,
- "limit": 10
- }
- }
- ],
- "sequence/7": [
- {
- "path": "sequence/7",
- "timestamp": "2022-11-28T09:04:46.305167+00:00"
- }
- ],
- "sequence/8": [
- {
- "path": "sequence/8",
- "timestamp": "2022-11-28T09:04:46.306074+00:00",
- "changed_variables": {
- "player_data": [
- {
- "data_source": "resume_script",
- "entity_id": "media_player.ufficio_milena",
- "state": "playing",
- "type": "no screen",
- "members": [],
- "app_name": "Spotify",
- "volume_level": 0.3,
- "media_content_id": "spotify:track:135Lf4Q0CzlMNfOxbEUsLH",
- "media_position": 51.07,
- "spotcast": "milena_dacheva"
- }
- ],
- "resume_active": [],
- "resume_action_false": [],
- "players_to_resume": [
- "media_player.ufficio_milena"
- ]
- }
- }
- ],
- "sequence/8/if": [
- {
- "path": "sequence/8/if",
- "timestamp": "2022-11-28T09:04:46.306111+00:00",
- "result": {
- "result": false
- }
- }
- ],
- "sequence/8/if/condition/0": [
- {
- "path": "sequence/8/if/condition/0",
- "timestamp": "2022-11-28T09:04:46.306126+00:00",
- "result": {
- "result": false,
- "entities": []
- }
- }
- ],
- "sequence/9": [
- {
- "path": "sequence/9",
- "timestamp": "2022-11-28T09:04:46.306188+00:00"
- }
- ],
- "sequence/10": [
- {
- "path": "sequence/10",
- "timestamp": "2022-11-28T09:04:46.306359+00:00",
- "changed_variables": {
- "target_not_playing": [],
- "target_no_volume": []
- },
- "result": {
- "params": {
- "domain": "group",
- "service": "set",
- "service_data": {
- "object_id": "resume_script_active_ghresume_01gjyqpm3g7jy69qvkh0xvadt5",
- "name": "Entities currently active with Google Home Resume script",
- "icon": "mdi:play-box",
- "entities": [
- "media_player.ufficio_milena"
- ]
- },
- "target": {}
- },
- "running_script": false,
- "limit": 10
- }
- }
- ],
- "sequence/11": [
- {
- "path": "sequence/11",
- "timestamp": "2022-11-28T09:04:46.308205+00:00",
- "result": {
- "params": {
- "domain": "group",
- "service": "set",
- "service_data": {
- "object_id": "resume_active_ghresume_01gjyqpm3g7jy69qvkh0xvadt5",
- "name": "Entities which will be resumed by the Google Home Resume script",
- "icon": "mdi:autorenew",
- "entities": []
- },
- "target": {}
- },
- "running_script": false,
- "limit": 10
- }
- }
- ],
- "sequence/12": [
- {
- "path": "sequence/12",
- "timestamp": "2022-11-28T09:04:46.309933+00:00",
- "result": {
- "choice": 0
- }
- }
- ],
- "sequence/12/choose/0": [
- {
- "path": "sequence/12/choose/0",
- "timestamp": "2022-11-28T09:04:46.309973+00:00",
- "result": {
- "result": true
- }
- }
- ],
- "sequence/12/choose/0/conditions/0": [
- {
- "path": "sequence/12/choose/0/conditions/0",
- "timestamp": "2022-11-28T09:04:46.309988+00:00",
- "result": {
- "result": true,
- "entities": []
- }
- }
- ],
- "sequence/12/choose/0/sequence/0": [
- {
- "path": "sequence/12/choose/0/sequence/0",
- "timestamp": "2022-11-28T09:04:46.310188+00:00",
- "result": {
- "params": {
- "domain": "group",
- "service": "set",
- "service_data": {
- "object_id": "resume_action_false_ghresume_01gjyqpm3g7jy69qvkh0xvadt5",
- "name": "Entities with actions which should not be resumed",
- "icon": "mdi:alert-octagon",
- "entities": [
- "media_player.ufficio_milena"
- ]
- },
- "target": {}
- },
- "running_script": false,
- "limit": 10
- }
- }
- ],
- "sequence/13": [
- {
- "path": "sequence/13",
- "timestamp": "2022-11-28T09:04:46.312244+00:00"
- }
- ],
- "sequence/13/if": [
- {
- "path": "sequence/13/if",
- "timestamp": "2022-11-28T09:04:46.312283+00:00",
- "result": {
- "result": false
- }
- }
- ],
- "sequence/13/if/condition/0": [
- {
- "path": "sequence/13/if/condition/0",
- "timestamp": "2022-11-28T09:04:46.312303+00:00",
- "result": {
- "result": false,
- "entities": []
- }
- }
- ],
- "sequence/14": [
- {
- "path": "sequence/14",
- "timestamp": "2022-11-28T09:04:46.312437+00:00"
- }
- ],
- "sequence/15": [
- {
- "path": "sequence/15",
- "timestamp": "2022-11-28T09:04:46.312542+00:00"
- }
- ],
- "sequence/15/if": [
- {
- "path": "sequence/15/if",
- "timestamp": "2022-11-28T09:04:46.312570+00:00",
- "result": {
- "result": false
- }
- }
- ],
- "sequence/15/if/condition/0": [
- {
- "path": "sequence/15/if/condition/0",
- "timestamp": "2022-11-28T09:04:46.312584+00:00",
- "result": {
- "result": false,
- "entities": []
- }
- }
- ],
- "sequence/16": [
- {
- "path": "sequence/16",
- "timestamp": "2022-11-28T09:04:46.312688+00:00"
- }
- ],
- "sequence/16/if": [
- {
- "path": "sequence/16/if",
- "timestamp": "2022-11-28T09:04:46.312713+00:00",
- "result": {
- "result": false
- }
- }
- ],
- "sequence/16/if/condition/0": [
- {
- "path": "sequence/16/if/condition/0",
- "timestamp": "2022-11-28T09:04:46.312725+00:00",
- "result": {
- "result": false,
- "entities": []
- }
- }
- ],
- "sequence/17": [
- {
- "path": "sequence/17",
- "timestamp": "2022-11-28T09:04:46.312792+00:00"
- }
- ],
- "sequence/17/repeat/sequence/0": [
- {
- "path": "sequence/17/repeat/sequence/0",
- "timestamp": "2022-11-28T09:04:46.312997+00:00",
- "changed_variables": {
- "repeat": {
- "first": true,
- "index": 1,
- "last": true,
- "item": {
- "service": "tts.google_translate_say",
- "target": {
- "entity_id": "media_player.ufficio_milena"
- },
- "data": {
- "message": "Milen ce, se hai mangiato di piu, basta fare un perf hacking...ti sentirai subito piu leggera!",
- "language": "it"
- },
- "extra": {
- "volume": 0.8
- }
- }
- }
- }
- }
- ],
- "sequence/17/repeat/sequence/1": [
- {
- "path": "sequence/17/repeat/sequence/1",
- "timestamp": "2022-11-28T09:04:46.313876+00:00",
- "changed_variables": {
- "service_call": {
- "service": "tts.google_translate_say",
- "target": {
- "entity_id": "media_player.ufficio_milena"
- },
- "data": {
- "message": "Milen ce, se hai mangiato di piu, basta fare un perf hacking...ti sentirai subito piu leggera!",
- "language": "it"
- },
- "extra": {
- "volume": 0.8
- }
- },
- "target": {
- "entity_id": "media_player.ufficio_milena"
- },
- "extra": {
- "volume": 0.8
- },
- "volume_set": true,
- "wait_set": false,
- "tts": true,
- "target_entities": [
- "media_player.ufficio_milena"
- ],
- "media_entities": [
- "media_player.ufficio_milena"
- ],
- "cast_target": [
- "media_player.ufficio_milena"
- ],
- "screen": false,
- "data": {
- "message": "Milen ce, se hai mangiato di piu, basta fare un perf hacking...ti sentirai subito piu leggera!",
- "language": "it"
- }
- },
- "result": {
- "params": {
- "domain": "media_player",
- "service": "media_stop",
- "service_data": {},
- "target": {
- "entity_id": [
- "media_player.ufficio_milena"
- ]
- }
- },
- "running_script": false,
- "limit": 10
- }
- }
- ],
- "sequence/17/repeat/sequence/2": [
- {
- "path": "sequence/17/repeat/sequence/2",
- "timestamp": "2022-11-28T09:04:46.315645+00:00",
- "result": {
- "wait": {
- "remaining": null,
- "completed": true
- }
- }
- }
- ],
- "sequence/17/repeat/sequence/3": [
- {
- "path": "sequence/17/repeat/sequence/3",
- "timestamp": "2022-11-28T09:04:46.423676+00:00",
- "changed_variables": {
- "wait": {
- "remaining": null,
- "completed": true
- }
- },
- "result": {
- "choice": 0
- }
- }
- ],
- "sequence/17/repeat/sequence/3/choose/0": [
- {
- "path": "sequence/17/repeat/sequence/3/choose/0",
- "timestamp": "2022-11-28T09:04:46.423727+00:00",
- "result": {
- "result": true
- }
- }
- ],
- "sequence/17/repeat/sequence/3/choose/0/conditions/0": [
- {
- "path": "sequence/17/repeat/sequence/3/choose/0/conditions/0",
- "timestamp": "2022-11-28T09:04:46.423746+00:00",
- "result": {
- "result": true,
- "entities": []
- }
- }
- ],
- "sequence/17/repeat/sequence/3/choose/0/sequence/0": [
- {
- "path": "sequence/17/repeat/sequence/3/choose/0/sequence/0",
- "timestamp": "2022-11-28T09:04:46.424678+00:00",
- "result": {
- "params": {
- "domain": "media_player",
- "service": "volume_set",
- "service_data": {
- "volume_level": 0.8,
- "entity_id": [
- "media_player.ufficio_milena"
- ]
- },
- "target": {
- "entity_id": [
- "media_player.ufficio_milena"
- ]
- }
- },
- "running_script": false,
- "limit": 10
- }
- }
- ],
- "sequence/17/repeat/sequence/4": [
- {
- "path": "sequence/17/repeat/sequence/4",
- "timestamp": "2022-11-28T09:04:46.426135+00:00"
- }
- ],
- "sequence/17/repeat/sequence/4/choose/0": [
- {
- "path": "sequence/17/repeat/sequence/4/choose/0",
- "timestamp": "2022-11-28T09:04:46.426176+00:00",
- "result": {
- "result": false
- }
- }
- ],
- "sequence/17/repeat/sequence/4/choose/0/conditions/0": [
- {
- "path": "sequence/17/repeat/sequence/4/choose/0/conditions/0",
- "timestamp": "2022-11-28T09:04:46.426192+00:00",
- "result": {
- "result": false,
- "entities": []
- }
- }
- ],
- "sequence/17/repeat/sequence/5": [
- {
- "path": "sequence/17/repeat/sequence/5",
- "timestamp": "2022-11-28T09:04:46.426268+00:00",
- "child_id": {
- "domain": "automation",
- "item_id": "417395bc-bd64-40a3-b20a-9062d426a01f",
- "run_id": "c6edec417d96394948b81549991f2fcf"
- },
- "result": {
- "params": {
- "domain": "tts",
- "service": "google_translate_say",
- "service_data": {
- "message": "Milen ce, se hai mangiato di piu, basta fare un perf hacking...ti sentirai subito piu leggera!",
- "language": "it",
- "entity_id": [
- "media_player.ufficio_milena"
- ]
- },
- "target": {
- "entity_id": [
- "media_player.ufficio_milena"
- ]
- }
- },
- "running_script": false,
- "limit": 10
- }
- }
- ],
- "sequence/17/repeat/sequence/6": [
- {
- "path": "sequence/17/repeat/sequence/6",
- "timestamp": "2022-11-28T09:04:49.629864+00:00"
- }
- ],
- "sequence/17/repeat/sequence/6/if": [
- {
- "path": "sequence/17/repeat/sequence/6/if",
- "timestamp": "2022-11-28T09:04:49.629918+00:00",
- "result": {
- "result": false
- }
- }
- ],
- "sequence/17/repeat/sequence/6/if/condition/0": [
- {
- "path": "sequence/17/repeat/sequence/6/if/condition/0",
- "timestamp": "2022-11-28T09:04:49.629937+00:00",
- "result": {
- "result": false,
- "entities": []
- }
- }
- ],
- "sequence/18": [
- {
- "path": "sequence/18",
- "timestamp": "2022-11-28T09:04:49.630117+00:00"
- }
- ],
- "sequence/18/repeat/sequence/0": [
- {
- "path": "sequence/18/repeat/sequence/0",
- "timestamp": "2022-11-28T09:04:49.630359+00:00",
- "changed_variables": {
- "repeat": {
- "first": true,
- "index": 1,
- "last": true,
- "item": "media_player.ufficio_milena"
- }
- }
- }
- ],
- "sequence/18/repeat/sequence/1": [
- {
- "path": "sequence/18/repeat/sequence/1",
- "timestamp": "2022-11-28T09:04:49.630525+00:00",
- "child_id": {
- "domain": "script",
- "item_id": "google_home_resume_helper",
- "run_id": "1d74782799c830b789dbd731fc088825"
- },
- "changed_variables": {
- "player": {
- "data_source": "resume_script",
- "entity_id": "media_player.ufficio_milena",
- "state": "playing",
- "type": "no screen",
- "members": [],
- "app_name": "Spotify",
- "volume_level": 0.3,
- "media_content_id": "spotify:track:135Lf4Q0CzlMNfOxbEUsLH",
- "media_position": 51.07,
- "spotcast": "milena_dacheva"
- }
- },
- "result": {
- "params": {
- "domain": "script",
- "service": "turn_on",
- "service_data": {
- "variables": {
- "start_time": "2022-11-28 11:04:46.195394+02:00",
- "player": {
- "data_source": "resume_script",
- "entity_id": "media_player.ufficio_milena",
- "state": "playing",
- "type": "no screen",
- "members": [],
- "app_name": "Spotify",
- "volume_level": 0.3,
- "media_content_id": "spotify:track:135Lf4Q0CzlMNfOxbEUsLH",
- "media_position": 51.07,
- "spotcast": "milena_dacheva"
- },
- "member_data": [],
- "players_to_resume": [
- "media_player.ufficio_milena"
- ],
- "event_script": false,
- "resume": true,
- "ytube_resume": false,
- "action_type": "resume",
- "resume_delay": {
- "seconds": 20
- }
- },
- "entity_id": [
- "script.google_home_resume_helper"
- ]
- },
- "target": {
- "entity_id": [
- "script.google_home_resume_helper"
- ]
- }
- },
- "running_script": true,
- "limit": null
- }
- }
- ],
- "sequence/19": [
- {
- "path": "sequence/19",
- "timestamp": "2022-11-28T09:04:49.635366+00:00"
- }
- ],
- "sequence/20": [
- {
- "path": "sequence/20",
- "timestamp": "2022-11-28T09:04:49.635529+00:00",
- "changed_variables": {
- "groups_to_remove": [
- "group.resume_script_active_ghresume_01gjyqpm3g7jy69qvkh0xvadt5",
- "group.resume_active_ghresume_01gjyqpm3g7jy69qvkh0xvadt5",
- "group.resume_action_false_ghresume_01gjyqpm3g7jy69qvkh0xvadt5"
- ]
- },
- "result": {
- "wait": {
- "remaining": null,
- "completed": true
- }
- }
- }
- ],
- "sequence/21": [
- {
- "path": "sequence/21",
- "timestamp": "2022-11-28T09:05:04.113795+00:00",
- "changed_variables": {
- "wait": {
- "remaining": null,
- "completed": true
- }
- }
- }
- ],
- "sequence/21/repeat/sequence/0": [
- {
- "path": "sequence/21/repeat/sequence/0",
- "timestamp": "2022-11-28T09:05:04.114789+00:00",
- "changed_variables": {
- "repeat": {
- "first": true,
- "index": 1,
- "last": false,
- "item": "group.resume_script_active_ghresume_01gjyqpm3g7jy69qvkh0xvadt5"
- }
- },
- "result": {
- "params": {
- "domain": "group",
- "service": "remove",
- "service_data": {
- "object_id": "resume_script_active_ghresume_01gjyqpm3g7jy69qvkh0xvadt5"
- },
- "target": {}
- },
- "running_script": false,
- "limit": 10
- }
- },
- {
- "path": "sequence/21/repeat/sequence/0",
- "timestamp": "2022-11-28T09:05:04.116508+00:00",
- "changed_variables": {
- "repeat": {
- "first": false,
- "index": 2,
- "last": false,
- "item": "group.resume_active_ghresume_01gjyqpm3g7jy69qvkh0xvadt5"
- }
- },
- "result": {
- "params": {
- "domain": "group",
- "service": "remove",
- "service_data": {
- "object_id": "resume_active_ghresume_01gjyqpm3g7jy69qvkh0xvadt5"
- },
- "target": {}
- },
- "running_script": false,
- "limit": 10
- }
- },
- {
- "path": "sequence/21/repeat/sequence/0",
- "timestamp": "2022-11-28T09:05:04.117758+00:00",
- "changed_variables": {
- "repeat": {
- "first": false,
- "index": 3,
- "last": true,
- "item": "group.resume_action_false_ghresume_01gjyqpm3g7jy69qvkh0xvadt5"
- }
- },
- "result": {
- "params": {
- "domain": "group",
- "service": "remove",
- "service_data": {
- "object_id": "resume_action_false_ghresume_01gjyqpm3g7jy69qvkh0xvadt5"
- },
- "target": {}
- },
- "running_script": false,
- "limit": 10
- }
- }
- ]
- },
- "config": {
- "alias": "00 - Google Home Resume",
- "description": "Script for resuming Google Home speakers",
- "icon": "mdi:cast-audio",
- "mode": "parallel",
- "fields": {
- "target": {
- "description": "Enter the targets in case they are not clear from the service calls",
- "required": false,
- "selector": {
- "target": {
- "entity": {
- "integration": "cast",
- "domain": "media_player"
- },
- "device": {
- "integration": "cast"
- }
- }
- }
- },
- "action": {
- "description": "Actions to be performed (only service calls will work)",
- "required": true,
- "selector": {
- "action": null
- }
- },
- "resume_this_action": {
- "description": "Set to false if you don't want to resume the actions started with this script (default is true)",
- "required": false,
- "selector": {
- "boolean": null
- }
- },
- "resume_delay": {
- "description": "Delay before resume when casting an image or dashboard. Default value is set by default_resume_delay variable or 20 seconds.",
- "required": false,
- "selector": {
- "duration": null
- }
- }
- },
- "variables": {
- "settings": {
- "players_screen": null,
- "primary_spotcast": "robert_soldano",
- "default_volume_level": 0.5,
- "dummy_player": "media_player.vlc_telnet",
- "default_resume_delay": {
- "seconds": 20
- },
- "enable_automation": true,
- "dashboard_cast": true,
- "announce_volume_automation": 0.8
- }
- },
- "sequence": [
- {
- "alias": "Version number",
- "variables": {
- "version": "2022.11.8"
- }
- },
- {
- "alias": "Failsafe to remove all groups if the script was not running",
- "if": "{{ \n state_attr(this.entity_id, 'current') == 1\n and integration_entities('group')\n | select('search', 'ghresume')\n | list | count > 0\n}}\n",
- "then": [
- {
- "alias": "Which groups to remove",
- "variables": {
- "groups_existing": "{{ integration_entities('group') | select('search', 'ghresume') | list }}\n"
- }
- },
- {
- "alias": "Loop to remove groups",
- "repeat": {
- "for_each": "{{ groups_existing }}",
- "sequence": [
- {
- "alias": "Remove one group",
- "service": "group.remove",
- "data": {
- "object_id": "{{ states[repeat.item].object_id }}"
- }
- }
- ]
- }
- }
- ]
- },
- {
- "alias": "Create variables based on action section",
- "variables": {
- "event_script": "{{ event_script if event_script is defined else false }}",
- "automation": "{{ automation if automation is defined else false }}",
- "service_calls": "{{ iif(action is mapping,[ action ], action) | selectattr('service', 'defined') | list if action is defined and action else [] }}\n",
- "no_service_count": "{{ iif(action is mapping,[ action ], action) | count - service_calls | count if action is defined and action else [] }}\n"
- }
- },
- {
- "alias": "Wrong actions provided",
- "choose": [
- {
- "conditions": "{{ (not (event_script or automation)) and service_calls | count == 0 }}",
- "sequence": [
- {
- "stop": "There were no service calls defined, no actions are performed. The script script has been aborted.",
- "error": true
- }
- ]
- },
- {
- "conditions": "{{ (not (event_script or automation)) and no_service_count > 0 }}",
- "sequence": [
- {
- "service": "system_log.write",
- "data": {
- "level": "warning",
- "logger": "{{ this.entity_id }}",
- "message": "{{ no_service_count }} out of {{ service_calls | count }} actions were not performed because they are not service calls.\n"
- }
- }
- ]
- }
- ]
- },
- {
- "alias": "Set variables to be used in the script",
- "variables": {
- "start_time": "{{ start_time if start_time is defined else now() }}",
- "speaker_group_list": "{{ (settings.get('speaker_groups') | default({}, true)).keys() | list }}",
- "speaker_groups": "{{ settings.get('speaker_groups') if speaker_group_list else { 'no group': [ 'no members' ] } }}",
- "cast_entities": "{{ integration_entities('cast') }}",
- "spotify_entities": "{{ integration_entities('spotify') }}",
- "mass_entities": "{{ integration_entities('mass') | select('match', '^media_player.') | list }}",
- "cast_mass_playing": "{%- if cast_mass_playing is defined %}\n {{ cast_mass_playing }}\n{%- else %}\n {{\n expand(integration_entities('cast'))\n | selectattr('attributes.media_title', 'defined')\n | selectattr('attributes.media_title', 'search', 'Streaming from Music Assistant')\n | map(attribute='entity_id')\n | list\n }}\n{%- endif %}\n",
- "mass_playing": "{{ (cast_mass_playing | join(',') | replace('.', '.mass_')).split(',') | select() | list }}",
- "primary_spotcast_check": "{%- set accounts = (spotify_entities | join(',') | replace('media_player.spotify_', '')).split(',') %} {{ spotify_entities | count <= 1 or settings.get('primary_spotcast') in accounts }}\n",
- "ytube_music_entities": "{{ integration_entities('ytube_music_player') | select('match', '^media_player.') | list }}\n"
- }
- },
- {
- "alias": "Set data_source and determine target list",
- "variables": {
- "data_source": "resume_script",
- "target_list": "{%- if target_list is defined %}\n {{ target_list }}\n{%- else %}\n {
Add Comment
Please, Sign In to add comment