Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- {
- "trace": {
- "last_step": "sequence/12",
- "run_id": "e20a0368bea8a9588c828fc6a1e3f5a5",
- "state": "stopped",
- "script_execution": "error",
- "timestamp": {
- "start": "2022-03-27T20:08:53.437876+00:00",
- "finish": "2022-03-27T20:08:53.741974+00:00"
- },
- "domain": "script",
- "item_id": "google_home_resume",
- "error": "TypeError: argument of type 'NoneType' is not iterable",
- "trace": {
- "sequence/0": [
- {
- "path": "sequence/0",
- "timestamp": "2022-03-27T20:08:53.438893+00:00",
- "changed_variables": {
- "players_screen": null,
- "speaker_groups": null,
- "primary_spotcast": "pavel",
- "default_volume_level": 0.25,
- "this": {
- "entity_id": "script.google_home_resume",
- "state": "off",
- "attributes": {
- "last_triggered": "2022-03-27T19:07:39.454526+00:00",
- "mode": "parallel",
- "current": 0,
- "max": 10,
- "icon": "mdi:cast-audio",
- "friendly_name": "00 🔊 Google Home Resume"
- },
- "last_changed": "2022-03-27T20:08:51.648098+00:00",
- "last_updated": "2022-03-27T20:08:51.648098+00:00",
- "context": {
- "id": "4c7dc7b84319063fd3f6647d60d7abf9",
- "parent_id": null,
- "user_id": null
- }
- },
- "action": [
- {
- "service": "tts.google_say",
- "data": {
- "entity_id": "media_player.living_room_speaker",
- "message": "Testing",
- "language": "en"
- }
- }
- ],
- "context": {
- "id": "e9b5a6da5932a4a0515c1974a47c7e12",
- "parent_id": null,
- "user_id": "50437e77880745a2a2a14f3daae510ee"
- }
- }
- }
- ],
- "sequence/1": [
- {
- "path": "sequence/1",
- "timestamp": "2022-03-27T20:08:53.439079+00:00",
- "changed_variables": {
- "version": "1.7.6"
- },
- "result": {
- "choice": 0
- }
- }
- ],
- "sequence/1/choose/0": [
- {
- "path": "sequence/1/choose/0",
- "timestamp": "2022-03-27T20:08:53.439423+00:00",
- "result": {
- "result": true
- }
- }
- ],
- "sequence/1/choose/0/conditions/0": [
- {
- "path": "sequence/1/choose/0/conditions/0",
- "timestamp": "2022-03-27T20:08:53.439480+00:00",
- "result": {
- "result": true,
- "entities": []
- }
- }
- ],
- "sequence/1/choose/0/sequence/0": [
- {
- "path": "sequence/1/choose/0/sequence/0",
- "timestamp": "2022-03-27T20:08:53.442381+00:00",
- "result": {
- "params": {
- "domain": "homeassistant",
- "service": "update_entity",
- "service_data": {},
- "target": {
- "entity_id": [
- "media_player.spotify_pavel"
- ]
- }
- },
- "running_script": false,
- "limit": 10
- }
- }
- ],
- "sequence/2": [
- {
- "path": "sequence/2",
- "timestamp": "2022-03-27T20:08:53.710651+00:00"
- }
- ],
- "sequence/2/choose/0": [
- {
- "path": "sequence/2/choose/0",
- "timestamp": "2022-03-27T20:08:53.711126+00:00",
- "result": {
- "result": false
- }
- }
- ],
- "sequence/2/choose/0/conditions/0": [
- {
- "path": "sequence/2/choose/0/conditions/0",
- "timestamp": "2022-03-27T20:08:53.711195+00:00",
- "result": {
- "result": false,
- "entities": [
- "script.google_home_resume"
- ]
- }
- }
- ],
- "sequence/3": [
- {
- "path": "sequence/3",
- "timestamp": "2022-03-27T20:08:53.712243+00:00"
- }
- ],
- "sequence/4": [
- {
- "path": "sequence/4",
- "timestamp": "2022-03-27T20:08:53.722257+00:00",
- "changed_variables": {
- "start_time": "2022-03-27 23:08:53.712622+03:00",
- "event_script": false,
- "speaker_group_list": [],
- "service_calls": [
- {
- "service": "tts.google_say",
- "data": {
- "entity_id": "media_player.living_room_speaker",
- "message": "Testing",
- "language": "en"
- }
- }
- ],
- "no_service_count": 0,
- "target_list": [
- "media_player.living_room_speaker"
- ],
- "player_data": [
- {
- "data_source": "resume_script",
- "entity_id": "media_player.living_room_speaker",
- "state": "playing",
- "app_name": "Default Media Receiver",
- "volume_level": 0.4000000059604645,
- "media_content_id": "https://radiorecord.hostingradio.ru/chillhouse96.aacp",
- "media_title": "no title",
- "media_artist": "no artist",
- "media_content_type": "no type",
- "entity_picture": "no pic",
- "media_position": 59.00797496185303
- }
- ],
- "players_to_resume": [
- "media_player.living_room_speaker"
- ],
- "spotify_data": [],
- "ytube_music_data": []
- }
- }
- ],
- "sequence/4/choose/0": [
- {
- "path": "sequence/4/choose/0",
- "timestamp": "2022-03-27T20:08:53.722576+00:00",
- "result": {
- "result": false
- }
- }
- ],
- "sequence/4/choose/0/conditions/0": [
- {
- "path": "sequence/4/choose/0/conditions/0",
- "timestamp": "2022-03-27T20:08:53.722620+00:00",
- "result": {
- "result": false,
- "entities": []
- }
- }
- ],
- "sequence/5": [
- {
- "path": "sequence/5",
- "timestamp": "2022-03-27T20:08:53.722867+00:00"
- }
- ],
- "sequence/5/choose/0": [
- {
- "path": "sequence/5/choose/0",
- "timestamp": "2022-03-27T20:08:53.723022+00:00",
- "result": {
- "result": false
- }
- }
- ],
- "sequence/5/choose/0/conditions/0": [
- {
- "path": "sequence/5/choose/0/conditions/0",
- "timestamp": "2022-03-27T20:08:53.723064+00:00",
- "result": {
- "result": false,
- "entities": []
- }
- }
- ],
- "sequence/6": [
- {
- "path": "sequence/6",
- "timestamp": "2022-03-27T20:08:53.723288+00:00",
- "result": {
- "result": true,
- "entities": []
- }
- }
- ],
- "sequence/7": [
- {
- "path": "sequence/7",
- "timestamp": "2022-03-27T20:08:53.723530+00:00"
- }
- ],
- "sequence/8": [
- {
- "path": "sequence/8",
- "timestamp": "2022-03-27T20:08:53.724104+00:00",
- "changed_variables": {
- "target_not_playing": [],
- "target_no_volume": []
- },
- "result": {
- "params": {
- "domain": "group",
- "service": "set",
- "service_data": {
- "object_id": "resume_script_active_ghresume_e9b5a6da5932a4a0515c1974a47c7e12",
- "name": "Entities currently active with Google Home Resume script",
- "icon": "mdi:play-box",
- "entities": [
- "media_player.living_room_speaker"
- ]
- },
- "target": {}
- },
- "running_script": false,
- "limit": 10
- }
- }
- ],
- "sequence/9": [
- {
- "path": "sequence/9",
- "timestamp": "2022-03-27T20:08:53.728179+00:00",
- "result": {
- "params": {
- "domain": "group",
- "service": "set",
- "service_data": {
- "object_id": "resume_active_ghresume_e9b5a6da5932a4a0515c1974a47c7e12",
- "name": "Add ytube music players which will be resumed to resume active group",
- "icon": "mdi:autorenew",
- "entities": []
- },
- "target": {}
- },
- "running_script": false,
- "limit": 10
- }
- }
- ],
- "sequence/10": [
- {
- "path": "sequence/10",
- "timestamp": "2022-03-27T20:08:53.731907+00:00",
- "result": {
- "choice": 0
- }
- }
- ],
- "sequence/10/choose/0": [
- {
- "path": "sequence/10/choose/0",
- "timestamp": "2022-03-27T20:08:53.732216+00:00",
- "result": {
- "result": true
- }
- }
- ],
- "sequence/10/choose/0/conditions/0": [
- {
- "path": "sequence/10/choose/0/conditions/0",
- "timestamp": "2022-03-27T20:08:53.732264+00:00",
- "result": {
- "result": true,
- "entities": []
- }
- }
- ],
- "sequence/10/choose/0/sequence/0": [
- {
- "path": "sequence/10/choose/0/sequence/0",
- "timestamp": "2022-03-27T20:08:53.733110+00:00",
- "result": {
- "params": {
- "domain": "group",
- "service": "set",
- "service_data": {
- "object_id": "resume_action_false_ghresume_e9b5a6da5932a4a0515c1974a47c7e12",
- "name": "Entities with actions which should not be resumed",
- "icon": "mdi:alert-octagon",
- "entities": [
- "media_player.living_room_speaker"
- ]
- },
- "target": {}
- },
- "running_script": false,
- "limit": 10
- }
- }
- ],
- "sequence/11": [
- {
- "path": "sequence/11",
- "timestamp": "2022-03-27T20:08:53.737185+00:00"
- }
- ],
- "sequence/11/choose/0": [
- {
- "path": "sequence/11/choose/0",
- "timestamp": "2022-03-27T20:08:53.737490+00:00",
- "result": {
- "result": false
- }
- }
- ],
- "sequence/11/choose/0/conditions/0": [
- {
- "path": "sequence/11/choose/0/conditions/0",
- "timestamp": "2022-03-27T20:08:53.737542+00:00",
- "result": {
- "result": false,
- "entities": []
- }
- }
- ],
- "sequence/12": [
- {
- "path": "sequence/12",
- "timestamp": "2022-03-27T20:08:53.738027+00:00",
- "error": "TypeError: argument of type 'NoneType' is not iterable"
- }
- ]
- },
- "config": {
- "alias": "00 🔊 Google Home Resume",
- "description": "Script for resuming Google Home speakers",
- "icon": "mdi:cast-audio",
- "mode": "parallel",
- "fields": {
- "target": {
- "description": "Enter the targets in case they are not clear from the service calls",
- "required": false,
- "selector": {
- "target": {
- "entity": {
- "integration": "cast",
- "domain": "media_player"
- },
- "device": {
- "integration": "cast"
- }
- }
- }
- },
- "action": {
- "description": "Actions to be performed (only service calls will work)",
- "required": true,
- "selector": {
- "action": null
- }
- },
- "resume_this_action": {
- "description": "Set to false if you don't want to resume the actions started with this script (default is true)",
- "required": false,
- "selector": {
- "boolean": null
- }
- }
- },
- "variables": {
- "players_screen": null,
- "speaker_groups": null,
- "primary_spotcast": "pavel",
- "default_volume_level": 0.25
- },
- "sequence": [
- {
- "alias": "Version number",
- "variables": {
- "version": "1.7.6"
- }
- },
- {
- "alias": "Are there Spotify entities?",
- "choose": [
- {
- "conditions": "{{ integration_entities('spotify') | count > 0 }}",
- "sequence": [
- {
- "alias": "Update Spotify entities",
- "service": "homeassistant.update_entity",
- "target": {
- "entity_id": "{{ integration_entities('spotify') }}"
- }
- }
- ]
- }
- ]
- },
- {
- "alias": "Failsafe to remove all groups if the script was not running",
- "choose": [
- {
- "conditions": "{{ \n state_attr(this.entity_id, 'current') == 1\n and integration_entities('group')\n | select('search', 'ghresume')\n | list | count > 0\n}}\n",
- "sequence": [
- {
- "alias": "Which groups to remove",
- "variables": {
- "groups_existing": "{{ \n integration_entities('group')\n | select('search', 'ghresume')\n | list\n}}\n"
- }
- },
- {
- "alias": "Loop to remove groups",
- "repeat": {
- "count": "{{ groups_existing | count }}",
- "sequence": [
- {
- "alias": "Remove one group",
- "service": "group.remove",
- "data": {
- "object_id": "{{ states[groups_existing[repeat.index -1]].object_id }}\n"
- }
- }
- ]
- }
- }
- ]
- }
- ]
- },
- {
- "alias": "Set variables to be used in the script",
- "variables": {
- "start_time": "{{ now() }}",
- "event_script": "{{ event_script if event_script is defined else false }}",
- "speaker_group_list": "{{ speaker_groups.keys() | list if (speaker_groups is defined and speaker_groups) else [] }}",
- "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",
- "no_service_count": "{{ action | reject('in', service_calls) | list | count }}\n",
- "target_list": "{%- if target_list is defined %}\n {{ target_list }}\n{%- else %}\n {
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement