Guest User

google home resume

a guest
Nov 28th, 2022
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JSON 34.96 KB | None | 0 0
  1. {
  2.   "trace": {
  3.     "last_step": "sequence/21/repeat/sequence/0",
  4.     "run_id": "19eaee2520a50975ad641d4124c7bbff",
  5.     "state": "stopped",
  6.     "script_execution": "finished",
  7.     "timestamp": {
  8.       "start": "2022-11-28T09:04:46.192502+00:00",
  9.       "finish": "2022-11-28T09:05:04.119715+00:00"
  10.     },
  11.     "domain": "script",
  12.     "item_id": "google_home_resume",
  13.     "trace": {
  14.       "sequence/0": [
  15.         {
  16.           "path": "sequence/0",
  17.           "timestamp": "2022-11-28T09:04:46.194078+00:00",
  18.           "changed_variables": {
  19.             "settings": {
  20.               "players_screen": null,
  21.               "primary_spotcast": "robert_soldano",
  22.               "default_volume_level": 0.5,
  23.               "dummy_player": "media_player.vlc_telnet",
  24.               "default_resume_delay": {
  25.                 "seconds": 20
  26.               },
  27.               "enable_automation": true,
  28.               "dashboard_cast": true,
  29.               "announce_volume_automation": 0.8
  30.             },
  31.             "this": {
  32.               "entity_id": "script.google_home_resume",
  33.               "state": "off",
  34.               "attributes": {
  35.                 "last_triggered": "2022-11-28T08:07:29.374345+00:00",
  36.                 "mode": "parallel",
  37.                 "current": 0,
  38.                 "max": 10,
  39.                 "icon": "mdi:cast-audio",
  40.                 "friendly_name": "00 - Google Home Resume",
  41.                 "settings": {
  42.                   "players_screen": null,
  43.                   "primary_spotcast": "robert_soldano",
  44.                   "default_volume_level": 0.5,
  45.                   "dummy_player": "media_player.vlc_telnet",
  46.                   "default_resume_delay": {
  47.                     "seconds": 20
  48.                   },
  49.                   "enable_automation": true,
  50.                   "dashboard_cast": true,
  51.                   "announce_volume_automation": 0.8
  52.                 }
  53.               },
  54.               "last_changed": "2022-11-28T08:07:47.327937+00:00",
  55.               "last_updated": "2022-11-28T08:07:47.327937+00:00",
  56.               "context": {
  57.                 "id": "01GJYME9BZ4ZP7Q18VJ36B9QNF",
  58.                 "parent_id": null,
  59.                 "user_id": null
  60.               }
  61.             },
  62.             "action": {
  63.               "service": "tts.google_translate_say",
  64.               "target": {
  65.                 "entity_id": "media_player.ufficio_milena"
  66.               },
  67.               "data": {
  68.                 "message": "Milen ce, se hai mangiato di piu, basta fare un perf hacking...ti sentirai subito piu leggera!",
  69.                 "language": "it"
  70.               },
  71.               "extra": {
  72.                 "volume": 0.8
  73.               }
  74.             },
  75.             "context": {
  76.               "id": "01GJYQPM3G7JY69QVKH0XVADT5",
  77.               "parent_id": null,
  78.               "user_id": "2a298aebc80446749be35680bdc494b1"
  79.             }
  80.           }
  81.         }
  82.       ],
  83.       "sequence/1": [
  84.         {
  85.           "path": "sequence/1",
  86.           "timestamp": "2022-11-28T09:04:46.194123+00:00",
  87.           "changed_variables": {
  88.             "version": "2022.11.8"
  89.           }
  90.         }
  91.       ],
  92.       "sequence/1/if": [
  93.         {
  94.           "path": "sequence/1/if",
  95.           "timestamp": "2022-11-28T09:04:46.194154+00:00",
  96.           "result": {
  97.             "result": false
  98.           }
  99.         }
  100.       ],
  101.       "sequence/1/if/condition/0": [
  102.         {
  103.           "path": "sequence/1/if/condition/0",
  104.           "timestamp": "2022-11-28T09:04:46.194181+00:00",
  105.           "result": {
  106.             "result": false,
  107.             "entities": [
  108.               "script.google_home_resume"
  109.             ]
  110.           }
  111.         }
  112.       ],
  113.       "sequence/2": [
  114.         {
  115.           "path": "sequence/2",
  116.           "timestamp": "2022-11-28T09:04:46.194538+00:00"
  117.         }
  118.       ],
  119.       "sequence/3": [
  120.         {
  121.           "path": "sequence/3",
  122.           "timestamp": "2022-11-28T09:04:46.195067+00:00",
  123.           "changed_variables": {
  124.             "event_script": false,
  125.             "automation": false,
  126.             "service_calls": [
  127.               {
  128.                 "service": "tts.google_translate_say",
  129.                 "target": {
  130.                   "entity_id": "media_player.ufficio_milena"
  131.                 },
  132.                 "data": {
  133.                   "message": "Milen ce, se hai mangiato di piu, basta fare un perf hacking...ti sentirai subito piu leggera!",
  134.                   "language": "it"
  135.                 },
  136.                 "extra": {
  137.                   "volume": 0.8
  138.                 }
  139.               }
  140.             ],
  141.             "no_service_count": 0
  142.           }
  143.         }
  144.       ],
  145.       "sequence/3/choose/0": [
  146.         {
  147.           "path": "sequence/3/choose/0",
  148.           "timestamp": "2022-11-28T09:04:46.195116+00:00",
  149.           "result": {
  150.             "result": false
  151.           }
  152.         }
  153.       ],
  154.       "sequence/3/choose/0/conditions/0": [
  155.         {
  156.           "path": "sequence/3/choose/0/conditions/0",
  157.           "timestamp": "2022-11-28T09:04:46.195136+00:00",
  158.           "result": {
  159.             "result": false,
  160.             "entities": []
  161.           }
  162.         }
  163.       ],
  164.       "sequence/3/choose/1": [
  165.         {
  166.           "path": "sequence/3/choose/1",
  167.           "timestamp": "2022-11-28T09:04:46.195217+00:00",
  168.           "result": {
  169.             "result": false
  170.           }
  171.         }
  172.       ],
  173.       "sequence/3/choose/1/conditions/0": [
  174.         {
  175.           "path": "sequence/3/choose/1/conditions/0",
  176.           "timestamp": "2022-11-28T09:04:46.195236+00:00",
  177.           "result": {
  178.             "result": false,
  179.             "entities": []
  180.           }
  181.         }
  182.       ],
  183.       "sequence/4": [
  184.         {
  185.           "path": "sequence/4",
  186.           "timestamp": "2022-11-28T09:04:46.195324+00:00"
  187.         }
  188.       ],
  189.       "sequence/5": [
  190.         {
  191.           "path": "sequence/5",
  192.           "timestamp": "2022-11-28T09:04:46.196074+00:00",
  193.           "changed_variables": {
  194.             "start_time": "2022-11-28 11:04:46.195394+02:00",
  195.             "speaker_group_list": [],
  196.             "speaker_groups": {
  197.               "no group": [
  198.                 "no members"
  199.               ]
  200.             },
  201.             "cast_entities": [
  202.               "media_player.ufficio_milena"
  203.             ],
  204.             "spotify_entities": [
  205.               "media_player.spotify_robert_soldano",
  206.               "media_player.spotify_milena_dacheva"
  207.             ],
  208.             "mass_entities": [],
  209.             "cast_mass_playing": [],
  210.             "mass_playing": [],
  211.             "primary_spotcast_check": true,
  212.             "ytube_music_entities": []
  213.           }
  214.         }
  215.       ],
  216.       "sequence/6": [
  217.         {
  218.           "path": "sequence/6",
  219.           "timestamp": "2022-11-28T09:04:46.196812+00:00",
  220.           "changed_variables": {
  221.             "data_source": "resume_script",
  222.             "target_list": [
  223.               "media_player.ufficio_milena"
  224.             ]
  225.           },
  226.           "result": {
  227.             "choice": "then"
  228.           }
  229.         }
  230.       ],
  231.       "sequence/6/if": [
  232.         {
  233.           "path": "sequence/6/if",
  234.           "timestamp": "2022-11-28T09:04:46.196841+00:00",
  235.           "result": {
  236.             "result": true
  237.           }
  238.         }
  239.       ],
  240.       "sequence/6/if/condition/0": [
  241.         {
  242.           "path": "sequence/6/if/condition/0",
  243.           "timestamp": "2022-11-28T09:04:46.196854+00:00",
  244.           "result": {
  245.             "result": true,
  246.             "entities": []
  247.           }
  248.         }
  249.       ],
  250.       "sequence/6/then/0": [
  251.         {
  252.           "path": "sequence/6/then/0",
  253.           "timestamp": "2022-11-28T09:04:46.197096+00:00",
  254.           "result": {
  255.             "params": {
  256.               "domain": "homeassistant",
  257.               "service": "update_entity",
  258.               "service_data": {},
  259.               "target": {
  260.                 "entity_id": [
  261.                   "media_player.spotify_robert_soldano",
  262.                   "media_player.spotify_milena_dacheva"
  263.                 ]
  264.               }
  265.             },
  266.             "running_script": false,
  267.             "limit": 10
  268.           }
  269.         }
  270.       ],
  271.       "sequence/7": [
  272.         {
  273.           "path": "sequence/7",
  274.           "timestamp": "2022-11-28T09:04:46.305167+00:00"
  275.         }
  276.       ],
  277.       "sequence/8": [
  278.         {
  279.           "path": "sequence/8",
  280.           "timestamp": "2022-11-28T09:04:46.306074+00:00",
  281.           "changed_variables": {
  282.             "player_data": [
  283.               {
  284.                 "data_source": "resume_script",
  285.                 "entity_id": "media_player.ufficio_milena",
  286.                 "state": "playing",
  287.                 "type": "no screen",
  288.                 "members": [],
  289.                 "app_name": "Spotify",
  290.                 "volume_level": 0.3,
  291.                 "media_content_id": "spotify:track:135Lf4Q0CzlMNfOxbEUsLH",
  292.                 "media_position": 51.07,
  293.                 "spotcast": "milena_dacheva"
  294.               }
  295.             ],
  296.             "resume_active": [],
  297.             "resume_action_false": [],
  298.             "players_to_resume": [
  299.               "media_player.ufficio_milena"
  300.             ]
  301.           }
  302.         }
  303.       ],
  304.       "sequence/8/if": [
  305.         {
  306.           "path": "sequence/8/if",
  307.           "timestamp": "2022-11-28T09:04:46.306111+00:00",
  308.           "result": {
  309.             "result": false
  310.           }
  311.         }
  312.       ],
  313.       "sequence/8/if/condition/0": [
  314.         {
  315.           "path": "sequence/8/if/condition/0",
  316.           "timestamp": "2022-11-28T09:04:46.306126+00:00",
  317.           "result": {
  318.             "result": false,
  319.             "entities": []
  320.           }
  321.         }
  322.       ],
  323.       "sequence/9": [
  324.         {
  325.           "path": "sequence/9",
  326.           "timestamp": "2022-11-28T09:04:46.306188+00:00"
  327.         }
  328.       ],
  329.       "sequence/10": [
  330.         {
  331.           "path": "sequence/10",
  332.           "timestamp": "2022-11-28T09:04:46.306359+00:00",
  333.           "changed_variables": {
  334.             "target_not_playing": [],
  335.             "target_no_volume": []
  336.           },
  337.           "result": {
  338.             "params": {
  339.               "domain": "group",
  340.               "service": "set",
  341.               "service_data": {
  342.                 "object_id": "resume_script_active_ghresume_01gjyqpm3g7jy69qvkh0xvadt5",
  343.                 "name": "Entities currently active with Google Home Resume script",
  344.                 "icon": "mdi:play-box",
  345.                 "entities": [
  346.                   "media_player.ufficio_milena"
  347.                 ]
  348.               },
  349.               "target": {}
  350.             },
  351.             "running_script": false,
  352.             "limit": 10
  353.           }
  354.         }
  355.       ],
  356.       "sequence/11": [
  357.         {
  358.           "path": "sequence/11",
  359.           "timestamp": "2022-11-28T09:04:46.308205+00:00",
  360.           "result": {
  361.             "params": {
  362.               "domain": "group",
  363.               "service": "set",
  364.               "service_data": {
  365.                 "object_id": "resume_active_ghresume_01gjyqpm3g7jy69qvkh0xvadt5",
  366.                 "name": "Entities which will be resumed by the Google Home Resume script",
  367.                 "icon": "mdi:autorenew",
  368.                 "entities": []
  369.               },
  370.               "target": {}
  371.             },
  372.             "running_script": false,
  373.             "limit": 10
  374.           }
  375.         }
  376.       ],
  377.       "sequence/12": [
  378.         {
  379.           "path": "sequence/12",
  380.           "timestamp": "2022-11-28T09:04:46.309933+00:00",
  381.           "result": {
  382.             "choice": 0
  383.           }
  384.         }
  385.       ],
  386.       "sequence/12/choose/0": [
  387.         {
  388.           "path": "sequence/12/choose/0",
  389.           "timestamp": "2022-11-28T09:04:46.309973+00:00",
  390.           "result": {
  391.             "result": true
  392.           }
  393.         }
  394.       ],
  395.       "sequence/12/choose/0/conditions/0": [
  396.         {
  397.           "path": "sequence/12/choose/0/conditions/0",
  398.           "timestamp": "2022-11-28T09:04:46.309988+00:00",
  399.           "result": {
  400.             "result": true,
  401.             "entities": []
  402.           }
  403.         }
  404.       ],
  405.       "sequence/12/choose/0/sequence/0": [
  406.         {
  407.           "path": "sequence/12/choose/0/sequence/0",
  408.           "timestamp": "2022-11-28T09:04:46.310188+00:00",
  409.           "result": {
  410.             "params": {
  411.               "domain": "group",
  412.               "service": "set",
  413.               "service_data": {
  414.                 "object_id": "resume_action_false_ghresume_01gjyqpm3g7jy69qvkh0xvadt5",
  415.                 "name": "Entities with actions which should not be resumed",
  416.                 "icon": "mdi:alert-octagon",
  417.                 "entities": [
  418.                   "media_player.ufficio_milena"
  419.                 ]
  420.               },
  421.               "target": {}
  422.             },
  423.             "running_script": false,
  424.             "limit": 10
  425.           }
  426.         }
  427.       ],
  428.       "sequence/13": [
  429.         {
  430.           "path": "sequence/13",
  431.           "timestamp": "2022-11-28T09:04:46.312244+00:00"
  432.         }
  433.       ],
  434.       "sequence/13/if": [
  435.         {
  436.           "path": "sequence/13/if",
  437.           "timestamp": "2022-11-28T09:04:46.312283+00:00",
  438.           "result": {
  439.             "result": false
  440.           }
  441.         }
  442.       ],
  443.       "sequence/13/if/condition/0": [
  444.         {
  445.           "path": "sequence/13/if/condition/0",
  446.           "timestamp": "2022-11-28T09:04:46.312303+00:00",
  447.           "result": {
  448.             "result": false,
  449.             "entities": []
  450.           }
  451.         }
  452.       ],
  453.       "sequence/14": [
  454.         {
  455.           "path": "sequence/14",
  456.           "timestamp": "2022-11-28T09:04:46.312437+00:00"
  457.         }
  458.       ],
  459.       "sequence/15": [
  460.         {
  461.           "path": "sequence/15",
  462.           "timestamp": "2022-11-28T09:04:46.312542+00:00"
  463.         }
  464.       ],
  465.       "sequence/15/if": [
  466.         {
  467.           "path": "sequence/15/if",
  468.           "timestamp": "2022-11-28T09:04:46.312570+00:00",
  469.           "result": {
  470.             "result": false
  471.           }
  472.         }
  473.       ],
  474.       "sequence/15/if/condition/0": [
  475.         {
  476.           "path": "sequence/15/if/condition/0",
  477.           "timestamp": "2022-11-28T09:04:46.312584+00:00",
  478.           "result": {
  479.             "result": false,
  480.             "entities": []
  481.           }
  482.         }
  483.       ],
  484.       "sequence/16": [
  485.         {
  486.           "path": "sequence/16",
  487.           "timestamp": "2022-11-28T09:04:46.312688+00:00"
  488.         }
  489.       ],
  490.       "sequence/16/if": [
  491.         {
  492.           "path": "sequence/16/if",
  493.           "timestamp": "2022-11-28T09:04:46.312713+00:00",
  494.           "result": {
  495.             "result": false
  496.           }
  497.         }
  498.       ],
  499.       "sequence/16/if/condition/0": [
  500.         {
  501.           "path": "sequence/16/if/condition/0",
  502.           "timestamp": "2022-11-28T09:04:46.312725+00:00",
  503.           "result": {
  504.             "result": false,
  505.             "entities": []
  506.           }
  507.         }
  508.       ],
  509.       "sequence/17": [
  510.         {
  511.           "path": "sequence/17",
  512.           "timestamp": "2022-11-28T09:04:46.312792+00:00"
  513.         }
  514.       ],
  515.       "sequence/17/repeat/sequence/0": [
  516.         {
  517.           "path": "sequence/17/repeat/sequence/0",
  518.           "timestamp": "2022-11-28T09:04:46.312997+00:00",
  519.           "changed_variables": {
  520.             "repeat": {
  521.               "first": true,
  522.               "index": 1,
  523.               "last": true,
  524.               "item": {
  525.                 "service": "tts.google_translate_say",
  526.                 "target": {
  527.                   "entity_id": "media_player.ufficio_milena"
  528.                 },
  529.                 "data": {
  530.                   "message": "Milen ce, se hai mangiato di piu, basta fare un perf hacking...ti sentirai subito piu leggera!",
  531.                   "language": "it"
  532.                 },
  533.                 "extra": {
  534.                   "volume": 0.8
  535.                 }
  536.               }
  537.             }
  538.           }
  539.         }
  540.       ],
  541.       "sequence/17/repeat/sequence/1": [
  542.         {
  543.           "path": "sequence/17/repeat/sequence/1",
  544.           "timestamp": "2022-11-28T09:04:46.313876+00:00",
  545.           "changed_variables": {
  546.             "service_call": {
  547.               "service": "tts.google_translate_say",
  548.               "target": {
  549.                 "entity_id": "media_player.ufficio_milena"
  550.               },
  551.               "data": {
  552.                 "message": "Milen ce, se hai mangiato di piu, basta fare un perf hacking...ti sentirai subito piu leggera!",
  553.                 "language": "it"
  554.               },
  555.               "extra": {
  556.                 "volume": 0.8
  557.               }
  558.             },
  559.             "target": {
  560.               "entity_id": "media_player.ufficio_milena"
  561.             },
  562.             "extra": {
  563.               "volume": 0.8
  564.             },
  565.             "volume_set": true,
  566.             "wait_set": false,
  567.             "tts": true,
  568.             "target_entities": [
  569.               "media_player.ufficio_milena"
  570.             ],
  571.             "media_entities": [
  572.               "media_player.ufficio_milena"
  573.             ],
  574.             "cast_target": [
  575.               "media_player.ufficio_milena"
  576.             ],
  577.             "screen": false,
  578.             "data": {
  579.               "message": "Milen ce, se hai mangiato di piu, basta fare un perf hacking...ti sentirai subito piu leggera!",
  580.               "language": "it"
  581.             }
  582.           },
  583.           "result": {
  584.             "params": {
  585.               "domain": "media_player",
  586.               "service": "media_stop",
  587.               "service_data": {},
  588.               "target": {
  589.                 "entity_id": [
  590.                   "media_player.ufficio_milena"
  591.                 ]
  592.               }
  593.             },
  594.             "running_script": false,
  595.             "limit": 10
  596.           }
  597.         }
  598.       ],
  599.       "sequence/17/repeat/sequence/2": [
  600.         {
  601.           "path": "sequence/17/repeat/sequence/2",
  602.           "timestamp": "2022-11-28T09:04:46.315645+00:00",
  603.           "result": {
  604.             "wait": {
  605.               "remaining": null,
  606.               "completed": true
  607.             }
  608.           }
  609.         }
  610.       ],
  611.       "sequence/17/repeat/sequence/3": [
  612.         {
  613.           "path": "sequence/17/repeat/sequence/3",
  614.           "timestamp": "2022-11-28T09:04:46.423676+00:00",
  615.           "changed_variables": {
  616.             "wait": {
  617.               "remaining": null,
  618.               "completed": true
  619.             }
  620.           },
  621.           "result": {
  622.             "choice": 0
  623.           }
  624.         }
  625.       ],
  626.       "sequence/17/repeat/sequence/3/choose/0": [
  627.         {
  628.           "path": "sequence/17/repeat/sequence/3/choose/0",
  629.           "timestamp": "2022-11-28T09:04:46.423727+00:00",
  630.           "result": {
  631.             "result": true
  632.           }
  633.         }
  634.       ],
  635.       "sequence/17/repeat/sequence/3/choose/0/conditions/0": [
  636.         {
  637.           "path": "sequence/17/repeat/sequence/3/choose/0/conditions/0",
  638.           "timestamp": "2022-11-28T09:04:46.423746+00:00",
  639.           "result": {
  640.             "result": true,
  641.             "entities": []
  642.           }
  643.         }
  644.       ],
  645.       "sequence/17/repeat/sequence/3/choose/0/sequence/0": [
  646.         {
  647.           "path": "sequence/17/repeat/sequence/3/choose/0/sequence/0",
  648.           "timestamp": "2022-11-28T09:04:46.424678+00:00",
  649.           "result": {
  650.             "params": {
  651.               "domain": "media_player",
  652.               "service": "volume_set",
  653.               "service_data": {
  654.                 "volume_level": 0.8,
  655.                 "entity_id": [
  656.                   "media_player.ufficio_milena"
  657.                 ]
  658.               },
  659.               "target": {
  660.                 "entity_id": [
  661.                   "media_player.ufficio_milena"
  662.                 ]
  663.               }
  664.             },
  665.             "running_script": false,
  666.             "limit": 10
  667.           }
  668.         }
  669.       ],
  670.       "sequence/17/repeat/sequence/4": [
  671.         {
  672.           "path": "sequence/17/repeat/sequence/4",
  673.           "timestamp": "2022-11-28T09:04:46.426135+00:00"
  674.         }
  675.       ],
  676.       "sequence/17/repeat/sequence/4/choose/0": [
  677.         {
  678.           "path": "sequence/17/repeat/sequence/4/choose/0",
  679.           "timestamp": "2022-11-28T09:04:46.426176+00:00",
  680.           "result": {
  681.             "result": false
  682.           }
  683.         }
  684.       ],
  685.       "sequence/17/repeat/sequence/4/choose/0/conditions/0": [
  686.         {
  687.           "path": "sequence/17/repeat/sequence/4/choose/0/conditions/0",
  688.           "timestamp": "2022-11-28T09:04:46.426192+00:00",
  689.           "result": {
  690.             "result": false,
  691.             "entities": []
  692.           }
  693.         }
  694.       ],
  695.       "sequence/17/repeat/sequence/5": [
  696.         {
  697.           "path": "sequence/17/repeat/sequence/5",
  698.           "timestamp": "2022-11-28T09:04:46.426268+00:00",
  699.           "child_id": {
  700.             "domain": "automation",
  701.             "item_id": "417395bc-bd64-40a3-b20a-9062d426a01f",
  702.             "run_id": "c6edec417d96394948b81549991f2fcf"
  703.           },
  704.           "result": {
  705.             "params": {
  706.               "domain": "tts",
  707.               "service": "google_translate_say",
  708.               "service_data": {
  709.                 "message": "Milen ce, se hai mangiato di piu, basta fare un perf hacking...ti sentirai subito piu leggera!",
  710.                 "language": "it",
  711.                 "entity_id": [
  712.                   "media_player.ufficio_milena"
  713.                 ]
  714.               },
  715.               "target": {
  716.                 "entity_id": [
  717.                   "media_player.ufficio_milena"
  718.                 ]
  719.               }
  720.             },
  721.             "running_script": false,
  722.             "limit": 10
  723.           }
  724.         }
  725.       ],
  726.       "sequence/17/repeat/sequence/6": [
  727.         {
  728.           "path": "sequence/17/repeat/sequence/6",
  729.           "timestamp": "2022-11-28T09:04:49.629864+00:00"
  730.         }
  731.       ],
  732.       "sequence/17/repeat/sequence/6/if": [
  733.         {
  734.           "path": "sequence/17/repeat/sequence/6/if",
  735.           "timestamp": "2022-11-28T09:04:49.629918+00:00",
  736.           "result": {
  737.             "result": false
  738.           }
  739.         }
  740.       ],
  741.       "sequence/17/repeat/sequence/6/if/condition/0": [
  742.         {
  743.           "path": "sequence/17/repeat/sequence/6/if/condition/0",
  744.           "timestamp": "2022-11-28T09:04:49.629937+00:00",
  745.           "result": {
  746.             "result": false,
  747.             "entities": []
  748.           }
  749.         }
  750.       ],
  751.       "sequence/18": [
  752.         {
  753.           "path": "sequence/18",
  754.           "timestamp": "2022-11-28T09:04:49.630117+00:00"
  755.         }
  756.       ],
  757.       "sequence/18/repeat/sequence/0": [
  758.         {
  759.           "path": "sequence/18/repeat/sequence/0",
  760.           "timestamp": "2022-11-28T09:04:49.630359+00:00",
  761.           "changed_variables": {
  762.             "repeat": {
  763.               "first": true,
  764.               "index": 1,
  765.               "last": true,
  766.               "item": "media_player.ufficio_milena"
  767.             }
  768.           }
  769.         }
  770.       ],
  771.       "sequence/18/repeat/sequence/1": [
  772.         {
  773.           "path": "sequence/18/repeat/sequence/1",
  774.           "timestamp": "2022-11-28T09:04:49.630525+00:00",
  775.           "child_id": {
  776.             "domain": "script",
  777.             "item_id": "google_home_resume_helper",
  778.             "run_id": "1d74782799c830b789dbd731fc088825"
  779.           },
  780.           "changed_variables": {
  781.             "player": {
  782.               "data_source": "resume_script",
  783.               "entity_id": "media_player.ufficio_milena",
  784.               "state": "playing",
  785.               "type": "no screen",
  786.               "members": [],
  787.               "app_name": "Spotify",
  788.               "volume_level": 0.3,
  789.               "media_content_id": "spotify:track:135Lf4Q0CzlMNfOxbEUsLH",
  790.               "media_position": 51.07,
  791.               "spotcast": "milena_dacheva"
  792.             }
  793.           },
  794.           "result": {
  795.             "params": {
  796.               "domain": "script",
  797.               "service": "turn_on",
  798.               "service_data": {
  799.                 "variables": {
  800.                   "start_time": "2022-11-28 11:04:46.195394+02:00",
  801.                   "player": {
  802.                     "data_source": "resume_script",
  803.                     "entity_id": "media_player.ufficio_milena",
  804.                     "state": "playing",
  805.                     "type": "no screen",
  806.                     "members": [],
  807.                     "app_name": "Spotify",
  808.                     "volume_level": 0.3,
  809.                     "media_content_id": "spotify:track:135Lf4Q0CzlMNfOxbEUsLH",
  810.                     "media_position": 51.07,
  811.                     "spotcast": "milena_dacheva"
  812.                   },
  813.                   "member_data": [],
  814.                   "players_to_resume": [
  815.                     "media_player.ufficio_milena"
  816.                   ],
  817.                   "event_script": false,
  818.                   "resume": true,
  819.                   "ytube_resume": false,
  820.                   "action_type": "resume",
  821.                   "resume_delay": {
  822.                     "seconds": 20
  823.                   }
  824.                 },
  825.                 "entity_id": [
  826.                   "script.google_home_resume_helper"
  827.                 ]
  828.               },
  829.               "target": {
  830.                 "entity_id": [
  831.                   "script.google_home_resume_helper"
  832.                 ]
  833.               }
  834.             },
  835.             "running_script": true,
  836.             "limit": null
  837.           }
  838.         }
  839.       ],
  840.       "sequence/19": [
  841.         {
  842.           "path": "sequence/19",
  843.           "timestamp": "2022-11-28T09:04:49.635366+00:00"
  844.         }
  845.       ],
  846.       "sequence/20": [
  847.         {
  848.           "path": "sequence/20",
  849.           "timestamp": "2022-11-28T09:04:49.635529+00:00",
  850.           "changed_variables": {
  851.             "groups_to_remove": [
  852.               "group.resume_script_active_ghresume_01gjyqpm3g7jy69qvkh0xvadt5",
  853.               "group.resume_active_ghresume_01gjyqpm3g7jy69qvkh0xvadt5",
  854.               "group.resume_action_false_ghresume_01gjyqpm3g7jy69qvkh0xvadt5"
  855.             ]
  856.           },
  857.           "result": {
  858.             "wait": {
  859.               "remaining": null,
  860.               "completed": true
  861.             }
  862.           }
  863.         }
  864.       ],
  865.       "sequence/21": [
  866.         {
  867.           "path": "sequence/21",
  868.           "timestamp": "2022-11-28T09:05:04.113795+00:00",
  869.           "changed_variables": {
  870.             "wait": {
  871.               "remaining": null,
  872.               "completed": true
  873.             }
  874.           }
  875.         }
  876.       ],
  877.       "sequence/21/repeat/sequence/0": [
  878.         {
  879.           "path": "sequence/21/repeat/sequence/0",
  880.           "timestamp": "2022-11-28T09:05:04.114789+00:00",
  881.           "changed_variables": {
  882.             "repeat": {
  883.               "first": true,
  884.               "index": 1,
  885.               "last": false,
  886.               "item": "group.resume_script_active_ghresume_01gjyqpm3g7jy69qvkh0xvadt5"
  887.             }
  888.           },
  889.           "result": {
  890.             "params": {
  891.               "domain": "group",
  892.               "service": "remove",
  893.               "service_data": {
  894.                 "object_id": "resume_script_active_ghresume_01gjyqpm3g7jy69qvkh0xvadt5"
  895.               },
  896.               "target": {}
  897.             },
  898.             "running_script": false,
  899.             "limit": 10
  900.           }
  901.         },
  902.         {
  903.           "path": "sequence/21/repeat/sequence/0",
  904.           "timestamp": "2022-11-28T09:05:04.116508+00:00",
  905.           "changed_variables": {
  906.             "repeat": {
  907.               "first": false,
  908.               "index": 2,
  909.               "last": false,
  910.               "item": "group.resume_active_ghresume_01gjyqpm3g7jy69qvkh0xvadt5"
  911.             }
  912.           },
  913.           "result": {
  914.             "params": {
  915.               "domain": "group",
  916.               "service": "remove",
  917.               "service_data": {
  918.                 "object_id": "resume_active_ghresume_01gjyqpm3g7jy69qvkh0xvadt5"
  919.               },
  920.               "target": {}
  921.             },
  922.             "running_script": false,
  923.             "limit": 10
  924.           }
  925.         },
  926.         {
  927.           "path": "sequence/21/repeat/sequence/0",
  928.           "timestamp": "2022-11-28T09:05:04.117758+00:00",
  929.           "changed_variables": {
  930.             "repeat": {
  931.               "first": false,
  932.               "index": 3,
  933.               "last": true,
  934.               "item": "group.resume_action_false_ghresume_01gjyqpm3g7jy69qvkh0xvadt5"
  935.             }
  936.           },
  937.           "result": {
  938.             "params": {
  939.               "domain": "group",
  940.               "service": "remove",
  941.               "service_data": {
  942.                 "object_id": "resume_action_false_ghresume_01gjyqpm3g7jy69qvkh0xvadt5"
  943.               },
  944.               "target": {}
  945.             },
  946.             "running_script": false,
  947.             "limit": 10
  948.           }
  949.         }
  950.       ]
  951.     },
  952.     "config": {
  953.       "alias": "00 - Google Home Resume",
  954.       "description": "Script for resuming Google Home speakers",
  955.       "icon": "mdi:cast-audio",
  956.       "mode": "parallel",
  957.       "fields": {
  958.         "target": {
  959.           "description": "Enter the targets in case they are not clear from the service calls",
  960.           "required": false,
  961.           "selector": {
  962.             "target": {
  963.               "entity": {
  964.                 "integration": "cast",
  965.                 "domain": "media_player"
  966.               },
  967.               "device": {
  968.                 "integration": "cast"
  969.               }
  970.             }
  971.           }
  972.         },
  973.         "action": {
  974.           "description": "Actions to be performed (only service calls will work)",
  975.           "required": true,
  976.           "selector": {
  977.             "action": null
  978.           }
  979.         },
  980.         "resume_this_action": {
  981.           "description": "Set to false if you don't want to resume the actions started with this script (default is true)",
  982.           "required": false,
  983.           "selector": {
  984.             "boolean": null
  985.           }
  986.         },
  987.         "resume_delay": {
  988.           "description": "Delay before resume when casting an image or dashboard. Default value is set by default_resume_delay variable or 20 seconds.",
  989.           "required": false,
  990.           "selector": {
  991.             "duration": null
  992.           }
  993.         }
  994.       },
  995.       "variables": {
  996.         "settings": {
  997.           "players_screen": null,
  998.           "primary_spotcast": "robert_soldano",
  999.           "default_volume_level": 0.5,
  1000.           "dummy_player": "media_player.vlc_telnet",
  1001.           "default_resume_delay": {
  1002.             "seconds": 20
  1003.           },
  1004.           "enable_automation": true,
  1005.           "dashboard_cast": true,
  1006.           "announce_volume_automation": 0.8
  1007.         }
  1008.       },
  1009.       "sequence": [
  1010.         {
  1011.           "alias": "Version number",
  1012.           "variables": {
  1013.             "version": "2022.11.8"
  1014.           }
  1015.         },
  1016.         {
  1017.           "alias": "Failsafe to remove all groups if the script was not running",
  1018.           "if": "{{ \n  state_attr(this.entity_id, 'current') == 1\n  and integration_entities('group')\n        | select('search', 'ghresume')\n        | list | count > 0\n}}\n",
  1019.           "then": [
  1020.             {
  1021.               "alias": "Which groups to remove",
  1022.               "variables": {
  1023.                 "groups_existing": "{{ integration_entities('group') | select('search', 'ghresume') | list }}\n"
  1024.               }
  1025.             },
  1026.             {
  1027.               "alias": "Loop to remove groups",
  1028.               "repeat": {
  1029.                 "for_each": "{{ groups_existing }}",
  1030.                 "sequence": [
  1031.                   {
  1032.                     "alias": "Remove one group",
  1033.                     "service": "group.remove",
  1034.                     "data": {
  1035.                       "object_id": "{{ states[repeat.item].object_id }}"
  1036.                     }
  1037.                   }
  1038.                 ]
  1039.               }
  1040.             }
  1041.           ]
  1042.         },
  1043.         {
  1044.           "alias": "Create variables based on action section",
  1045.           "variables": {
  1046.             "event_script": "{{ event_script if event_script is defined else false }}",
  1047.             "automation": "{{ automation if automation is defined else false }}",
  1048.             "service_calls": "{{ iif(action is mapping,[ action ], action) | selectattr('service', 'defined') | list if action is defined and action else [] }}\n",
  1049.             "no_service_count": "{{ iif(action is mapping,[ action ], action) | count - service_calls | count if action is defined and action else [] }}\n"
  1050.           }
  1051.         },
  1052.         {
  1053.           "alias": "Wrong actions provided",
  1054.           "choose": [
  1055.             {
  1056.               "conditions": "{{ (not (event_script or automation)) and service_calls | count == 0 }}",
  1057.               "sequence": [
  1058.                 {
  1059.                   "stop": "There were no service calls defined, no actions are performed. The script script has been aborted.",
  1060.                   "error": true
  1061.                 }
  1062.               ]
  1063.             },
  1064.             {
  1065.               "conditions": "{{ (not (event_script or automation)) and no_service_count > 0 }}",
  1066.               "sequence": [
  1067.                 {
  1068.                   "service": "system_log.write",
  1069.                   "data": {
  1070.                     "level": "warning",
  1071.                     "logger": "{{ this.entity_id }}",
  1072.                     "message": "{{ no_service_count }} out of {{ service_calls | count }} actions were not performed because they are not service calls.\n"
  1073.                   }
  1074.                 }
  1075.               ]
  1076.             }
  1077.           ]
  1078.         },
  1079.         {
  1080.           "alias": "Set variables to be used in the script",
  1081.           "variables": {
  1082.             "start_time": "{{ start_time if start_time is defined else now() }}",
  1083.             "speaker_group_list": "{{ (settings.get('speaker_groups') | default({}, true)).keys() | list }}",
  1084.             "speaker_groups": "{{ settings.get('speaker_groups') if speaker_group_list else { 'no group': [ 'no members' ] }  }}",
  1085.             "cast_entities": "{{ integration_entities('cast') }}",
  1086.             "spotify_entities": "{{ integration_entities('spotify') }}",
  1087.             "mass_entities": "{{ integration_entities('mass') | select('match', '^media_player.') | list }}",
  1088.             "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",
  1089.             "mass_playing": "{{ (cast_mass_playing | join(',') | replace('.', '.mass_')).split(',') | select() | list }}",
  1090.             "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",
  1091.             "ytube_music_entities": "{{ integration_entities('ytube_music_player') | select('match', '^media_player.') | list }}\n"
  1092.           }
  1093.         },
  1094.         {
  1095.           "alias": "Set data_source and determine target list",
  1096.           "variables": {
  1097.             "data_source": "resume_script",
  1098.             "target_list": "{%- if target_list is defined %}\n  {{ target_list }}\n{%- else %}\n  {
Add Comment
Please, Sign In to add comment