<?xml version="1.0" encoding="UTF-8" ?>
<EventGhost Version="0.5.0-beta6" Guid="{C911C36D-DDE8-45CD-B695-0F8141AF12DE}" Time="1492797816.69">
    <Autostart Name="Autostart" XML_Guid="{D12E67A8-2F91-49C7-B9CC-BE374FBBB700}" Expanded="True">
        <Plugin Enabled="False" XML_Guid="{153CDA28-C171-49CF-B20A-519FCCFA6C97}" Identifier="AxialControlHA" Guid="AxialControlHA" File="AxialControlHA">
            gAIoWA0AAAAxOTIuMTY4LjEuNzkzcQBNmgRYCAAAAHBhc3N3b3JkcQGISw90cQIu
        </Plugin>
        <Plugin XML_Guid="{0869F9EF-32CF-476D-849B-D9BE391A1D3D}" Identifier="XBMC2" Guid="{8C8B850C-773F-4583-AAD9-A568262B7933}" File="XBMCRepeat">
            gAJ9cQAoVQdKU09OUlBDcQF9cQIoVQZlbmFibGVxA4hVBHBvcnRxBE2CI3VVC0V2ZW50U2VydmVycQV9cQYoaAOIaARNMSZ1VQxsb2dSYXdFdmVudHNxB4lVCUJyb2FkY2FzdHEIfXEJKGgDiWgETVYgdVUEWEJNQ3EKfXELKFUIdXNlcm5hbWVxDFgGAAAAR2VvcmdlcQ1VAmlwcQ5YCQAAADEyNy4wLjAuMXEPVQhwYXNzd29yZHEQVQBxEWgES1B1VQhsb2dEZWJ1Z3ESiXWJhnETLg==
        </Plugin>
        <Plugin Enabled="False" XML_Guid="{4DE35519-67A0-433D-9C38-C7E3D5DD944C}" Identifier="iTunes" Guid="iTunes" File="iTunes">
            gAIpLg==
        </Plugin>
        <Plugin XML_Guid="{8355A123-A125-473E-9B0B-28C95148802B}" Identifier="Webserver" Guid="{E4305D8E-A3D3-4672-B06E-4EA1F0F6C673}" File="Webserver">
            gAIoWAQAAABIVFRQcQBNABNYEwAAAEM6XEVjaG9Ub0V2ZW50R2hvc3RxAVgKAAAARXZlbnRHaG9zdHECWAAAAABxA2gDfXEEiVgBAAAALHEFWAIAAAA7O3EGaANoA4l0cQcu
        </Plugin>
        <Plugin Enabled="False" XML_Guid="{9DF1B310-B9C0-4FE1-876D-094F75ED0E79}" Identifier="DenonTCPIP" Guid="DenonTCPIP" File="DenonTCPIP">
            gAJYDQAAADE5Mi4xNjguMS4yOThxAEsXhnEBLg==
        </Plugin>
        <Plugin Enabled="False" XML_Guid="{B749B817-7766-4A3C-8B99-E01A87FC513A}" Identifier="DenonTCPIP2" Guid="DenonTCPIP" File="DenonTCPIP">
            gAJYDQAAADE5Mi4xNjguMS4zODBxAEsXhnEBLg==
        </Plugin>
    </Autostart>
    <Folder Name="Echo" XML_Guid="{A0F10449-5FE0-4052-9360-4F0DED8EB334}" Expanded="True">
        <Macro Name="EG.Globals Functions 'Run on Main.OnInit'" XML_Guid="{DF776BE1-2A20-4759-842A-81B8EC5DB150}">
            <Event Name="Main.OnInit" XML_Guid="{370D341F-67AC-4FF9-B64E-E9ECA06FB33A}" />
            <Action Name="Kodi Search n Play() 'Run on MainOnInit'" XML_Guid="{3EFA9883-B5A7-4972-85BE-061C49404E55}">
                EventGhost.PythonScript(u'### Search for said movie ###\ndef search_movies(payload):\n        # Request Movies #\n        x = eg.plugins.XBMC2.JSONRPC(u\'VideoLibrary.GetMovies\', u\'{ "limits": { "start" : 0, "end":10000 }, "properties": ["rating", "resume"], "sort": { "order": "ascending", "method": "label" }  }\', False, True)\n        # Parse returned result #\n        if x != None:\n            for item in x[\'movies\']:\n                # Error handling for illegal characters #\n                try:\n                    movie = str(item[\'label\'])\n                except UnicodeEncodeError:\n                    movie = \'\'\n                movieid = str(item[\'movieid\'])\n                \n                # Match said movie, start movie #\n                if payload.lower() in movie.lower():\n                    print "Matched Movie: " + movie\n                    a = eg.plugins.XBMC2.JSONRPC(u\'Player.Open\', u\'{"item":{"movieid":\' + movieid + \'}}\', True, True)\n                    return True\n\n            return False\n        \n### Search for TV show Season/Episode ###   \ndef search_tv_season_episode(payload):\n    # Example "Play the Simpsons Season seven Episode ten" #\n        match = False\n        # Check for word \'episode\' in payload #\n        wordmatch = eg.globals.haystack(payload, \'episode\')\n        if wordmatch == True:\n            # Parse payload for Showtitle, Season, Episode #\n            temp = payload.split(" season ")\n            temp2 =  temp[1].split(" episode ")\n            temp3 = temp2[1]\n            # Convert season word to #("ten" to "10")\n            episode = str(int(eg.globals.ConvertNumbers(temp3)) -1)\n            st = temp[0].split(" season ")\n            showTitle = st[0]\n            temps = temp[1].split(" episode ")\n            # Convert episode word to #("ten" to "10")\n            season = str(eg.globals.ConvertNumbers(temps[0]))\n            # Request TV shows #\n            x = eg.plugins.XBMC2.JSONRPC(u\'VideoLibrary.GetTVShows\', u\'{ "limits": { "start" : 0, "end":20000 }, "properties": ["title", "playcount", "episode", "episodeguide"], "sort": { "order": "ascending", "method": "label" }  }\', False, True)\n            if x != None:\n                \n                # Parse returned result for said TV show #\n                for item in x[\'tvshows\']:\n                    shid = str(item[\'tvshowid\'])\n                    show = item[\'title\']\n                    # Check if said phrase matches tv show title your library \n                    if showTitle.lower() in show.lower():\n                        showid = shid\n                        # Request Episodes in Season #\n                        data = eg.plugins.XBMC2.JSONRPC(u\'VideoLibrary.GetEpisodes\', u\'{ "tvshowid": \' + str(showid) + \', "season": \' + str(season) + \', "properties": ["season", "episode"] }\', False, True)\n                        eps = int(episode)\n                        # Parse returned episodes #\n                        if \'episodes\' in data:\n                            first = int(data[\'episodes\'][eps][\'episodeid\'])\n                            eg.plugins.XBMC2.JSONRPC(u\'Playlist.Clear\', u\'{"playlistid":1}\', False, True)\n                            print "Matched TV Episode " + showTitle + " - S" + season + "xE" + str(int(episode) + 1)\n                            # Open said episode #\n                            eg.plugins.XBMC2.JSONRPC(u\'Player.Open\', u\'{"item":{"episodeid":\' + str(first) + \'}, "options":{"resume":True}}\', True, True)\n                            match = True\n                            # add subsequent episodes in the season to playlist #\n                            for episode_data in data[\'episodes\']:\n                                if first &lt; episode_data[\'episodeid\']:\n                                    episode = episode_data[\'episodeid\']\n                                    eg.plugins.XBMC2.JSONRPC(u\'Playlist.Add\', u\'{"playlistid":1,"item":{"episodeid":\' + str(episode) + \'}}\', False, True)\n                            return True\n\n        ### Play TVShow Season Only. ###\n        # Example "Play the Simpsons Season seven" #\n        if match != True:\n            # Search for "Season" in spoken phrase\n            wordmatch = eg.globals.haystack(payload, \'season\')\n            if wordmatch == True:\n                # Parse payload for showTitle and Season #\n                if "episode" not in payload:\n                    tt = payload.split(" season ")\n                    showTitle = tt[0]\n                    ses = tt[1]\n                    season = str(eg.globals.ConvertNumbers(ses))\n                    #request TV shows #\n                    x = eg.plugins.XBMC2.JSONRPC(u\'VideoLibrary.GetTVShows\', u\'{ "limits": { "start" : 0, "end":20000 }, "properties": ["title", "playcount", "episode", "episodeguide"], "sort": { "order": "ascending", "method": "label" }  }\', False, True)\n                    if x != None:\n                    \n                        # Parse returned tv shows #\n                        for item in x[\'tvshows\']:\n                            showid = str(item[\'tvshowid\'])\n                            showlabel = item[\'label\']\n                            # Check if said phrase matches tv show title your library \n                            if showTitle.lower() in showlabel.lower():\n                                # Request episodes from TV show #\n                                data = eg.plugins.XBMC2.JSONRPC(u\'VideoLibrary.GetEpisodes\', u\'{ "tvshowid": \' + str(showid) + \', "season": \' + str(season) + \', "properties": ["season", "episode"] }\', False, True)\n                                #Match said season to returned data #\n                                if \'episodes\' in data:\n                                    first = int(data[\'episodes\'][0][\'episodeid\'])\n                                    eg.plugins.XBMC2.JSONRPC(u\'Playlist.Clear\', u\'{"playlistid":1}\', False, True)\n                                    print "Matched TV Episode " + showTitle + " - Season " + season \n                                    # Open said episode, append subsequent episodes in the season to the playlist #\n                                    eg.plugins.XBMC2.JSONRPC(u\'Player.Open\', u\'{"item":{"episodeid":\' + str(first) + \'}, "options":{"resume":True}}\', True, True)\n                                    for episode_data in data[\'episodes\']:\n                                        if first &lt; episode_data[\'episodeid\']:\n                                            episode = episode_data[\'episodeid\']\n                                            eg.plugins.XBMC2.JSONRPC(u\'Playlist.Add\', u\'{"playlistid":1,"item":{"episodeid":\' + str(episode) + \'}}\', False, True)\n                                    return True\n                        \n### Search for most recent unfinished episode in said TVshow ###\ndef search_lastTV(payload):\n    x = eg.plugins.XBMC2.JSONRPC(u\'VideoLibrary.GetTVShows\', u\'{ "limits": { "start" : 0, "end":250 }, "properties": ["art", "genre", "plot", "title", "originaltitle", "year", "rating", "thumbnail", "playcount", "file", "fanart", "episode", "episodeguide", "studio"], "sort": { "order": "ascending", "method": "label" }  }\', False, True)    \n    if x != None:\n        # Parse tv shows #\n        for item in x[\'tvshows\']:\n            tvshowid = int(item[\'tvshowid\'])\n            tvshow = item[\'label\']\n            # check if said phrase matches tv show title your library \n            if payload.lower() in tvshow.lower():\n                # Run function to check for last episode played #\n                id = search_last_unwatch_tvepisode(tvshowid)\n                if id != None:\n                    episodeid = str(id-1)\n                    eg.plugins.XBMC2.JSONRPC(u\'Playlist.Clear\', u\'{"playlistid":1}\', False, True)\n                    # Open last played episode #\n                    eg.plugins.XBMC2.JSONRPC(u\'Player.Open\', u\'{"item":{"episodeid":\' + episodeid + \'}, "options":{"resume":True}}\', True, True)\n                    # Request details for matching episode #\n                    x = eg.plugins.XBMC2.JSONRPC(u\'VideoLibrary.GetEpisodeDetails\', u\'{"episodeid":\' + str(episodeid) + \', "properties": ["season", "episode", "tvshowid"]}\', False, True)\n                    # Parse info from returned data #\n                    episodenum = str(x[\'episodedetails\'][\'episode\'])\n                    episodeid  = str(x[\'episodedetails\'][\'episodeid\'])\n                    seasonnum = str(x[\'episodedetails\'][\'season\'])\n                    showid = str(x[\'episodedetails\'][\'tvshowid\'])\n                    # Request all subsequent episodes in the season after last episode played #\n                    u = eg.plugins.XBMC2.JSONRPC(u\'VideoLibrary.GetEpisodes\', u\'{ "tvshowid": \' + showid + \', "season": \' + seasonnum + \', "properties": ["episode"]}\', False, True)\n                    episodenum = int(episodenum)\n                    curr_episode = u[\'episodes\'][episodenum - 1][\'episodeid\']\n                    print " Matched " + tvshow + " last episode " + seasonnum + "E" + str(episodenum)\n                    for item in u[\'episodes\']:\n                        episodeplaylistid = int(item[\'episodeid\'])\n                        if episodeplaylistid &gt; curr_episode:\n                            eg.plugins.XBMC2.JSONRPC(u\'Playlist.Add\', u\'{"playlistid":1,"item":{"episodeid":\' + str(episodeplaylistid) + \'}}\', False, True)\n                    \n                    return True\n                    ### Start playback at First available Season and Episode if there are no watched events for said TV show.  Fallback .  Example: "Play the Simpsons", or "Play Archer". ### \n                else:\n                    # Request Season info for said show #\n                    x = eg.plugins.XBMC2.JSONRPC(u\'VideoLibrary.GetSeasons\', u\'{ "limits": { "start" : 0, "end": 500 }, "tvshowid": \' + str(tvshowid) + \', "properties": ["season", "showtitle", "episode"], "sort": { "order": "ascending", "method": "season" }  }\', False, True)\n                    # Parse Data from returned result #\n                    firstSeason = x[\'seasons\'][0][\'season\']\n                    data = eg.plugins.XBMC2.JSONRPC(u\'VideoLibrary.GetEpisodes\', u\'{ "tvshowid": \' + str(tvshowid) + \', "season": \' + str(firstSeason) + \', "properties": ["season", "episode"] }\', False, True)\n                    episodeid =  data[\'episodes\'][0][\'episodeid\']\n                    eg.plugins.XBMC2.JSONRPC(u\'Playlist.Clear\', u\'{"playlistid":1}\', False, True)\n                    # Open first episode of first season #\n                    eg.plugins.XBMC2.JSONRPC(u\'Player.Open\', u\'{"item":{"episodeid":\' + str(episodeid) + \'}, "options":{"resume":True}}\', True, True)\n                    # Request episode details #\n                    x = eg.plugins.XBMC2.JSONRPC(u\'VideoLibrary.GetEpisodeDetails\', u\'{"episodeid":\' + str(episodeid) + \', "properties": ["season", "episode", "tvshowid"]}\', False, True)\n                    # Parse returned data for subsequent shows in the season\n                    episodenum = str(x[\'episodedetails\'][\'episode\'])\n                    episodeid  = str(x[\'episodedetails\'][\'episodeid\'])\n                    seasonnum = str(x[\'episodedetails\'][\'season\'])\n                    showid = str(x[\'episodedetails\'][\'tvshowid\'])\n                    episodenum = int(episodenum)\n                    curr_episode = data[\'episodes\'][episodenum - 1][\'episodeid\']\n                    print "Matched " + tvshow + " No resume point found: S1E01 "\n                    for item in data[\'episodes\']:\n                        episodeplaylistid = int(item[\'episodeid\'])\n                        if episodeplaylistid &gt; curr_episode:\n                            eg.plugins.XBMC2.JSONRPC(u\'Playlist.Add\', u\'{"playlistid":1,"item":{"episodeid":\' + str(episodeplaylistid) + \'}}\', False, True)\n\n                return True\n        else:\n             return False\n \n### Search for genre from said genre ###\ndef search_genre(payload):\n    x = eg.plugins.XBMC2.JSONRPC(u\'AudioLibrary.GetGenres\', u\'{ "limits": { "start" : 0, "end":20000 }, "sort": { "order": "ascending", "method": "artist" }  }\', False, True)\n    if x != None:\n        # parse returned info for genres #\n        for item in x[\'genres\']:\n            genre = item[\'label\']\n            genreid = str(item[\'genreid\'])\n            \n            # match said genre songs, append to playlist #\n            if payload.lower() == genre.lower():\n                print "Matched Genre: " + genre\n                a = eg.plugins.XBMC2.JSONRPC(u\'Player.Open\', u\'{"item":{"genreid":\' + genreid + \'}, "options":{"shuffled":True}}\', True, True)\n                return True\n        \n### Search for artist from said artist ###\ndef search_artist(payload):\n    x = eg.plugins.XBMC2.JSONRPC(u\'AudioLibrary.GetArtists\', u\'{ "limits": { "start" : 0, "end":20000 }, "sort": { "order": "ascending", "method": "artist" }  }\', False, True)\n    if x != None:\n        # parse returned info for artist #\n        for item in x[\'artists\']:\n            artist = item[\'label\']\n            artistid = str(item[\'artistid\'])\n            \n            # match said artist to songs, append to playlist #\n            if payload.lower() in artist.lower():\n                print "Matched Artist: " + artist\n                a = eg.plugins.XBMC2.JSONRPC(u\'Player.Open\', u\'{"item":{"artistid":\' + artistid + \'} , "options":{"shuffled":True}}\', True, True)\n                return True\n   \n### Search for albums from said album ###\ndef search_album(payload):\n    x = eg.plugins.XBMC2.JSONRPC(u\'AudioLibrary.GetAlbums\', u\'{ "limits": { "start" : 0, "end": 20000 }, "properties": ["artist"] , "sort": { "order": "ascending", "method": "album" } }\', False, True)\n    if x != None:\n        # Parse returned info for Albums #\n        for item in x[\'albums\']:\n            try:\n                album = str(item[\'label\'])\n            except UnicodeEncodeError:\n                album = ""\n            albumid = str(item[\'albumid\'])\n    \n            # March said album to songs on album, append to playlist\n            if payload.lower() in album.lower():\n                try:\n                    artist = item[\'artist\'][0]\n                except KeyError:\n                    x = ""\n                print "Matched Album: " + artist + " - " + album\n                a = eg.plugins.XBMC2.JSONRPC(u\'Player.Open\', u\'{"item":{"albumid":\' + albumid + \'}, "options":{"shuffled":False}}\', True, True)\n                return True\n\n### Search for songs from said song ###\ndef search_song(payload):\n    x = eg.plugins.XBMC2.JSONRPC(u\'AudioLibrary.GetSongs\', u\'{ "limits": { "start" : 0, "end": 200000 }, "sort": { "order": "ascending", "method": "album" } }\', False, True)\n    for item in x[\'songs\']:\n        try:\n            song = str(item[\'label\'])\n        except UnicodeEncodeError:\n            song = ""\n        songid = str(item[\'songid\'])\n    \n        # Check if said phrase matches song your library \n        if payload.lower() in song.lower():\n            print "Matched Song: " + song\n            a = eg.plugins.XBMC2.JSONRPC(u\'Player.Open\', u\'{"item":{"songid":\' + songid + \'}}\', True, True)\n            return True\n\n### Search for Most recent unfinished episode from said TVshow ###           \ndef search_last_unwatch_tvepisode(show_id):\n    # request episodes for said show #\n    data = eg.plugins.XBMC2.JSONRPC(u\'VideoLibrary.GetEpisodes\', u\'{ "limits":{"end":1}, "tvshowid": \' + str(show_id) + \', "filter":{"field":"lastplayed", "operator":"greaterthan", "value":"0"}, "properties":["season", "episode", "lastplayed", "firstaired", "resume"], "sort":{"method":"lastplayed", "order":"descending"}  }\', False, True)\n    if \'episodes\' in data:\n        # Parse returned data\n        episode = data[\'episodes\'][0]\n        episode_season = episode[\'season\']\n        episode_number = episode[\'episode\']\n        \n        # Check for resume points\n        if episode[\'resume\'][\'position\'] &gt; 0.0:\n            next_episode_id = episode[\'episodeid\']\n        else:\n            next_episode_id = search_specific_TVepisode(show_id, episode_season, int(episode_number) + 1)\n\n        if next_episode_id:\n            return next_episode_id\n        else:\n            next_episode_id = search_specific_TVepisode(show_id, int(episode_season) + 1, 1)\n\n        if next_episode_id:\n            return next_episode_id\n        else:\n            return None\n    else:\n        return None\n\n### Search for specific shows ###    \ndef search_specific_TVepisode(show_id, season, episode):\n    # Request Episode Details \n    data = eg.plugins.XBMC2.JSONRPC(u\'VideoLibrary.GetEpisodes\', u\'{ "tvshowid": \' + str(show_id) + \', "season": \' + str(season) + \', "properties": ["season", "episode"] }\', False, True)\n    if \'episodes\' in data:\n        # Parse return data\n        correct_id = None\n        for episode_data in data[\'episodes\']:\n            if int(episode_data[\'episode\']) == int(episode):\n                correct_id = episode_data[\'episodeid\']\n                break\n\n        return correct_id\n    else:\n        return None\n\n### Call the search functions in progression ###\ndef kodi_search(payload):\n    searchmovies = search_movies(payload)\n    if searchmovies != True:\n        searchtvepisode = search_tv_season_episode(payload)\n        if searchtvepisode != True:\n            searchlasttv = search_lastTV(payload)\n            if searchlasttv != True:\n                searchgenre = search_genre(payload)\n                if searchgenre != True:\n                    searchartist = search_artist(payload)\n                    if searchartist != True:\n                        searchalbum = search_album(payload)\n                        if searchalbum != True:\n                            searchsong = search_song(payload)\n                            if searchsong != True:\n                                # If it makes it here nothing in your library contained the spoken phrase.\n                                print "No Match found"\n                                \n### Sets the kodi_search function to an eg.globals varialbe ###        \neg.globals.search_kodi = kodi_search')
            </Action>
            <Action Name="Search for word in string() 'Run on MainOnInit'" XML_Guid="{6E5743A1-2C27-450B-8BCF-1A1FC26F3580}">
                EventGhost.PythonScript(u'### Function to search for specific word in a string. ###\ndef search_word(haystack, needle):\n    \n    if haystack.lower().startswith(needle.lower()+" "):\n        return True\n    elif haystack.lower().endswith(" "+needle.lower()):\n        return True\n    elif haystack.lower().find(" "+needle.lower()+" ") != -1:\n        return True\n    else:\n        return False\n    \neg.globals.haystack = search_word')
            </Action>
            <Action Name='Convert Word numbers to #() "Run on Main.OnInit"' XML_Guid="{B058AE2E-EC0F-4DD6-B0D9-E63CC33CD752}">
                EventGhost.PythonScript(u'import re\n\nnumwords = {}\n\n\ndef text2int(textnum):\n\n    if not numwords:\n\n        units = [ "zero", "one", "two", "three", "four", "five", "six",\n                "seven", "eight", "nine", "ten", "eleven", "twelve",\n                "thirteen", "fourteen", "fifteen", "sixteen", "seventeen",\n                "eighteen", "nineteen"]\n\n        tens = ["", "", "twenty", "thirty", "forty", "fifty", "sixty", \n                "seventy", "eighty", "ninety"]\n\n        scales = ["hundred", "thousand", "million", "billion", "trillion", \n                \'quadrillion\', \'quintillion\', \'sexillion\', \'septillion\', \n                \'octillion\', \'nonillion\', \'decillion\' ]\n\n        numwords["and"] = (1, 0)\n        for idx, word in enumerate(units): numwords[word] = (1, idx)\n        for idx, word in enumerate(tens): numwords[word] = (1, idx * 10)\n        for idx, word in enumerate(scales): numwords[word] = (10 ** (idx * 3 or 2), 0)\n\n    ordinal_words = {\'first\':1, \'second\':2, \'third\':3, \'fifth\':5, \n            \'eighth\':8, \'ninth\':9, \'twelfth\':12}\n    ordinal_endings = [(\'ieth\', \'y\'), (\'th\', \'\')]\n    current = result = 0\n    tokens = re.split(r"[\\s-]+", textnum)\n    for word in tokens:\n        if word in ordinal_words:\n            scale, increment = (1, ordinal_words[word])\n        else:\n            for ending, replacement in ordinal_endings:\n                if word.endswith(ending):\n                    word = "%s%s" % (word[:-len(ending)], replacement)\n\n            if word not in numwords:\n                raise Exception("Illegal word: " + word)\n\n            scale, increment = numwords[word]\n\n        if scale &gt; 1:\n            current = max(1, current)\n\n        current = current * scale + increment\n        if scale &gt; 100:\n            result += current\n            current = 0\n\n    return result + current\n\neg.globals.ConvertNumbers = text2int')
            </Action>
            <Action Name='raise/lower volume() "Run on MainOnInit"' XML_Guid="{57EAA4BC-06AF-4AA6-8212-A684A1D440CC}">
                EventGhost.PythonScript(u'def lower_Volume(vol):\n    \n    if vol % 10 != 0:\n        # round to nearest 10\n        vol -= vol % -10\n\n    # subtract 10\n    vol -= 10\n    if vol &lt; 0:\n        vol = 0\n\n    return vol\n\n# Set eg.globals()\neg.globals.lowerVolume = lower_Volume\n\ndef raise_Volume(vol):\n\n    if vol % 10 == 0:\n        # already 10x just add ten\n        vol += 10\n    else:\n        # round to nearest 10 &amp; add ten\n        vol -= vol % -10\n        vol += 10\n\n    if vol &gt; 100:\n        vol = 100\n    \n    return vol\n\n# assign eg.globals function\neg.globals.raiseVolume = raise_Volume')
            </Action>
        </Macro>
        <Macro Name="AmazonEchoRcv: TriggerEvents" XML_Guid="{385AF370-9A1E-4B3B-AE21-ECEBFAB4D80C}">
            <Event Name="HTTP.EchoToEG" XML_Guid="{0B813425-5C35-4991-8870-44F0BD11548F}" />
            <Action Name="Trigger Events based on key phrasing" XML_Guid="{C4B01FA1-B976-47A0-A711-BE58AE467530}">
                EventGhost.PythonScript(u'#payload = eg.event.payload[0]\nmatch = False\n\n# Test Payload#\npayload = "play king of the hill season seven episode ten"\n\n# Erorr handling for Alexa mispelling of Kodi #\nwordmatch = eg.globals.haystack(payload, "cody")\nif wordmatch == True:\n    payload = payload.replace("cody", "kodi")\n\n# Change Alexa\'s "and\' to "&amp;" #\nwordmatch = eg.globals.haystack(payload, "and")\nif wordmatch == True:\n    payload = payload.replace("and", "&amp;")\n\n# change Alexa\'s "t. v. " to "tv"\nwordmatch = eg.globals.haystack(payload, "t. v.")\nif wordmatch == True:\n    payload = payload.replace("t. v.", "tv")\n\n# Set "Play" intent, it assumes kodi is your playback.  Change prefix to "iTunes" if your using iTunes. #\n# Examples: "Play jazz", "Play beck, "Play mellow gold", "Play loser", "Play Super Troopers", "Play the Simpsons", \n# "Play the Simpsons Season six", "Play the Simpsons season six episode ten" #\n\n# Run eg.globals.hastack() function to find a word "play" in the payload\nwordmatch = eg.globals.haystack(payload, "play")\nif wordmatch == True:\n    item = payload.split("play ")\n    # Split play/pause from other Play(que) commands\n    if payload[1] != \'\':\n        eg.TriggerEvent(prefix="Kodi", suffix="Playback", payload=item[1])\n    else:\n        eg.TriggerEvent(prefix="Kodi", suffix="Play", payload=item[1])\n\n    match = True\n\n# Set "Tune" intent \n# Example: "Tune Fox"\nif match != True:\n    # Run eg.globals.hastack() function to find a word "tune" in the payload\n    wordmatch = eg.globals.haystack(payload, "tune")\n    if wordmatch == True:\n        item = payload.split("tune")\n        eg.TriggerEvent(prefix="Kodi", suffix="TuneChannel", payload=item[1])\n        match = True\n \n# Set "Start" intent\n# Examples: "Start Kodi", "Start iTunes"#\nif match != True:\n    # Run eg.globals.hastack() function to find a word "start" in the payload\n    wordmatch = eg.globals.haystack(payload, "start")\n    if wordmatch == True:\n        item = payload.split("start ")\n        eg.TriggerEvent(prefix="Start", suffix=item[1])\n        match = True\n        \n# Set "Close" intent\n# Example: "Close Kodi", "Close iTunes"\nif match != True:\n    # Run eg.globals.hastack() function to find a word "close" in the payload\n    wordmatch = eg.globals.haystack(payload, "close")\n    if wordmatch == True:\n        item = payload.split("close ")\n        eg.TriggerEvent(prefix="Close", suffix=item[1])\n        match = True\n\n# Set "Turn On" intent\n# Example: "Turn on Basement TV"\nif match != True:\n    wordmatch = eg.globals.haystack(payload, "turn on")\n    if wordmatch == True:\n        item = payload.split("turn on ")\n        eg.TriggerEvent(prefix="HA", suffix="SwitchOn", payload=item[1])\n        match = True\n\n# Set "Turn Off" intent\n# Example: "Turn off Basement TV"\nif match != True:\n    wordmatch = eg.globals.haystack(payload, "turn off")\n    if wordmatch == True:\n        item = payload.split("turn off ")\n        eg.TriggerEvent(prefix="HA", suffix="SwitchOff", payload=item[1])\n        match = True\n\n# Set "Toggle" intent\n# Example: "Toggle Basement TV"\nif match != True:\n    # Run eg.globals.hastack() function to find a word "toggle" in the payload\n    wordmatch = eg.globals.haystack(payload, "toggle")\n    if wordmatch == True:\n        item = payload.split("toggle ")\n        # Run eg.globals.hastack() function to find a word "avr" in the payload\n        wordmatch = search_word(payload, "avr")\n        if wordmatch == True:\n            eg.TriggerEvent(prefix="Denon", suffix="Toggle", payload=item[1])\n        else:\n             eg.TriggerEvent(prefix="HA", suffix="Toggle", payload=item[1])\n        match = True\n    \n# Set "Set Volume" intent\n# Example: "Set Basement AVR Volume to sixty-six"\nif match != True:\n    # Run eg.globals.hastack() function to find a word "volume" in the payload\n    wordmatch = eg.globals.haystack(payload, "volume")\n    if wordmatch == True:\n        # Run eg.globals.hastack() function to find a word "set" in the payload\n        wordmatch = eg.globals.haystack(payload, "set")\n        if wordmatch == True:\n            item = payload.split(" volume to ")\n            room = item[0].split("set ")\n            room = room[1]\n            level = item[1]\n            eg.TriggerEvent(prefix="Volume", suffix=(room), payload=level)\n            match = True\n\n# Set "Raise/Lower Volume" intent\n# Example: "Raise Basement AVR Volume", "Lower Kodi Volume", "Raise Volume"\nif match != True:\n    # Run eg.globals.hastack() function to find a word "volume" in the payload\n    wordmatch = eg.globals.haystack(payload, "volume")\n    if wordmatch == True:\n        # Run eg.globals.hastack() function to find a word "raise" in the payload\n        wordmatch2 = eg.globals.haystack(payload, "raise")\n        if wordmatch2 == True:\n            item = payload.split(" volume")\n            if item[0] == \'raise\':\n                eg.TriggerEvent(prefix="kodi", suffix="Vol+")\n            else:\n                room = item[0].split("raise ")\n                eg.TriggerEvent(prefix=room[1], suffix="Vol+")\n            match = True\n        # Run eg.globals.hastack() function to find a word "lower" in the payload\n        wordmatch3 = eg.globals.haystack(payload, "lower")\n        if wordmatch3 == True:\n            item = payload.split(" volume")\n            if item[0] == \'lower\':\n                eg.TriggerEvent(prefix="kodi", suffix="Vol-")\n            else:\n                room = item[0].split("lower ")\n                eg.TriggerEvent(prefix=room[1], suffix="Vol-")\n            match = True\n            \n# Set "Input" intent\n# Example: "Set Basement AVR Input to DVD"\nif match != True:\n    # Run eg.globals.hastack() function to find a word "input" in the payload\n    wordmatch = eg.globals.haystack(payload, "input")\n    if wordmatch == True:\n        item = payload.split(" input ")\n        room = item[0].split("set ")\n        room = room[1]\n        input = item[1]\n        eg.TriggerEvent(prefix="Input", suffix=(room), payload=input)\n        match = True\n\n# If no intent is caught by here. It will forward the string as an event suffix\n# Example event: "EchoForward.yourspokenstring"\nif match != True:\n    eg.TriggerEvent(prefix="EchoForward", suffix=payload)')
            </Action>
        </Macro>
        <Folder Name="Kodi" XML_Guid="{77FCC2E9-814F-4854-B4B2-84C6D4415B4F}">
            <Macro Name="XBMC: Search and Play" XML_Guid="{0F219C40-9754-43D6-B975-E481342279AC}">
                <Event Name="Kodi.Playback" XML_Guid="{5D1EDEAD-6D86-498E-B96F-EBDD32F1E3F1}" />
                <Action XML_Guid="{F3CCC71C-E8CE-413D-A3D6-1F7CCDC1D5B2}">
                    EventGhost.PythonCommand(u'eg.globals.search_kodi(eg.event.payload)')
                </Action>
            </Macro>
            <Macro Name="XBMC2: Set Volume" XML_Guid="{C9B497B1-E2F5-4842-A880-DDBF0BCB489D}">
                <Event Name="Volume.kodi" XML_Guid="{5AF22437-F6B3-4196-BF57-1191D5A73C7B}" />
                <Action XML_Guid="{4B29F2F8-40BB-44C0-958B-BFEE1E846431}">
                    EventGhost.PythonCommand(u"eg.plugins.XBMC2.JSONRPC(u'Application.SetVolume', '[' + str(eg.globals.ConvertNumbers(eg.event.payload)) + ']', False, True)")
                </Action>
            </Macro>
            <Macro Name="XBMC2: SkipPrevious" XML_Guid="{87FCA43E-4C56-44FD-9279-8D70947326BB}">
                <Event Name="EchoForward.previous" XML_Guid="{A06E0C8A-27B6-4E50-AC2A-82F60C763996}" />
                <Action XML_Guid="{6FE4A30C-AFE9-426E-8362-4814610D693B}">
                    XBMC2.SkipPrevious()
                </Action>
            </Macro>
            <Macro Name="XBMC2: SkipNext" XML_Guid="{9FBF55A3-0BFA-4B24-BE16-9AE27121477A}">
                <Event Name="EchoForward.next" XML_Guid="{933CA256-A4B5-496D-830D-1555122BDBBB}" />
                <Action XML_Guid="{7858D5FD-A331-4732-A38C-D0107ACE9DA9}">
                    XBMC2.SkipNext()
                </Action>
            </Macro>
            <Macro Name="XBMC2: Play" XML_Guid="{98B961E4-6CFD-4E9F-9DAA-21B10FDBEDF3}">
                <Event Name="EchoForward.play" XML_Guid="{635945B4-11FF-4A64-9181-B8C061D316E8}" />
                <Action XML_Guid="{E35A4E42-467D-4B0E-9EFF-57E20B61F770}">
                    XBMC2.Play()
                </Action>
            </Macro>
            <Macro Name="XBMC2: Pause" XML_Guid="{B62298F0-8339-4A4E-BD17-29E058C4EFA4}">
                <Event Name="EchoForward.pause" XML_Guid="{20BDB957-E6AF-427F-B138-E1B746F8D2DD}" />
                <Action XML_Guid="{80CA53BE-EDB4-497B-9D10-AEA3ED03DECB}">
                    XBMC2.RemotePause()
                </Action>
            </Macro>
            <Macro Name="XBMC2: Stop" XML_Guid="{F295EDEF-65F3-4383-B1C4-C924682DED0F}">
                <Action XML_Guid="{0E404DEA-F5F2-4F8A-A743-6DB47ACBED65}">
                    XBMC2.Stop()
                </Action>
                <Event Name="EchoForward.stop" XML_Guid="{5A68B204-C98A-4D6F-B97B-450756786F87}" />
            </Macro>
            <Macro Name="XBMC2: FullScreen" XML_Guid="{EEB7FA78-C7D5-4A6A-8EF1-0D67BCCC42BD}">
                <Event Name="EchoForward.full screen" XML_Guid="{413CEF6C-C7BB-46CC-8B17-EDD38EED7938}" />
                <Event Name="EchoForward.for screen" XML_Guid="{95C3DBD1-5E3F-4231-B4BD-BFC7C8668707}" />
                <Event Name="EchoForward.for scream" XML_Guid="{3D2350AD-A1CD-4145-97FB-6B7126E7DEFF}" />
                <Action XML_Guid="{FD9D1323-AE31-48C6-9B2C-74E0D3935FF6}">
                    EventGhost.PythonScript(u'state = eg.plugins.XBMC2.JSONRPC(u\'Settings.GetSettingValue\', u\'{"setting":\\\'videoscreen.screen\\\'}\', False, True)\nif state[\'value\'] == -1:\n    eg.plugins.XBMC2.JSONRPC(u\'Settings.SetSettingValue\', u\'{"setting":\\\'videoscreen.screen\\\', \\\'value\\\':0}\', False, True)\nif state[\'value\'] == 0:\n    eg.plugins.XBMC2.JSONRPC(u\'Settings.SetSettingValue\', u\'{"setting":\\\'videoscreen.screen\\\', \\\'value\\\':-1}\', False, True)')
                </Action>
            </Macro>
            <Macro Name="XBMC2: Random" XML_Guid="{2E9BDB82-6F9C-4672-B717-583850AD1973}">
                <Event Name="EchoForward.shuffle" XML_Guid="{0D4B0694-F828-468C-888E-0065F191DDAD}" />
                <Action XML_Guid="{8F77FF91-3B82-401B-802F-E9BF4A32337F}">
                    XBMC2.Random()
                </Action>
            </Macro>
            <Macro Name="XBMC2: Party Mode" XML_Guid="{709A3832-D2D0-4D14-B3EF-BA54CBB46192}">
                <Action XML_Guid="{CC1F392A-35FF-4302-A41E-B492B3F5D316}">
                    XBMC2.PartyMode()
                </Action>
                <Event Name="EchoForward.party mode" XML_Guid="{CCEC4387-9C10-4677-99C2-7A450CA86996}" />
            </Macro>
            <Macro Name="XBMC2: Repeat" XML_Guid="{392046A3-8A39-4310-8E00-0EA109E989DF}">
                <Action XML_Guid="{EB6554ED-4A3E-4AB6-83F2-315CCA643F57}">
                    XBMC2.Repeat()
                </Action>
                <Event Name="EchoForward.repeat" XML_Guid="{1D19336E-39DC-477D-949A-944D27BA4345}" />
            </Macro>
            <Macro Name="XBMC2: Start" XML_Guid="{A18A6703-DC8A-4DF3-BD4F-64D9AD4B8E01}">
                <Event Name="Start.kodi" XML_Guid="{0AAD563F-2E8A-4F27-B0BB-0312E38ED8BA}" />
                <Action XML_Guid="{1A4D1CF5-8CBD-4BEF-A5E6-A05A21B6CBA7}">
                    System.Execute(u'C:\\Program Files (x86)\\Kodi\\Kodi.exe', u'', 0, False, 2, u'', True, False, u'', False, False, False, False)
                </Action>
            </Macro>
            <Macro Name="XBMC2: Shutdown" XML_Guid="{6F9AF4DF-5B27-422E-84EF-70A6C5071257}">
                <Event Name="Close.kodi" XML_Guid="{BEC53FD4-36F1-4B65-9437-4B8A95660D9B}" />
                <Action XML_Guid="{05212F98-BFAA-419C-B44C-9B4692F1C036}">
                    System.Command(u'taskkill /IM Kodi.exe /F', False, False, u'', True, False, False, True, False)
                </Action>
            </Macro>
            <Macro Name="XBMC2: Vol- 10%" XML_Guid="{B6C2CF9D-8B18-4619-841C-1D4AE1C8E2C6}">
                <Event Name="kodi.Vol-" XML_Guid="{122FDE4D-C157-4E2B-90FC-D972BBC6C72A}" />
                <Action Name="XBMC: Raise Volume 10%" XML_Guid="{B6EF820D-7AE3-4610-A17F-397EF515A331}">
                    EventGhost.PythonScript(u'# Request Current Volume\ngetVol = eg.plugins.XBMC2.JSONRPC(u\'Application.GetProperties\', u\'{"properties": ["volume", "muted", "name"]}\', False, True)\nvol = int(getVol[\'volume\'])\n\n# Run function to do volume adjustment\nnewVol = eg.globals.lowerVolume(vol)\n\n# Set new Volume Level\neg.plugins.XBMC2.JSONRPC(u\'Application.SetVolume\', \'[\'  + str(newVol) + \']\', False, True)\nprint "Set Volume to " + str(newVol)')
                </Action>
            </Macro>
            <Macro Name="XBMC2: Vol+ 10%" XML_Guid="{2D8D48B1-CF59-4DDA-AF79-43B001BEBF95}">
                <Event Name="kodi.Vol+" XML_Guid="{5BEB1430-2889-4D8D-8B95-901EF00A69FE}" />
                <Action Name="XBMC: Lower Volume 10%" XML_Guid="{0428FA7F-38E1-498E-8704-A82DA770735E}">
                    EventGhost.PythonScript(u'# Request Current Volume\ngetVol = eg.plugins.XBMC2.JSONRPC(u\'Application.GetProperties\', u\'{"properties": ["volume", "muted", "name"]}\', False, True)\nvol = int(getVol[\'volume\'])\n\n# Run function to do volume adjustment\nnewVol = eg.globals.raiseVolume(vol)\n\n# Set new Volume Level\neg.plugins.XBMC2.JSONRPC(u\'Application.SetVolume\', \'[\'  + str(newVol) + \']\', False, True)\nprint "Set Volume to " + str(newVol)')
                </Action>
            </Macro>
        </Folder>
        <Folder Name="iTunes" Enabled="False" XML_Guid="{A0BE1EF5-9D3D-402C-867C-A7C13167A74B}">
            <Macro Name="iTunes: Search and Play" XML_Guid="{76A7F627-9D74-483E-BCA8-129BAF3FB572}">
                <Event Name="iTunes.Playback" XML_Guid="{E965C152-FC58-4A49-ADB4-6BA0F5846390}" />
                <Action XML_Guid="{61292988-807B-432A-A138-F6AACDCA6149}">
                    EventGhost.PythonCommand(u"eg.plugins.iTunes.SearchAndPlay('All', eg.event.payload, False, u'eventghostTemp')")
                </Action>
            </Macro>
            <Macro Name="iTunes: Set volume" XML_Guid="{93899A81-DEF7-45A9-961C-B122C40D5648}">
                <Event Name="Volume.itunes" XML_Guid="{3A8AC0B1-CD33-47B0-B72C-2CDC4620599D}" />
                <Action XML_Guid="{EB502AF2-49B5-491F-AAD9-01597B81F125}">
                    EventGhost.PythonCommand(u'eg.plugins.iTunes.SetVolume(str(eg.globals.ConvertNumbers(eg.event.payload)))')
                </Action>
            </Macro>
            <Macro Name="iTunes: Pause" XML_Guid="{F619BDA0-9FE1-47AB-9739-A24A5D171DFE}">
                <Event Name="EchoForward.pause" XML_Guid="{07AB9697-A479-470D-BAEE-7E80E8A91C12}" />
                <Action XML_Guid="{09CBACB4-33F7-4167-98C6-AD743713BD3A}">
                    iTunes.Pause()
                </Action>
            </Macro>
            <Macro Name="iTunes: Next track" XML_Guid="{E117A99C-2705-4D4E-AF06-CAF7DF21664A}">
                <Event Name="EchoForward.next" XML_Guid="{BF4647FC-94B1-4CC3-BD7E-1377A498E217}" />
                <Action XML_Guid="{909B48FB-E251-4EEE-8531-7517EAA08CFA}">
                    iTunes.Skip()
                </Action>
            </Macro>
            <Macro Name="iTunes: Previous track" XML_Guid="{051CA0E7-FDCB-4553-B614-67C96CD2E0F8}">
                <Event Name="EchoForward.previous" XML_Guid="{C5495B56-0510-4C4F-BAF7-0E2E14929CB2}" />
                <Action XML_Guid="{6705B5C6-725F-4CB3-8E37-4B45E72A9210}">
                    iTunes.Replay()
                </Action>
            </Macro>
            <Macro Name="iTunes: Toggle Shuffle" XML_Guid="{4D16F6F3-4FFB-4021-979A-4F284F68E1E1}">
                <Event Name="EchoForward.shuffle" XML_Guid="{D65F987F-445E-4BE4-B58E-10B371D31EF8}" />
                <Action XML_Guid="{06A5ACF4-8C34-46C6-B2A9-AA2BE6E58D89}">
                    iTunes.ToggleShuffle()
                </Action>
            </Macro>
            <Macro Name="iTunes: Toggle Repeat" XML_Guid="{91343476-1F0D-4CC8-9876-F5A2B8877A01}">
                <Event Name="EchoForward.repeat" XML_Guid="{BAACCF88-E51B-4D84-AA53-1000B1C2C9AA}" />
                <Action XML_Guid="{26BC65CC-6640-44EB-80DF-6424CEBCD6F1}">
                    iTunes.ToggleRepeat()
                </Action>
            </Macro>
            <Macro Name="iTunes: Toggle mute" XML_Guid="{9FCD4312-1DFE-4529-A778-DF3A69474F3E}">
                <Event Name="EchoForward.mute" XML_Guid="{34C97A22-BB47-4CFD-8E7C-46C5513FD6C6}" />
                <Action XML_Guid="{5E1EE314-4ABE-4235-A027-52DA36F9FFD5}">
                    iTunes.ToggleMute()
                </Action>
            </Macro>
            <Macro Name="iTunes: Run iTunes" XML_Guid="{0C4A1467-DDD7-4A91-94CE-31F45D6C32D4}">
                <Event Name="Start.itunes" XML_Guid="{9B356115-B9F1-4F7D-AD81-13A7107F7764}" />
                <Action XML_Guid="{D20E6DAD-53CD-4135-985C-819000BD0F4F}">
                    iTunes.StartApp()
                </Action>
            </Macro>
            <Macro Name="iTunes: Exit" XML_Guid="{3EF43B19-0977-4F13-848F-A6256B68ABEF}">
                <Event Name="Close.itunes" XML_Guid="{2D8B3A83-5843-4710-BDDE-B0A7E8579161}" />
                <Action XML_Guid="{7870D557-C7D3-46D4-AF0C-FAD85888A87C}">
                    iTunes.Exit()
                </Action>
            </Macro>
            <Macro Name="iTunes: Vol- 10%" XML_Guid="{C90D8B0F-7617-4BB6-883D-E9CFDCD7F22B}">
                <Event Name="itunes.Vol-" XML_Guid="{122FDE4D-C157-4E2B-90FC-D972BBC6C72A}" />
                <Action XML_Guid="{22B30E77-0B16-4F8B-8D59-75A2F2AE75E7}">
                    iTunes.GetSoundVolume()
                </Action>
                <Action XML_Guid="{1BBE438D-213F-40BB-A9DF-C0E5A4FBF611}">
                    EventGhost.PythonCommand(u'eg.globals.lowerVolume(eg.result)')
                </Action>
                <Action XML_Guid="{3020A655-D084-4C54-AD25-980F34C6B292}">
                    EventGhost.PythonCommand(u'eg.plugins.iTunes.SetVolume(int(eg.result))')
                </Action>
            </Macro>
            <Macro Name="iTunes: Vol+ 10%" XML_Guid="{E2D2ED43-921C-43B0-ADDC-F0FA50B9DFFC}">
                <Event Name="itunes.Vol+" XML_Guid="{122FDE4D-C157-4E2B-90FC-D972BBC6C72A}" />
                <Action XML_Guid="{22B30E77-0B16-4F8B-8D59-75A2F2AE75E7}">
                    iTunes.GetSoundVolume()
                </Action>
                <Action XML_Guid="{1BBE438D-213F-40BB-A9DF-C0E5A4FBF611}">
                    EventGhost.PythonCommand(u'eg.globals.raiseVolume(eg.result)')
                </Action>
                <Action XML_Guid="{3020A655-D084-4C54-AD25-980F34C6B292}">
                    EventGhost.PythonCommand(u'eg.plugins.iTunes.SetVolume(int(eg.result))')
                </Action>
            </Macro>
        </Folder>
        <Folder Name="HA" XML_Guid="{F8756D4D-515B-427C-B1C4-0628A9B2279C}">
            <Macro Name="AxialControlHA: Turn Device On/Off" XML_Guid="{842D9983-5CC9-4B78-98D6-386A82EEC998}">
                <Event Name="HA.SwitchOff" XML_Guid="{561B819C-A825-4369-ADC4-22AD60EA47CE}" />
                <Event Name="HA.SwitchOn" XML_Guid="{0CA55E21-84C7-4095-9954-BF7E1A8A93C9}" />
                <Action XML_Guid="{52656730-F2D2-4680-9BE9-CBDB27375931}">
                    AxialControlHA.ListAllDevices()
                </Action>
                <Action XML_Guid="{388CC53B-371F-456C-860D-0937A725E432}">
                    EventGhost.PythonScript(u'name = eg.event.payload\n    \nif eg.event.suffix == "SwitchOn":\n    cmd = \'eg.plugins.AxialControlHA.TurnSwitchOn(deviceID, name)\'\nelse:\n    cmd = \'eg.plugins.AxialControlHA.TurnSwitchOff(deviceID, name)\'\n    eg.event.suffix = "SwitchOff"\n    \nfor device in eg.result:\n    if device.lower() == name.lower():\n        deviceID = eg.result[device][\'deviceID\']\n        exec(cmd)\n        print device + " " + eg.event.suffix\n\n')
                </Action>
            </Macro>
            <Macro Name="AxialControlHA: Toggle On/Off" XML_Guid="{2AA5168D-81DF-4891-A418-0BF7473DCB91}">
                <Event Name="HA.Toggle" XML_Guid="{561B819C-A825-4369-ADC4-22AD60EA47CE}" />
                <Action XML_Guid="{52656730-F2D2-4680-9BE9-CBDB27375931}">
                    AxialControlHA.ListAllDevices()
                </Action>
                <Action XML_Guid="{388CC53B-371F-456C-860D-0937A725E432}">
                    EventGhost.PythonScript(u'name = eg.event.payload\n\nfor device in eg.result:\n    if device.lower() == name.lower():\n        deviceID = eg.result[device][\'deviceID\']\n        eg.plugins.AxialControlHA.ToggleSwitch(deviceID, device)\n        print name + " Toggled"\n\n')
                </Action>
            </Macro>
        </Folder>
        <Folder Name="Denon TCPIP" XML_Guid="{526D6D94-3268-4411-B502-408D91537B36}">
            <Macro Name="DenonTCPIP: Toggle Power" XML_Guid="{4DFBF362-3D6A-49B3-8528-E4A881D9492C}">
                <Event Name="Denon.Toggle" XML_Guid="{ADA3B471-4E56-4525-BF1A-81BD84B73D5F}" />
                <Action Name="Toggle Denon Power" XML_Guid="{6D422C76-6E1B-4C92-86A7-B036345F425D}">
                    EventGhost.PythonScript(u'# Dictionary to hold commands for each room\nroomPower = {\n"basement avr":\'eg.plugins.DenonTCPIP.ToggleMainZonePower()\',\n "kitchen avr":\'eg.plugins.DenonTCPIP.ToggleZone2Power()\',\n "livingroom avr":\'eg.plugins.DenonTCPIP2.ToggleMainZonePower()\',\n "bedroom avr":\'eg.plugins.DenonTCPIP2.ToggleZone2Power()\'\n }\n\n# Parse variables from event\nselectedRoom = eg.event.payload\n\n# search the Dict to find spoken room name/cmd to run.\nfor room in roomPower:\n    if room == selectedRoom:\n       # Executes the python action located in the rooms keyValue.\n        exec(roomPower[room])\n        print selectedRoom + " Power toggled"')
                </Action>
            </Macro>
            <Macro Name="DenonTCPIP: Set Volume" XML_Guid="{2CD7D8BE-88BF-4F29-A2D8-98DD3D38472E}">
                <Event Name="Volume.basement avr" XML_Guid="{D204E3F6-26C5-4950-827A-623894BC7BB2}" />
                <Action Name="Set Denon Volume" XML_Guid="{B9B0347B-E7FC-4E34-A63D-4DC27D69408B}">
                    EventGhost.PythonScript(u'# Dictionary to hold commands for each room\nroomVolume = {\n"basement avr":\'eg.plugins.DenonTCPIP.SetMainZoneVolumeLevel(level)\',\n "kitchen avr":\'eg.plugins.DenonTCPIP.SetZone2VolumeLevel(level)\',\n "livingroom avr":\'eg.plugins.DenonTCPIP2.SetMainZoneVolumeLevel(level)\',\n "bedroom avr":\'eg.plugins.DenonTCPIP2.SetZone2VolumeLevel(level)\'\n }\n\n# Parse variables from event\nselectedRoom = eg.event.suffix\nlevelWord = eg.event.payload\n\n# Run function to convert string words(one,two,three) to #(1,2,3)\nlevel = eg.globals.ConvertNumbers(levelWord)\n\n# search the Dict to find spoken room name/cmd to run.\nfor room in roomVolume:\n    if room == selectedRoom:\n       # Executes the python action located in the rooms keyValue.\n        exec(roomVolume[room])\n        print selectedRoom + " Volume Set to " + str(level)')
                </Action>
            </Macro>
        </Folder>
        <Macro Name="Set Master Volume: Set volume %" XML_Guid="{5EDDA4BB-C87F-4278-8ABB-11A546755047}">
            <Event Name="Volume.system" XML_Guid="{3A8AC0B1-CD33-47B0-B72C-2CDC4620599D}" />
            <Action XML_Guid="{F9702723-46D9-41A2-AEF4-19A87D8E457E}">
                EventGhost.PythonCommand(u"eg.plugins.System.SetMasterVolume(str(eg.globals.ConvertNumbers(eg.event.payload)), u'Primary Sound Driver')")
            </Action>
        </Macro>
        <Macro Name="Change Master Volume: -10.00 %" XML_Guid="{E658F9DC-2827-4705-992F-A51638A5ACBA}">
            <Event Name="system.Vol+" XML_Guid="{1E32AA6F-E9D2-4265-9980-E13B545C90D0}" />
            <Action XML_Guid="{4EB7F91B-82D1-4B8D-8BC5-DE7B00CB551A}">
                System.ChangeMasterVolumeBy(-10.0, u'Primary Sound Driver')
            </Action>
        </Macro>
        <Macro Name="Change Master Volume: 10.00 %" XML_Guid="{F2AFDCF5-1849-45EC-B6FF-37D2D2BD7827}">
            <Event Name="system.Vol+" XML_Guid="{D204E3F6-26C5-4950-827A-623894BC7BB2}" />
            <Action XML_Guid="{F20C60B6-EA22-4B2D-8F46-078D2D1AD234}">
                System.ChangeMasterVolumeBy(10.0, u'Primary Sound Driver')
            </Action>
        </Macro>
    </Folder>
</EventGhost>
