Advertisement
Guest User

Untitled

a guest
Mar 28th, 2022
36
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JSON 29.70 KB | None | 0 0
  1. {
  2.   "trace": {
  3.     "last_step": "sequence/5/choose/0/sequence/0",
  4.     "run_id": "945a12beb0563584b376fa83d2dd764c",
  5.     "state": "stopped",
  6.     "script_execution": "finished",
  7.     "timestamp": {
  8.       "start": "2022-03-28T09:48:02.858122+00:00",
  9.       "finish": "2022-03-28T09:48:04.457740+00:00"
  10.     },
  11.     "domain": "script",
  12.     "item_id": "google_home_resume_perform_resume",
  13.     "trace": {
  14.       "sequence/0": [
  15.         {
  16.           "path": "sequence/0",
  17.           "timestamp": "2022-03-28T09:48:02.859270+00:00",
  18.           "changed_variables": {
  19.             "this": {
  20.               "entity_id": "script.google_home_resume_perform_resume",
  21.               "state": "off",
  22.               "attributes": {
  23.                 "last_triggered": "2022-03-27T20:24:35.653591+00:00",
  24.                 "mode": "parallel",
  25.                 "current": 0,
  26.                 "max": 20,
  27.                 "icon": "mdi:cast-audio",
  28.                 "friendly_name": "00 🔊 Google Home Resume - Perform resume"
  29.               },
  30.               "last_changed": "2022-03-28T09:46:41.869785+00:00",
  31.               "last_updated": "2022-03-28T09:46:41.869785+00:00",
  32.               "context": {
  33.                 "id": "2aba769cc638d1a066464f9d8fd48c41",
  34.                 "parent_id": null,
  35.                 "user_id": null
  36.               }
  37.             },
  38.             "start_time": "2022-03-28 12:48:02.581098+03:00",
  39.             "player": {
  40.               "data_source": "resume_script",
  41.               "entity_id": "media_player.living_room_speaker",
  42.               "state": "playing",
  43.               "app_name": "Default Media Receiver",
  44.               "volume_level": 0.4000000059604645,
  45.               "media_content_id": "https://radiorecord.hostingradio.ru/chillhouse96.aacp",
  46.               "media_title": "no title",
  47.               "media_artist": "no artist",
  48.               "media_content_type": "music",
  49.               "entity_picture": "no pic",
  50.               "media_position": 3.277478,
  51.               "members": [],
  52.               "type": "no screen"
  53.             },
  54.             "member_data": [],
  55.             "ytube_music_data": [],
  56.             "players_to_resume": [
  57.               "media_player.living_room_speaker"
  58.             ],
  59.             "event_script": false,
  60.             "context": {
  61.               "id": "77149785f0e1b9898d09caa19a6572eb",
  62.               "parent_id": null,
  63.               "user_id": "50437e77880745a2a2a14f3daae510ee"
  64.             }
  65.           },
  66.           "result": {
  67.             "wait": {
  68.               "remaining": 29.570904033258557,
  69.               "completed": true
  70.             }
  71.           }
  72.         }
  73.       ],
  74.       "sequence/1": [
  75.         {
  76.           "path": "sequence/1",
  77.           "timestamp": "2022-03-28T09:48:03.294352+00:00",
  78.           "changed_variables": {
  79.             "wait": {
  80.               "remaining": 29.570904033258557,
  81.               "completed": true
  82.             }
  83.           },
  84.           "result": {
  85.             "params": {
  86.               "domain": "group",
  87.               "service": "set",
  88.               "service_data": {
  89.                 "object_id": "resume_active_ghresume_77149785f0e1b9898d09caa19a6572eb",
  90.                 "name": "Entities which will be resumed by the Google Home Resume script",
  91.                 "icon": "mdi:autorenew",
  92.                 "entities": [
  93.                   "media_player.living_room_speaker"
  94.                 ]
  95.               },
  96.               "target": {}
  97.             },
  98.             "running_script": false,
  99.             "limit": 10
  100.           }
  101.         }
  102.       ],
  103.       "sequence/2": [
  104.         {
  105.           "path": "sequence/2",
  106.           "timestamp": "2022-03-28T09:48:03.299303+00:00",
  107.           "result": {
  108.             "choice": 0
  109.           }
  110.         }
  111.       ],
  112.       "sequence/2/choose/0": [
  113.         {
  114.           "path": "sequence/2/choose/0",
  115.           "timestamp": "2022-03-28T09:48:03.300103+00:00",
  116.           "result": {
  117.             "result": true
  118.           }
  119.         }
  120.       ],
  121.       "sequence/2/choose/0/conditions/0": [
  122.         {
  123.           "path": "sequence/2/choose/0/conditions/0",
  124.           "timestamp": "2022-03-28T09:48:03.300177+00:00",
  125.           "result": {
  126.             "result": true,
  127.             "entities": []
  128.           }
  129.         }
  130.       ],
  131.       "sequence/2/choose/0/sequence/0": [
  132.         {
  133.           "path": "sequence/2/choose/0/sequence/0",
  134.           "timestamp": "2022-03-28T09:48:03.301933+00:00"
  135.         }
  136.       ],
  137.       "sequence/2/choose/0/sequence/1": [
  138.         {
  139.           "path": "sequence/2/choose/0/sequence/1",
  140.           "timestamp": "2022-03-28T09:48:03.302786+00:00",
  141.           "changed_variables": {
  142.             "spotify": false,
  143.             "youtube": false,
  144.             "stream": true
  145.           },
  146.           "result": {
  147.             "wait": {
  148.               "remaining": null,
  149.               "completed": true
  150.             }
  151.           }
  152.         }
  153.       ],
  154.       "sequence/2/choose/0/sequence/2": [
  155.         {
  156.           "path": "sequence/2/choose/0/sequence/2",
  157.           "timestamp": "2022-03-28T09:48:04.427900+00:00",
  158.           "changed_variables": {
  159.             "wait": {
  160.               "remaining": null,
  161.               "completed": true
  162.             }
  163.           }
  164.         }
  165.       ],
  166.       "sequence/2/choose/0/sequence/2/choose/0": [
  167.         {
  168.           "path": "sequence/2/choose/0/sequence/2/choose/0",
  169.           "timestamp": "2022-03-28T09:48:04.428467+00:00",
  170.           "result": {
  171.             "result": false
  172.           }
  173.         }
  174.       ],
  175.       "sequence/2/choose/0/sequence/2/choose/0/conditions/0": [
  176.         {
  177.           "path": "sequence/2/choose/0/sequence/2/choose/0/conditions/0",
  178.           "timestamp": "2022-03-28T09:48:04.428540+00:00",
  179.           "result": {
  180.             "result": false,
  181.             "entities": [
  182.               "media_player.living_room_speaker"
  183.             ]
  184.           }
  185.         }
  186.       ],
  187.       "sequence/2/choose/0/sequence/3": [
  188.         {
  189.           "path": "sequence/2/choose/0/sequence/3",
  190.           "timestamp": "2022-03-28T09:48:04.429077+00:00",
  191.           "result": {
  192.             "choice": 2
  193.           }
  194.         }
  195.       ],
  196.       "sequence/2/choose/0/sequence/3/choose/0": [
  197.         {
  198.           "path": "sequence/2/choose/0/sequence/3/choose/0",
  199.           "timestamp": "2022-03-28T09:48:04.429645+00:00",
  200.           "result": {
  201.             "result": false
  202.           }
  203.         }
  204.       ],
  205.       "sequence/2/choose/0/sequence/3/choose/0/conditions/0": [
  206.         {
  207.           "path": "sequence/2/choose/0/sequence/3/choose/0/conditions/0",
  208.           "timestamp": "2022-03-28T09:48:04.429701+00:00",
  209.           "result": {
  210.             "result": false,
  211.             "entities": []
  212.           }
  213.         }
  214.       ],
  215.       "sequence/2/choose/0/sequence/3/choose/1": [
  216.         {
  217.           "path": "sequence/2/choose/0/sequence/3/choose/1",
  218.           "timestamp": "2022-03-28T09:48:04.429951+00:00",
  219.           "result": {
  220.             "result": false
  221.           }
  222.         }
  223.       ],
  224.       "sequence/2/choose/0/sequence/3/choose/1/conditions/0": [
  225.         {
  226.           "path": "sequence/2/choose/0/sequence/3/choose/1/conditions/0",
  227.           "timestamp": "2022-03-28T09:48:04.430003+00:00",
  228.           "result": {
  229.             "result": false,
  230.             "entities": []
  231.           }
  232.         }
  233.       ],
  234.       "sequence/2/choose/0/sequence/3/choose/2": [
  235.         {
  236.           "path": "sequence/2/choose/0/sequence/3/choose/2",
  237.           "timestamp": "2022-03-28T09:48:04.430226+00:00",
  238.           "result": {
  239.             "result": true
  240.           }
  241.         }
  242.       ],
  243.       "sequence/2/choose/0/sequence/3/choose/2/conditions/0": [
  244.         {
  245.           "path": "sequence/2/choose/0/sequence/3/choose/2/conditions/0",
  246.           "timestamp": "2022-03-28T09:48:04.430274+00:00",
  247.           "result": {
  248.             "result": true,
  249.             "entities": []
  250.           }
  251.         }
  252.       ],
  253.       "sequence/2/choose/0/sequence/3/choose/2/sequence/0": [
  254.         {
  255.           "path": "sequence/2/choose/0/sequence/3/choose/2/sequence/0",
  256.           "timestamp": "2022-03-28T09:48:04.431774+00:00"
  257.         }
  258.       ],
  259.       "sequence/2/choose/0/sequence/3/choose/2/sequence/1": [
  260.         {
  261.           "path": "sequence/2/choose/0/sequence/3/choose/2/sequence/1",
  262.           "timestamp": "2022-03-28T09:48:04.432640+00:00",
  263.           "changed_variables": {
  264.             "picture_url": "no pic",
  265.             "metadata": {
  266.               "metadataType": 3,
  267.               "title": "no title",
  268.               "artist": "no artist"
  269.             },
  270.             "picture": {
  271.               "images": [
  272.                 {
  273.                   "url": "no pic"
  274.                 }
  275.               ]
  276.             }
  277.           },
  278.           "result": {
  279.             "params": {
  280.               "domain": "media_player",
  281.               "service": "play_media",
  282.               "service_data": {
  283.                 "media_content_id": "https://radiorecord.hostingradio.ru/chillhouse96.aacp",
  284.                 "media_content_type": "music",
  285.                 "extra": {
  286.                   "metadata": ""
  287.                 },
  288.                 "entity_id": [
  289.                   "media_player.living_room_speaker"
  290.                 ]
  291.               },
  292.               "target": {
  293.                 "entity_id": [
  294.                   "media_player.living_room_speaker"
  295.                 ]
  296.               }
  297.             },
  298.             "running_script": false,
  299.             "limit": 10
  300.           }
  301.         }
  302.       ],
  303.       "sequence/3": [
  304.         {
  305.           "path": "sequence/3",
  306.           "timestamp": "2022-03-28T09:48:04.440730+00:00",
  307.           "result": {
  308.             "choice": 0
  309.           }
  310.         }
  311.       ],
  312.       "sequence/3/choose/0": [
  313.         {
  314.           "path": "sequence/3/choose/0",
  315.           "timestamp": "2022-03-28T09:48:04.441063+00:00",
  316.           "result": {
  317.             "result": true
  318.           }
  319.         }
  320.       ],
  321.       "sequence/3/choose/0/conditions/0": [
  322.         {
  323.           "path": "sequence/3/choose/0/conditions/0",
  324.           "timestamp": "2022-03-28T09:48:04.441112+00:00",
  325.           "result": {
  326.             "result": true,
  327.             "entities": []
  328.           }
  329.         }
  330.       ],
  331.       "sequence/3/choose/0/sequence/0": [
  332.         {
  333.           "path": "sequence/3/choose/0/sequence/0",
  334.           "timestamp": "2022-03-28T09:48:04.442498+00:00",
  335.           "result": {
  336.             "params": {
  337.               "domain": "group",
  338.               "service": "set",
  339.               "service_data": {
  340.                 "object_id": "resume_action_false_ghresume_77149785f0e1b9898d09caa19a6572eb",
  341.                 "name": "Entities with actions which should not be resumed",
  342.                 "icon": "mdi:alert-octagon",
  343.                 "entities": []
  344.               },
  345.               "target": {}
  346.             },
  347.             "running_script": false,
  348.             "limit": 10
  349.           }
  350.         }
  351.       ],
  352.       "sequence/4": [
  353.         {
  354.           "path": "sequence/4",
  355.           "timestamp": "2022-03-28T09:48:04.445953+00:00",
  356.           "result": {
  357.             "params": {
  358.               "domain": "group",
  359.               "service": "set",
  360.               "service_data": {
  361.                 "object_id": "resume_active_ghresume_77149785f0e1b9898d09caa19a6572eb",
  362.                 "name": "Entities currently active with Google Home Resume script",
  363.                 "icon": "mdi:autorenew",
  364.                 "entities": []
  365.               },
  366.               "target": {}
  367.             },
  368.             "running_script": false,
  369.             "limit": 10
  370.           }
  371.         }
  372.       ],
  373.       "sequence/5": [
  374.         {
  375.           "path": "sequence/5",
  376.           "timestamp": "2022-03-28T09:48:04.450496+00:00",
  377.           "result": {
  378.             "choice": 0
  379.           }
  380.         }
  381.       ],
  382.       "sequence/5/choose/0": [
  383.         {
  384.           "path": "sequence/5/choose/0",
  385.           "timestamp": "2022-03-28T09:48:04.450869+00:00",
  386.           "result": {
  387.             "result": true
  388.           }
  389.         }
  390.       ],
  391.       "sequence/5/choose/0/conditions/0": [
  392.         {
  393.           "path": "sequence/5/choose/0/conditions/0",
  394.           "timestamp": "2022-03-28T09:48:04.450924+00:00",
  395.           "result": {
  396.             "result": true,
  397.             "entities": []
  398.           }
  399.         }
  400.       ],
  401.       "sequence/5/choose/0/sequence/0": [
  402.         {
  403.           "path": "sequence/5/choose/0/sequence/0",
  404.           "timestamp": "2022-03-28T09:48:04.452447+00:00",
  405.           "result": {
  406.             "params": {
  407.               "domain": "group",
  408.               "service": "set",
  409.               "service_data": {
  410.                 "object_id": "resume_script_active_ghresume_77149785f0e1b9898d09caa19a6572eb",
  411.                 "name": "Entities currently active with Google Home Resume script",
  412.                 "icon": "mdi:play-box",
  413.                 "entities": []
  414.               },
  415.               "target": {}
  416.             },
  417.             "running_script": false,
  418.             "limit": 10
  419.           }
  420.         }
  421.       ]
  422.     },
  423.     "config": {
  424.       "alias": "00 🔊 Google Home Resume - Perform resume",
  425.       "description": "Helper script to perform the resume for the Google Home Resume script",
  426.       "icon": "mdi:cast-audio",
  427.       "mode": "parallel",
  428.       "max": 20,
  429.       "sequence": [
  430.         {
  431.           "alias": "State changed since script started?",
  432.           "wait_template": "{{ event_script or \n  ((states[player.entity_id].last_changed > as_datetime(start_time)) and is_state(player.entity_id, 'playing')) \n}}\n",
  433.           "timeout": "00:00:30"
  434.         },
  435.         {
  436.           "alias": "Add entity to the resume active group",
  437.           "service": "group.set",
  438.           "data": {
  439.             "object_id": "resume_active_ghresume_{{ context.id }}",
  440.             "name": "Entities which will be resumed by the Google Home Resume script",
  441.             "icon": "mdi:autorenew",
  442.             "entities": "{%- set current = state_attr('group.resume_active', 'entity_id') %} {%- set current = [] if current == none else current | list %} {{ \n    ( current + [ player.entity_id ] ) | unique | list\n}}\n"
  443.           }
  444.         },
  445.         {
  446.           "alias": "Resume needed?",
  447.           "choose": [
  448.             {
  449.               "conditions": [
  450.                 {
  451.                   "alias": "State changed since script started?",
  452.                   "condition": "template",
  453.                   "value_template": "{{ wait.completed }}"
  454.                 }
  455.               ],
  456.               "sequence": [
  457.                 {
  458.                   "alias": "Set variables",
  459.                   "variables": {
  460.                     "spotify": "{{ player.app_name == 'Spotify' }}\n",
  461.                     "youtube": "{{ player.app_name in ['YouTube', 'YouTube Music'] }}\n",
  462.                     "stream": "{%- set y = ytube_music_data\n            | rejectattr('target', 'in', players_to_resume)\n            | map(attribute='target')\n            | list\n%} {{\n  player.media_content_id is defined\n  and player.media_content_id.startswith('http')\n  and not player.entity_id in y\n}}\n"
  463.                   }
  464.                 },
  465.                 {
  466.                   "alias": "Wait until player is idle again, and all other scripts are finished",
  467.                   "wait_template": "{%- set current = expand(states.group\n                    | selectattr('entity_id', 'search', 'group.resume_script_target_')\n                    | rejectattr('entity_id', 'search', context)\n                    | map(attribute='entity_id')\n                    | list) | map(attribute='entity_id') | list\n%} {%- set checklist = [player.entity_id] + player.members %} {{\n  expand(checklist) | rejectattr('state', 'in', ['idle', 'off']) | list | count == 0\n  and current | select('eq', player.entity_id) | list | count == 0\n}}\n"
  468.                 },
  469.                 {
  470.                   "alias": "Set volume to old volume if needed",
  471.                   "choose": [
  472.                     {
  473.                       "conditions": [
  474.                         {
  475.                           "alias": "Volume restore needed",
  476.                           "condition": "template",
  477.                           "value_template": "{{\n  player.volume_level | round(2, default=0)\n  != state_attr(player.entity_id, 'volume_level') | round(2, default=0)\n}}\n"
  478.                         }
  479.                       ],
  480.                       "sequence": [
  481.                         {
  482.                           "alias": "Player is group?",
  483.                           "choose": [
  484.                             {
  485.                               "conditions": "{{ player.type == 'group' }}",
  486.                               "sequence": [
  487.                                 {
  488.                                   "alias": "Restore volume of members",
  489.                                   "repeat": {
  490.                                     "count": "{{ player.members | count }}",
  491.                                     "sequence": [
  492.                                       {
  493.                                         "alias": "Set volume back to old state",
  494.                                         "service": "media_player.volume_set",
  495.                                         "target": {
  496.                                           "entity_id": "{{ player.members[repeat.index -1] }}"
  497.                                         },
  498.                                         "data": {
  499.                                           "volume_level": "{{\n  member_data\n    | selectattr('entity_id', 'eq', player.members[repeat.index-1])\n    | map(attribute='volume_level')\n    | join\n}}\n"
  500.                                         }
  501.                                       }
  502.                                     ]
  503.                                   }
  504.                                 }
  505.                               ]
  506.                             }
  507.                           ],
  508.                           "default": [
  509.                             {
  510.                               "alias": "Set volume back to old state",
  511.                               "service": "media_player.volume_set",
  512.                               "target": {
  513.                                 "entity_id": "{{ player.entity_id }}"
  514.                               },
  515.                               "data": {
  516.                                 "volume_level": "{{ player.volume_level }}"
  517.                               }
  518.                             }
  519.                           ]
  520.                         }
  521.                       ]
  522.                     }
  523.                   ]
  524.                 },
  525.                 {
  526.                   "alias": "Resume playing",
  527.                   "choose": [
  528.                     {
  529.                       "alias": "YouTube?",
  530.                       "conditions": "{{ player.type == 'screen' and youtube }}",
  531.                       "sequence": [
  532.                         {
  533.                           "alias": "Play video",
  534.                           "service": "media_player.play_media",
  535.                           "target": {
  536.                             "entity_id": "{{ player.entity_id }}"
  537.                           },
  538.                           "data": {
  539.                             "media_content_type": "cast",
  540.                             "media_content_id": " { \"app_name\": \"youtube\", \"media_id\": \"{{ player.media_content_id }}\" }"
  541.                           }
  542.                         },
  543.                         {
  544.                           "alias": "Wait until video is playing",
  545.                           "wait_template": "{{\n  is_state_attr(player.entity_id, 'media_content_id', player.media_content_id)\n  and iif(state_attr(player.entity_id, 'media_position'))\n}}\n"
  546.                         },
  547.                         {
  548.                           "alias": "Seek",
  549.                           "service": "media_player.media_seek",
  550.                           "target": {
  551.                             "entity_id": "{{ player.entity_id }}"
  552.                           },
  553.                           "data": {
  554.                             "seek_position": "{{ [0, player.media_position - 3] | max }}\n"
  555.                           }
  556.                         }
  557.                       ]
  558.                     },
  559.                     {
  560.                       "alias": "Spotify?",
  561.                       "conditions": "{{ spotify }}",
  562.                       "sequence": [
  563.                         {
  564.                           "alias": "Primary spotcast account?",
  565.                           "choose": [
  566.                             {
  567.                               "conditions": "{{ player.spotcast == 'primary_account' }}",
  568.                               "sequence": [
  569.                                 {
  570.                                   "alias": "Resume spotify with primary spotcast account",
  571.                                   "service": "spotcast.start",
  572.                                   "data": {
  573.                                     "entity_id": "{{ player.entity_id }}",
  574.                                     "force_playback": true
  575.                                   }
  576.                                 }
  577.                               ]
  578.                             }
  579.                           ],
  580.                           "default": [
  581.                             {
  582.                               "alias": "Resume spotify with specific account",
  583.                               "service": "spotcast.start",
  584.                               "data": {
  585.                                 "entity_id": "{{ player.entity_id }}",
  586.                                 "account": "{{ player.spotcast }}",
  587.                                 "force_playback": true
  588.                               }
  589.                             }
  590.                           ]
  591.                         }
  592.                       ]
  593.                     },
  594.                     {
  595.                       "alias": "Stream?",
  596.                       "conditions": "{{ stream }}",
  597.                       "sequence": [
  598.                         {
  599.                           "variables": {
  600.                             "picture_url": "{{ player.fixed_picture if player.fixed_picture is defined else player.entity_picture }}",
  601.                             "metadata": {
  602.                               "metadataType": 3,
  603.                               "title": "{{ player.media_title }}",
  604.                               "artist": "{{ player.media_artist }}"
  605.                             },
  606.                             "picture": {
  607.                               "images": [
  608.                                 {
  609.                                   "url": "{{ picture_url }}"
  610.                                 }
  611.                               ]
  612.                             }
  613.                           }
  614.                         },
  615.                         {
  616.                           "alias": "Resume stream",
  617.                           "service": "media_player.play_media",
  618.                           "target": {
  619.                             "entity_id": "{{ player.entity_id }}"
  620.                           },
  621.                           "data": {
  622.                             "media_content_id": "{{ player.media_content_id }}",
  623.                             "media_content_type": "{{ player.media_content_type }}",
  624.                             "extra": {
  625.                               "metadata": "{{ medadata if picture_url == 'no pic' else dict(metadata, **picture) }}\n"
  626.                             }
  627.                           }
  628.                         }
  629.                       ]
  630.                     }
  631.                   ]
  632.                 }
  633.               ]
  634.             }
  635.           ]
  636.         },
  637.         {
  638.           "alias": "Check if resume_action_false group exists",
  639.           "choose": [
  640.             {
  641.               "conditions": "{{ \n  integration_entities('group') \n    | select('search', 'resume_action_false_ghresume_' ~ context.id)\n    | list \n    | count > 0 \n}}\n",
  642.               "sequence": [
  643.                 {
  644.                   "alias": "Remove entity from group",
  645.                   "service": "group.set",
  646.                   "data": {
  647.                     "object_id": "resume_action_false_ghresume_{{ context.id }}",
  648.                     "name": "Entities with actions which should not be resumed",
  649.                     "icon": "mdi:alert-octagon",
  650.                     "entities": "{%- set current = state_attr('group.resume_action_false_ghresume' ~ context.id, 'entity_id') %} {{ iif(current == none, [], current) | reject('eq', player.entity_id) | list }}\n"
  651.                   }
  652.                 }
  653.               ]
  654.             }
  655.           ]
  656.         },
  657.         {
  658.           "alias": "Remove entity from group",
  659.           "service": "group.set",
  660.           "data": {
  661.             "object_id": "resume_active_ghresume_{{ context.id }}",
  662.             "name": "Entities currently active with Google Home Resume script",
  663.             "icon": "mdi:autorenew",
  664.             "entities": "{%- set current = state_attr('group.resume_active', 'entity_id') %} {{ iif(current == none, [], current) | reject('eq', player.entity_id) | list }}\n"
  665.           }
  666.         },
  667.         {
  668.           "alias": "Check if resume_script_active group exists",
  669.           "choose": [
  670.             {
  671.               "conditions": "{{ \n  integration_entities('group') \n    | select('search', 'resume_script_active_ghresume_' ~ context.id)\n    | list \n    | count > 0 \n}}\n",
  672.               "sequence": [
  673.                 {
  674.                   "alias": "Remove entity from group",
  675.                   "service": "group.set",
  676.                   "data": {
  677.                     "object_id": "resume_script_active_ghresume_{{ context.id }}",
  678.                     "name": "Entities currently active with Google Home Resume script",
  679.                     "icon": "mdi:play-box",
  680.                     "entities": "{%- set current = state_attr('group.resume_active_ghresume' ~ context.id, 'entity_id') %} {{ iif(current == none, [], current) | reject('eq', player.entity_id) | list }}\n"
  681.                   }
  682.                 }
  683.               ]
  684.             }
  685.           ]
  686.         }
  687.       ]
  688.     },
  689.     "blueprint_inputs": null,
  690.     "context": {
  691.       "id": "77149785f0e1b9898d09caa19a6572eb",
  692.       "parent_id": null,
  693.       "user_id": "50437e77880745a2a2a14f3daae510ee"
  694.     }
  695.   },
  696.   "logbookEntries": [
  697.     {
  698.       "when": "2022-03-28T09:48:02.858349+00:00",
  699.       "name": "00 🔊 Google Home Resume - Perform resume",
  700.       "state": "on",
  701.       "entity_id": "script.google_home_resume_perform_resume",
  702.       "icon": "mdi:cast-audio",
  703.       "context_user_id": "50437e77880745a2a2a14f3daae510ee",
  704.       "message": "turned on"
  705.     },
  706.     {
  707.       "when": "2022-03-28T09:48:02.918672+00:00",
  708.       "name": "Living Room speaker",
  709.       "state": "idle",
  710.       "entity_id": "media_player.living_room_speaker",
  711.       "context_user_id": "50437e77880745a2a2a14f3daae510ee",
  712.       "context_entity_id": "script.google_home_resume_perform_resume",
  713.       "context_entity_id_name": "00 🔊 Google Home Resume - Perform resume",
  714.       "context_event_type": "state_changed",
  715.       "message": "changed to Idle"
  716.     },
  717.     {
  718.       "when": "2022-03-28T09:48:03.288104+00:00",
  719.       "name": "Living Room speaker",
  720.       "state": "playing",
  721.       "entity_id": "media_player.living_room_speaker",
  722.       "context_user_id": "50437e77880745a2a2a14f3daae510ee",
  723.       "context_entity_id": "script.google_home_resume_perform_resume",
  724.       "context_entity_id_name": "00 🔊 Google Home Resume - Perform resume",
  725.       "context_event_type": "state_changed",
  726.       "message": "changed to Playing"
  727.     },
  728.     {
  729.       "when": "2022-03-28T09:48:04.423581+00:00",
  730.       "name": "Living Room speaker",
  731.       "state": "idle",
  732.       "entity_id": "media_player.living_room_speaker",
  733.       "context_user_id": "50437e77880745a2a2a14f3daae510ee",
  734.       "context_entity_id": "script.google_home_resume_perform_resume",
  735.       "context_entity_id_name": "00 🔊 Google Home Resume - Perform resume",
  736.       "context_event_type": "state_changed",
  737.       "message": "changed to Idle"
  738.     },
  739.     {
  740.       "when": "2022-03-28T09:48:04.455943+00:00",
  741.       "name": "00 🔊 Google Home Resume - Perform resume",
  742.       "state": "off",
  743.       "entity_id": "script.google_home_resume_perform_resume",
  744.       "icon": "mdi:cast-audio",
  745.       "context_user_id": "50437e77880745a2a2a14f3daae510ee",
  746.       "context_entity_id": "script.google_home_resume_perform_resume",
  747.       "context_entity_id_name": "00 🔊 Google Home Resume - Perform resume",
  748.       "context_event_type": "state_changed",
  749.       "message": "turned off"
  750.     },
  751.     {
  752.       "when": "2022-03-28T09:48:04.889294+00:00",
  753.       "name": "00 🔊 Google Home Resume",
  754.       "state": "off",
  755.       "entity_id": "script.google_home_resume",
  756.       "icon": "mdi:cast-audio",
  757.       "context_user_id": "50437e77880745a2a2a14f3daae510ee",
  758.       "context_entity_id": "script.google_home_resume_perform_resume",
  759.       "context_entity_id_name": "00 🔊 Google Home Resume - Perform resume",
  760.       "context_event_type": "state_changed",
  761.       "message": "turned off"
  762.     },
  763.     {
  764.       "when": "2022-03-28T09:48:04.891411+00:00",
  765.       "name": "TTS TEST",
  766.       "state": "off",
  767.       "entity_id": "script.tts_2",
  768.       "context_user_id": "50437e77880745a2a2a14f3daae510ee",
  769.       "context_entity_id": "script.google_home_resume_perform_resume",
  770.       "context_entity_id_name": "00 🔊 Google Home Resume - Perform resume",
  771.       "context_event_type": "state_changed",
  772.       "message": "turned off"
  773.     },
  774.     {
  775.       "when": "2022-03-28T09:48:05.252872+00:00",
  776.       "name": "Living Room speaker",
  777.       "state": "playing",
  778.       "entity_id": "media_player.living_room_speaker",
  779.       "context_user_id": "50437e77880745a2a2a14f3daae510ee",
  780.       "context_entity_id": "script.google_home_resume_perform_resume",
  781.       "context_entity_id_name": "00 🔊 Google Home Resume - Perform resume",
  782.       "context_event_type": "state_changed",
  783.       "message": "changed to Playing"
  784.     }
  785.   ]
  786. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement