Advertisement
Guest User

Untitled

a guest
Mar 27th, 2022
32
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
JSON 15.26 KB | None | 0 0
  1. {
  2.   "trace": {
  3.     "last_step": "sequence/12",
  4.     "run_id": "e20a0368bea8a9588c828fc6a1e3f5a5",
  5.     "state": "stopped",
  6.     "script_execution": "error",
  7.     "timestamp": {
  8.       "start": "2022-03-27T20:08:53.437876+00:00",
  9.       "finish": "2022-03-27T20:08:53.741974+00:00"
  10.     },
  11.     "domain": "script",
  12.     "item_id": "google_home_resume",
  13.     "error": "TypeError: argument of type 'NoneType' is not iterable",
  14.     "trace": {
  15.       "sequence/0": [
  16.         {
  17.           "path": "sequence/0",
  18.           "timestamp": "2022-03-27T20:08:53.438893+00:00",
  19.           "changed_variables": {
  20.             "players_screen": null,
  21.             "speaker_groups": null,
  22.             "primary_spotcast": "pavel",
  23.             "default_volume_level": 0.25,
  24.             "this": {
  25.               "entity_id": "script.google_home_resume",
  26.               "state": "off",
  27.               "attributes": {
  28.                 "last_triggered": "2022-03-27T19:07:39.454526+00:00",
  29.                 "mode": "parallel",
  30.                 "current": 0,
  31.                 "max": 10,
  32.                 "icon": "mdi:cast-audio",
  33.                 "friendly_name": "00 🔊 Google Home Resume"
  34.               },
  35.               "last_changed": "2022-03-27T20:08:51.648098+00:00",
  36.               "last_updated": "2022-03-27T20:08:51.648098+00:00",
  37.               "context": {
  38.                 "id": "4c7dc7b84319063fd3f6647d60d7abf9",
  39.                 "parent_id": null,
  40.                 "user_id": null
  41.               }
  42.             },
  43.             "action": [
  44.               {
  45.                 "service": "tts.google_say",
  46.                 "data": {
  47.                   "entity_id": "media_player.living_room_speaker",
  48.                   "message": "Testing",
  49.                   "language": "en"
  50.                 }
  51.               }
  52.             ],
  53.             "context": {
  54.               "id": "e9b5a6da5932a4a0515c1974a47c7e12",
  55.               "parent_id": null,
  56.               "user_id": "50437e77880745a2a2a14f3daae510ee"
  57.             }
  58.           }
  59.         }
  60.       ],
  61.       "sequence/1": [
  62.         {
  63.           "path": "sequence/1",
  64.           "timestamp": "2022-03-27T20:08:53.439079+00:00",
  65.           "changed_variables": {
  66.             "version": "1.7.6"
  67.           },
  68.           "result": {
  69.             "choice": 0
  70.           }
  71.         }
  72.       ],
  73.       "sequence/1/choose/0": [
  74.         {
  75.           "path": "sequence/1/choose/0",
  76.           "timestamp": "2022-03-27T20:08:53.439423+00:00",
  77.           "result": {
  78.             "result": true
  79.           }
  80.         }
  81.       ],
  82.       "sequence/1/choose/0/conditions/0": [
  83.         {
  84.           "path": "sequence/1/choose/0/conditions/0",
  85.           "timestamp": "2022-03-27T20:08:53.439480+00:00",
  86.           "result": {
  87.             "result": true,
  88.             "entities": []
  89.           }
  90.         }
  91.       ],
  92.       "sequence/1/choose/0/sequence/0": [
  93.         {
  94.           "path": "sequence/1/choose/0/sequence/0",
  95.           "timestamp": "2022-03-27T20:08:53.442381+00:00",
  96.           "result": {
  97.             "params": {
  98.               "domain": "homeassistant",
  99.               "service": "update_entity",
  100.               "service_data": {},
  101.               "target": {
  102.                 "entity_id": [
  103.                   "media_player.spotify_pavel"
  104.                 ]
  105.               }
  106.             },
  107.             "running_script": false,
  108.             "limit": 10
  109.           }
  110.         }
  111.       ],
  112.       "sequence/2": [
  113.         {
  114.           "path": "sequence/2",
  115.           "timestamp": "2022-03-27T20:08:53.710651+00:00"
  116.         }
  117.       ],
  118.       "sequence/2/choose/0": [
  119.         {
  120.           "path": "sequence/2/choose/0",
  121.           "timestamp": "2022-03-27T20:08:53.711126+00:00",
  122.           "result": {
  123.             "result": false
  124.           }
  125.         }
  126.       ],
  127.       "sequence/2/choose/0/conditions/0": [
  128.         {
  129.           "path": "sequence/2/choose/0/conditions/0",
  130.           "timestamp": "2022-03-27T20:08:53.711195+00:00",
  131.           "result": {
  132.             "result": false,
  133.             "entities": [
  134.               "script.google_home_resume"
  135.             ]
  136.           }
  137.         }
  138.       ],
  139.       "sequence/3": [
  140.         {
  141.           "path": "sequence/3",
  142.           "timestamp": "2022-03-27T20:08:53.712243+00:00"
  143.         }
  144.       ],
  145.       "sequence/4": [
  146.         {
  147.           "path": "sequence/4",
  148.           "timestamp": "2022-03-27T20:08:53.722257+00:00",
  149.           "changed_variables": {
  150.             "start_time": "2022-03-27 23:08:53.712622+03:00",
  151.             "event_script": false,
  152.             "speaker_group_list": [],
  153.             "service_calls": [
  154.               {
  155.                 "service": "tts.google_say",
  156.                 "data": {
  157.                   "entity_id": "media_player.living_room_speaker",
  158.                   "message": "Testing",
  159.                   "language": "en"
  160.                 }
  161.               }
  162.             ],
  163.             "no_service_count": 0,
  164.             "target_list": [
  165.               "media_player.living_room_speaker"
  166.             ],
  167.             "player_data": [
  168.               {
  169.                 "data_source": "resume_script",
  170.                 "entity_id": "media_player.living_room_speaker",
  171.                 "state": "playing",
  172.                 "app_name": "Default Media Receiver",
  173.                 "volume_level": 0.4000000059604645,
  174.                 "media_content_id": "https://radiorecord.hostingradio.ru/chillhouse96.aacp",
  175.                 "media_title": "no title",
  176.                 "media_artist": "no artist",
  177.                 "media_content_type": "no type",
  178.                 "entity_picture": "no pic",
  179.                 "media_position": 59.00797496185303
  180.               }
  181.             ],
  182.             "players_to_resume": [
  183.               "media_player.living_room_speaker"
  184.             ],
  185.             "spotify_data": [],
  186.             "ytube_music_data": []
  187.           }
  188.         }
  189.       ],
  190.       "sequence/4/choose/0": [
  191.         {
  192.           "path": "sequence/4/choose/0",
  193.           "timestamp": "2022-03-27T20:08:53.722576+00:00",
  194.           "result": {
  195.             "result": false
  196.           }
  197.         }
  198.       ],
  199.       "sequence/4/choose/0/conditions/0": [
  200.         {
  201.           "path": "sequence/4/choose/0/conditions/0",
  202.           "timestamp": "2022-03-27T20:08:53.722620+00:00",
  203.           "result": {
  204.             "result": false,
  205.             "entities": []
  206.           }
  207.         }
  208.       ],
  209.       "sequence/5": [
  210.         {
  211.           "path": "sequence/5",
  212.           "timestamp": "2022-03-27T20:08:53.722867+00:00"
  213.         }
  214.       ],
  215.       "sequence/5/choose/0": [
  216.         {
  217.           "path": "sequence/5/choose/0",
  218.           "timestamp": "2022-03-27T20:08:53.723022+00:00",
  219.           "result": {
  220.             "result": false
  221.           }
  222.         }
  223.       ],
  224.       "sequence/5/choose/0/conditions/0": [
  225.         {
  226.           "path": "sequence/5/choose/0/conditions/0",
  227.           "timestamp": "2022-03-27T20:08:53.723064+00:00",
  228.           "result": {
  229.             "result": false,
  230.             "entities": []
  231.           }
  232.         }
  233.       ],
  234.       "sequence/6": [
  235.         {
  236.           "path": "sequence/6",
  237.           "timestamp": "2022-03-27T20:08:53.723288+00:00",
  238.           "result": {
  239.             "result": true,
  240.             "entities": []
  241.           }
  242.         }
  243.       ],
  244.       "sequence/7": [
  245.         {
  246.           "path": "sequence/7",
  247.           "timestamp": "2022-03-27T20:08:53.723530+00:00"
  248.         }
  249.       ],
  250.       "sequence/8": [
  251.         {
  252.           "path": "sequence/8",
  253.           "timestamp": "2022-03-27T20:08:53.724104+00:00",
  254.           "changed_variables": {
  255.             "target_not_playing": [],
  256.             "target_no_volume": []
  257.           },
  258.           "result": {
  259.             "params": {
  260.               "domain": "group",
  261.               "service": "set",
  262.               "service_data": {
  263.                 "object_id": "resume_script_active_ghresume_e9b5a6da5932a4a0515c1974a47c7e12",
  264.                 "name": "Entities currently active with Google Home Resume script",
  265.                 "icon": "mdi:play-box",
  266.                 "entities": [
  267.                   "media_player.living_room_speaker"
  268.                 ]
  269.               },
  270.               "target": {}
  271.             },
  272.             "running_script": false,
  273.             "limit": 10
  274.           }
  275.         }
  276.       ],
  277.       "sequence/9": [
  278.         {
  279.           "path": "sequence/9",
  280.           "timestamp": "2022-03-27T20:08:53.728179+00:00",
  281.           "result": {
  282.             "params": {
  283.               "domain": "group",
  284.               "service": "set",
  285.               "service_data": {
  286.                 "object_id": "resume_active_ghresume_e9b5a6da5932a4a0515c1974a47c7e12",
  287.                 "name": "Add ytube music players which will be resumed to resume active group",
  288.                 "icon": "mdi:autorenew",
  289.                 "entities": []
  290.               },
  291.               "target": {}
  292.             },
  293.             "running_script": false,
  294.             "limit": 10
  295.           }
  296.         }
  297.       ],
  298.       "sequence/10": [
  299.         {
  300.           "path": "sequence/10",
  301.           "timestamp": "2022-03-27T20:08:53.731907+00:00",
  302.           "result": {
  303.             "choice": 0
  304.           }
  305.         }
  306.       ],
  307.       "sequence/10/choose/0": [
  308.         {
  309.           "path": "sequence/10/choose/0",
  310.           "timestamp": "2022-03-27T20:08:53.732216+00:00",
  311.           "result": {
  312.             "result": true
  313.           }
  314.         }
  315.       ],
  316.       "sequence/10/choose/0/conditions/0": [
  317.         {
  318.           "path": "sequence/10/choose/0/conditions/0",
  319.           "timestamp": "2022-03-27T20:08:53.732264+00:00",
  320.           "result": {
  321.             "result": true,
  322.             "entities": []
  323.           }
  324.         }
  325.       ],
  326.       "sequence/10/choose/0/sequence/0": [
  327.         {
  328.           "path": "sequence/10/choose/0/sequence/0",
  329.           "timestamp": "2022-03-27T20:08:53.733110+00:00",
  330.           "result": {
  331.             "params": {
  332.               "domain": "group",
  333.               "service": "set",
  334.               "service_data": {
  335.                 "object_id": "resume_action_false_ghresume_e9b5a6da5932a4a0515c1974a47c7e12",
  336.                 "name": "Entities with actions which should not be resumed",
  337.                 "icon": "mdi:alert-octagon",
  338.                 "entities": [
  339.                   "media_player.living_room_speaker"
  340.                 ]
  341.               },
  342.               "target": {}
  343.             },
  344.             "running_script": false,
  345.             "limit": 10
  346.           }
  347.         }
  348.       ],
  349.       "sequence/11": [
  350.         {
  351.           "path": "sequence/11",
  352.           "timestamp": "2022-03-27T20:08:53.737185+00:00"
  353.         }
  354.       ],
  355.       "sequence/11/choose/0": [
  356.         {
  357.           "path": "sequence/11/choose/0",
  358.           "timestamp": "2022-03-27T20:08:53.737490+00:00",
  359.           "result": {
  360.             "result": false
  361.           }
  362.         }
  363.       ],
  364.       "sequence/11/choose/0/conditions/0": [
  365.         {
  366.           "path": "sequence/11/choose/0/conditions/0",
  367.           "timestamp": "2022-03-27T20:08:53.737542+00:00",
  368.           "result": {
  369.             "result": false,
  370.             "entities": []
  371.           }
  372.         }
  373.       ],
  374.       "sequence/12": [
  375.         {
  376.           "path": "sequence/12",
  377.           "timestamp": "2022-03-27T20:08:53.738027+00:00",
  378.           "error": "TypeError: argument of type 'NoneType' is not iterable"
  379.         }
  380.       ]
  381.     },
  382.     "config": {
  383.       "alias": "00 🔊 Google Home Resume",
  384.       "description": "Script for resuming Google Home speakers",
  385.       "icon": "mdi:cast-audio",
  386.       "mode": "parallel",
  387.       "fields": {
  388.         "target": {
  389.           "description": "Enter the targets in case they are not clear from the service calls",
  390.           "required": false,
  391.           "selector": {
  392.             "target": {
  393.               "entity": {
  394.                 "integration": "cast",
  395.                 "domain": "media_player"
  396.               },
  397.               "device": {
  398.                 "integration": "cast"
  399.               }
  400.             }
  401.           }
  402.         },
  403.         "action": {
  404.           "description": "Actions to be performed (only service calls will work)",
  405.           "required": true,
  406.           "selector": {
  407.             "action": null
  408.           }
  409.         },
  410.         "resume_this_action": {
  411.           "description": "Set to false if you don't want to resume the actions started with this script (default is true)",
  412.           "required": false,
  413.           "selector": {
  414.             "boolean": null
  415.           }
  416.         }
  417.       },
  418.       "variables": {
  419.         "players_screen": null,
  420.         "speaker_groups": null,
  421.         "primary_spotcast": "pavel",
  422.         "default_volume_level": 0.25
  423.       },
  424.       "sequence": [
  425.         {
  426.           "alias": "Version number",
  427.           "variables": {
  428.             "version": "1.7.6"
  429.           }
  430.         },
  431.         {
  432.           "alias": "Are there Spotify entities?",
  433.           "choose": [
  434.             {
  435.               "conditions": "{{ integration_entities('spotify') | count > 0 }}",
  436.               "sequence": [
  437.                 {
  438.                   "alias": "Update Spotify entities",
  439.                   "service": "homeassistant.update_entity",
  440.                   "target": {
  441.                     "entity_id": "{{ integration_entities('spotify') }}"
  442.                   }
  443.                 }
  444.               ]
  445.             }
  446.           ]
  447.         },
  448.         {
  449.           "alias": "Failsafe to remove all groups if the script was not running",
  450.           "choose": [
  451.             {
  452.               "conditions": "{{ \n  state_attr(this.entity_id, 'current') == 1\n  and integration_entities('group')\n        | select('search', 'ghresume')\n        | list | count > 0\n}}\n",
  453.               "sequence": [
  454.                 {
  455.                   "alias": "Which groups to remove",
  456.                   "variables": {
  457.                     "groups_existing": "{{ \n  integration_entities('group')\n    | select('search', 'ghresume')\n    | list\n}}\n"
  458.                   }
  459.                 },
  460.                 {
  461.                   "alias": "Loop to remove groups",
  462.                   "repeat": {
  463.                     "count": "{{ groups_existing | count }}",
  464.                     "sequence": [
  465.                       {
  466.                         "alias": "Remove one group",
  467.                         "service": "group.remove",
  468.                         "data": {
  469.                           "object_id": "{{ states[groups_existing[repeat.index -1]].object_id }}\n"
  470.                         }
  471.                       }
  472.                     ]
  473.                   }
  474.                 }
  475.               ]
  476.             }
  477.           ]
  478.         },
  479.         {
  480.           "alias": "Set variables to be used in the script",
  481.           "variables": {
  482.             "start_time": "{{ now() }}",
  483.             "event_script": "{{ event_script if event_script is defined else false }}",
  484.             "speaker_group_list": "{{ speaker_groups.keys() | list if (speaker_groups is defined and speaker_groups) else [] }}",
  485.             "service_calls": "{%- set ns = namespace(service = []) %} {%- for item in action %}\n  {%- if item.get('service', 'uhoh') != 'uhoh' %}\n    {%- set ns.service = ns.service + [ item ] %}\n  {%- endif %}\n{%- endfor %} {{ ns.service }}\n",
  486.             "no_service_count": "{{ action | reject('in', service_calls) | list | count }}\n",
  487.             "target_list": "{%- if target_list is defined %}\n  {{ target_list }}\n{%- else %}\n  {
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement