Example #1
0
def start_playlist(playlist, playlistid):
    ausgabe("start_playlist", 1)
    kodi.stop()
    kodi_navigation_gui("videoplaylist")
    kodi.add_playlist(playlist, playlistid)
    kodi.start_play(playlistid)
    return
Example #2
0
 def stop(self):
     if self.name == "vlc":
         vlc.stop()
     if self.name == "kodi":
         kodi.stop()
         return
     if self.name == "mpv":
         return
def start_partymode(session_id):
    kodi.stop()
    #ausgabe('wieder in start_partymode',2)
    kodi.partymode_playlist()
    ausgabe('Partymode - sessionId = {0}'.format(session_id), 2)
    #time.sleep(1) erst time importieren? in kodi.py dann auch ?
    kodi_navigation_gui("visualisation", session_id)
    return
Example #4
0
def start_tv():
    ausgabe("start_tv", 1)
    kodi.stop()
    kodi_navigation_gui("videoplaylist")
    showsid_tupel = build_tupel(kodi.get_tv_shows("tv"), "tvshowid")
    ausgabe(len(showsid_tupel))
    #kodi.show_notification(len(showsid_tupel)+" Serien gefunden. Episoden werden gesucht")
    id_tupel = []
    kodi.show_notification("Programm wird geladen")
    kodi.clear_playlist("1")
    json_data = kodi.get_tv_shows_episodeids(showsid_tupel)
    for item in json_data:
        if item['result']['limits']['total'] != 0:
            id_tupel_temp = build_tupel(item['result']['episodes'],
                                        "episodeid")
            shuffle(id_tupel_temp)
            id_tupel = id_tupel + [id_tupel_temp[0]] + [id_tupel_temp[1]] + [
                id_tupel_temp[2]
            ] + [id_tupel_temp[3]]
    ausgabe(len(id_tupel))
    shuffle(id_tupel)
    kodi.insert_playlist(id_tupel, 'episodeid', '1')
    kodi.start_play('1')
    return
Example #5
0
def on_message(client, userdata, msg):
    global playing_state_old
    global is_in_session
    if msg.topic != 'hermes/audioServer/default/audioFrame':
        ausgabe(''+msg.topic,0)
    if msg.topic == 'hermes/hotword/default/detected':
        #when hotword is detected pause kodi player for better understanding. check if kodi is online, kodi is playing, not in kodi navigator session
        ausgabe('silent_mediaplay',1)
        if kodi.check_connectivity() and kodi.get_running_state() and not is_in_session:
            kodi.pause()
            playing_state_old = 1
    elif msg.topic == 'hermes/dialogueManager/sessionEnded':
        '''
        if session ended return to kodi playing state. check if not in kodi navigator session so kodi keeps on pause while navigating.
        also check current playing state so kodi wont return to play when "hey snips kodi pause"
        check for is_in_session to end kodi navigator when asked or start a new session for navigator session loop
        '''
        if kodi.check_connectivity() and not is_in_session:
            ausgabe('reset_mediaplay',1)
            playing_state_current = kodi.get_running_state() 
            if playing_state_old == 1 and playing_state_current == 0:
                kodi.resume()
            playing_state_old = 0
        elif kodi.check_connectivity() and is_in_session:
            if kodi.get_running_state():
                end_navigator()
            else:
                start_session(intent_filter='"'+snipsuser+'kodiNavigator","'+snipsuser+'kodiInputNavigation",'\
                              '"'+snipsuser+'kodiWindowNavigation", "'+snipsuser+'search_album",'\
                              '"'+snipsuser+'search_artist","'+snipsuser+'search_movie",'\
                              '"'+snipsuser+'search_show"'\
                              ,customData="kodi_navigation")
                
    elif msg.topic == 'hermes/asr/textCaptured':
        #checks for captured text to end session immediately if it is empty 
        payload = json.loads(msg.payload.decode())
        session_id= payload['sessionId']
        if payload['text'] == '':
            end_session(session_id,text="")
            
    elif 'intent' in msg.topic:
        ausgabe("Intent detected!",1)
        payload = json.loads(msg.payload.decode())
        slotvalue = ""
        slotname = ""
        slotisrandom = ""
        playlistid = 1
        if len(payload['slots']) > 1:
            #check if besides the mediatitle name the random slot is given 
            for item in payload['slots']:
                if item['slotName'] == 'random':
                    slotisrandom = "random"
                else:
                    slotvalue = item["value"]["value"]
                    slotname = item["slotName"]
        elif payload["slots"] != []:
            slotvalue = payload["slots"][0]["value"]["value"]
            slotname = payload["slots"][0]["slotName"]   
        name = payload["intent"]["intentName"]
        session_id= payload['sessionId']
        custom_data = payload['customData']
        ausgabe('"{0}" \n   -- "{1}":"{2}"\n   -- "customData":"{3}\n   -- "{4}" wiedergabe \n   -- "sessionId: {5} '\
            .format(name, slotname, slotvalue, custom_data, slotisrandom,session_id),0)
        if kodi.check_connectivity():
            #check if kodi is online else end session
            #first check for intents which can require the session to keep alive or start a new session with tts
            if msg.topic == 'hermes/intent/'+snipsuser+'datenbank':
                #hey snips synchronise library
                inject()
            elif msg.topic == 'hermes/intent/'+snipsuser+'play_movie':
                '''
                hey snips start the movie iron man
                add the select_movie intent in case multiple titles will be found e.g. iron man 1, iron man 2, iron man 3
                slotname: movies
                slotvalue:  -filled from injection
                '''
                intent_filter = '"'+snipsuser+'select_movie","'+snipsuser+'play_movie"'
                main_controller(slotvalue,slotname,'movieid',kodi.get_movies(),session_id,intent_filter,slotisrandom, playlistid)
            elif msg.topic == 'hermes/intent/'+snipsuser+'select_movie':
                '''
                iron man 3
                this intent will only work if the session is keept alive with the customData "media_selected" when multiple sessions are found. so it is possible to only say the movie name without hey snips...
                slotname: movies
                slotvalue:  -filled from injection
                '''
                
                if payload['customData']=="media_selected":
                    intent_filter = '"'+snipsuser+'select_movie","'+snipsuser+'play_movie"'
                    main_controller(slotvalue,slotname,'movieid',kodi.get_movies(),session_id,intent_filter,slotisrandom,playlistid)
                else:
                    end_session(session_id,text="")
            elif msg.topic == 'hermes/intent/'+snipsuser+'play_show':
                '''
                hey snips play the show marvels iron fist, hey snips play a random episode of futurama
                slotname: shows
                slotvalue:  -filled from injection
                slotname: random
                slotvalue: random +synonyms
                '''
                intent_filter = '"'+snipsuser+'play_show","'+snipsuser+'select_show"'
                main_controller(slotvalue,slotname,'tvshowid',kodi.get_shows(),session_id,intent_filter,slotisrandom,playlistid)
            elif msg.topic == 'hermes/intent/'+snipsuser+'select_show':
                '''
                if multiple shows are found e.g hey snips play the show marvels - marvels iron fist, marvels luke cake....
                slotname: shows
                slotvalue:  -filled from injection
                '''
                if payload['customData']=="media_selected":
                    intent_filter = '"'+snipsuser+'play_show","'+snipsuser+'select_show"'
                    main_controller(slotvalue,slotname,'tvshowid',kodi.get_shows(),session_id,intent_filter,slotisrandom,playlistid)
                else:
                    end_session(session_id,text="")
            elif msg.topic == 'hermes/intent/'+snipsuser+'play_genre':
                '''
                hey snips play pop music
                slotname: genre
                slotvalue:  -filled from injection
                '''
                intent_filter = '"'+snipsuser+'play_genre"'
                main_controller(slotvalue,slotname,'genreid',kodi.get_genre(),session_id,intent_filter,slotisrandom,0)
            elif msg.topic == 'hermes/intent/'+snipsuser+'play_artist':
                '''
                hey snips play songs by lady gaga
                slotname: artist
                slotvalue:  -filled from injection
                '''
                intent_filter = '"'+snipsuser+'play_genre"'
                main_controller(slotvalue,slotname,'artistid',kodi.get_artists(),session_id,intent_filter,slotisrandom,0)
            elif msg.topic == 'hermes/intent/'+snipsuser+'play_album':
                '''
                hey snips play album ...
                slotname: albums
                slotvalue:  -filled from injection
                '''
                intent_filter = '"'+snipsuser+'play_album"'
                main_controller(slotvalue,slotname,'albumid',kodi.get_albums(),session_id,intent_filter,slotisrandom,0)
            elif msg.topic == 'hermes/intent/'+snipsuser+'kodiNavigator':
                '''
                hey snips start navigator
                slotname: startstop
                slotvalue: start, stop +synonyms
                '''
                if slotvalue =='start':
                    start_navigator(session_id)    
                if slotvalue == 'stop':
                    end_navigator(session_id)
            elif msg.topic == 'hermes/intent/'+snipsuser+'kodiInputNavigation':
                '''
                up, left, okay, back, search for movies with marvels
                this intent only works if the navigator loop started
                slotname: kodiinput
                slotvalue: (value, synonyms)
                    left, links, nach links
                    right, rechts, nach rechts
                    up, hoch, nach oben
                    down, runter, nach unten
                    pageup, eine seite hoch, eine seite nach oben
                    pagedown, eine seite runter, eine seite nach unten
                    select, okay, öffnen
                    back, zurück
                    info, information
                    playlist, öffne wiedergabe liste
                    queue, in playlist einreihen, zur playlist hinzufügen, zur wiedergabeliste hinzufügen
                    close, schließen
                    togglewatched, wechsel gesehen status
                    parentdir, ein ordner nach oben
                    scrollup, scroll hoch, hoch scrollen, nach oben scrollen
                    scrolldown, sroll runter, runter scrollen, nach unten scrollen

                '''
                if payload['customData']=="kodi_navigation":
                    kodi_navigation_input(slotvalue,session_id)
                else:
                    end_session(session_id)
            elif msg.topic == 'hermes/intent/'+snipsuser+'kodiWindowNavigation':
                '''
                hey snips open movies, home, addons
                slotname: windows
                slotvalues: (value, synonyms)
                    videos, Filme
                    shows, Serien
                    music, Musik
                    addon, Add ons
                    useraddon, benutzer addon
                    videoaddon, video addon
                    audiaddon, musik addon
                    executableaddon, programm addon
                    home, hauptmenü
                    videoplaylist, video playlist, video wiedergabeliste
                    musicplaylist, musik playlist, musik wiedergabeliste
                    fullscreenvideo, zurück zum video, zurück zur wiedergabe, zurück zum film, zurück zur serie, zurück zur folge

                '''
                kodi_navigation_gui(slotvalue,session_id)
            
            else:
                #these intent will end the session after the function is called
                if msg.topic == 'hermes/intent/'+snipsuser+'KodiPause':
                    #hey snips papuse
                    playing_state_old = 0
                    kodi.pause()
                    ausgabe('pause',1)
                elif msg.topic == 'hermes/intent/'+snipsuser+'KodiResume':
                    #hey snips resume
                    playing_state_old = 0
                    kodi.resume()
                    ausgabe('resume',1)
                elif msg.topic == 'hermes/intent/'+snipsuser+'KodiStop':
                    #hey snips stop player
                    playing_state_old = 0
                    kodi.stop()
                    ausgabe('stop',1)
                elif msg.topic == 'hermes/intent/'+snipsuser+'KodiNext':
                    #hey snips play next song/episode
                    kodi.next_media()
                    ausgabe('next_media',1)
                elif msg.topic == 'hermes/intent/'+snipsuser+'KodiPrevious':
                    #hey snips play previous
                    kodi.previous_media()
                    ausgabe('previous_media',1)
                elif msg.topic == 'hermes/intent/'+snipsuser+'KodiShuffleON':
                    #hey snips set suffle on
                    kodi.shuffle_on(playlistid)
                    ausgabe('shuffle_on',1)
                elif msg.topic == 'hermes/intent/'+snipsuser+'KodiShuffleOFF':
                    #hey snips set suffle off
                    kodi.shuffle_off(playlistid)
                    ausgabe('shuffle_off',1)
                elif msg.topic == 'hermes/intent/'+snipsuser+'subtitles':
                    '''
                    hey snips set subtitles off
                    slotname: on_off
                    slotvalue: on, off +synonyms
                    '''
                    kodi.subtitles(slotvalue)
                    ausgabe('set_subtitles',1)
                elif msg.topic == 'hermes/intent/'+snipsuser+'search_show':
                    '''
                    hey snips search show marvel
                    slotname: shows
                    slotvalue:  -filled from injection
                    '''
                    search(slotvalue,slotname,kodi.get_shows())
                elif msg.topic == 'hermes/intent/'+snipsuser+'search_movie':
                    '''
                    hey snips search movie spider
                    slotname: movies
                    slotvalue:  -filled from injection
                    '''
                    search(slotvalue,slotname,kodi.get_movies())
                elif msg.topic == 'hermes/intent/'+snipsuser+'search_artist':
                    '''
                    hey snips search artist eminem
                    slotname: artist
                    slotvalue:  -filled from injection
                    '''
                    search(slotvalue,slotname,kodi.get_artists())
                elif msg.topic == 'hermes/intent/'+snipsuser+'search_album':
                    '''
                    hey snips search album relapse
                    slotname: albums
                    slotvalue:  -filled from injection
                    '''
                    search(slotvalue,slotname,kodi.get_albums())
                end_session(session_id,text="")
        else:
            end_session(session_id,text="")
Example #6
0
def main_controller(slotvalue,slotname,id_slot_name,json_d,session_id,intent_filter,israndom,playlistid):
    
    '''
    serch id of title in json from kodi library. if id is found get episodes/songs ids, stop kodi, insert playlist, (shuffle playlist), play.
    if id not found: search(). if search finds only one(search "big bang" find "the big bang theroy"): main_controller with slotvalue=search() return.
    if found multiple (search "iron" find "iron man 1, iron man 2..." keep session alive and add media_selected to custom_data. 
    playlist size is limited to 20 items cause kodi keeps crashing while adding to much items
    
    slotvalue: the media title from snips e.g. Iron Man
    slotname: the name of the slot of the snips intent e.g. movies
    id_slot_name: the key value name of the media id from the kodi library json
    session_id: the snips session id
    intent_filter: the intents for new or keep alive snips sessions
    israndom: from snips if the media should played in random order e.g. hey snips play seinfeld in random order
    playlistid: the playlist id for kodi. 0=Music; 1=Movies; 2=Pictures
    '''
    global playing_state_old
    ausgabe('main_controller',1)
    media_id_of_title_found = kodi.find_title_id(slotvalue,'label',id_slot_name,json_d)
    if media_id_of_title_found != 0:
        intent_filter=""
        if slotname =='shows':
            id_slot_name='episodeid'
            if str(israndom) == "random":
                json_episodes = kodi.get_episodes_all(media_id_of_title_found)
            else:
                json_episodes = kodi.get_episodes_unseen(media_id_of_title_found)
            if json_episodes['limits']['total'] != 0:
                id_tupel = build_tupel(json_episodes['episodes'], id_slot_name)
            else:
                start_session(session_type="notification", text="keine episoden gefunden")
        elif slotname=='movies':
            id_tupel = [media_id_of_title_found]
        elif slotname=='genre':
            json_songs = kodi.get_songs_by(id_slot_name,media_id_of_title_found)
            id_slot_name="songid"
            id_tupel = build_tupel(json_songs, id_slot_name)
        elif slotname=='artist':
            json_songs = kodi.get_songs_by(id_slot_name,media_id_of_title_found)
            id_slot_name="songid"
            id_tupel = build_tupel(json_songs, id_slot_name)
        elif slotname=='albums':
            json_songs = kodi.get_songs_by(id_slot_name,media_id_of_title_found)
            id_slot_name="songid"
            id_tupel = build_tupel(json_songs, id_slot_name)
        playing_state_old = 0
        if israndom == "random":
            shuffle(id_tupel)
        end_session(session_id, text="")
        kodi.stop()
        kodi.insert_playlist(id_tupel,id_slot_name, playlistid)
        kodi.start_play(playlistid)
    else:
        titles = search(slotvalue,slotname,json_d)
        ausgabe(titles)
        if len(titles) == 1:
            end_session(session_id, text="")
            main_controller(titles[0],slotname,id_slot_name,json_d,session_id,intent_filter,israndom,playlistid)
            return
        keep_session_alive(session_id,text="",intent_filter=intent_filter,customData="media_selected")
    return
Example #7
0
def start_partymode():
    kodi.stop()
    kodi_navigation_gui("musicplaylist")
    kodi.partymode()
    return
def on_message(client, userdata, msg):
    global playing_state_old
    global is_in_session
    #global is_injecting
    global is_injected
    global status
    if msg.topic == 'hermes/injection/complete':
        is_injected = 1
        start_session(session_type="notification", intent_filter="",\
                      text="Kodi Remote für Snips ist jetzt bereit.",\
                      customData="", site_id="rpiz1.zuhause.xx")
        ausgabe('injection erfolgreich beendet', 0)
    if msg.topic != 'hermes/audioServer/default/audioFrame':
        payload = json.loads(msg.payload.decode())
        ausgabe('"{0}" - "{1}"'.format(msg.topic, payload), 0)
    if msg.topic == 'hermes/hotword/default/detected':
        #when hotword is detected pause kodi player for better understanding. check if kodi is online, kodi is playing, not in kodi navigator session
        ausgabe(
            'silent_mediaplay - hotword detected - is_in_session = {0}'.format(
                is_in_session), 1)
        if kodi.check_connectivity() and kodi.get_running_state(
        ) and not is_in_session:
            kodi.pause()
            playing_state_old = 1
    elif msg.topic == 'hermes/dialogueManager/sessionEnded':
        payload = json.loads(msg.payload.decode())
        session_id = payload['sessionId']
        site_id = payload['siteId']
        ausgabe(
            'Session Ended on : siteId=' + str(site_id) + ' -- sessionId=' +
            str(session_id), 0)
        '''
        if session ended return to kodi playing state. check if not in kodi navigator session so kodi keeps on pause while navigating.
        also check current playing state so kodi wont return to play when "hey snips kodi pause"
        check for is_in_session to end kodi navigator when asked or start a new session for navigator session loop
        '''
        if kodi.check_connectivity() and not is_in_session:
            ausgabe('reset_mediaplay', 1)
            playing_state_current = kodi.get_running_state()
            if playing_state_old == 1 and playing_state_current == 0:
                kodi.resume()
            playing_state_old = 0
        elif kodi.check_connectivity() and is_in_session:
            status = 0
            status = kodi.get_running_state()
            if status:
                #if kodi.get_running_state():
                #ausgabe('Kodi-Status:'+status,2)
                ausgabe('Kodi-Status : {0}'.format(status), 2)
                end_navigator(session_id="", site_id=side_id)
            else:
                start_session(intent_filter='"'+snipsuser+'kodiNavigator","'+snipsuser+'kodiInputNavigation",'\
                              '"'+snipsuser+'kodiWindowNavigation", "'+snipsuser+'search_album",'\
                              '"'+snipsuser+'search_artist","'+snipsuser+'search_movie",'\
                              '"'+snipsuser+'search_show","'+snipsuser+'search_genre"'\
                              ,customData="kodi_navigation",site_id=site_id)
    elif msg.topic == 'hermes/asr/textCaptured':
        #checks for captured text to end session immediately if it is empty
        payload = json.loads(msg.payload.decode())
        session_id = payload['sessionId']
        if payload['text'] == '':
            end_session(session_id, text="")
    elif 'intent' in msg.topic:
        #ausgabe("Intent detected!",1)
        payload = json.loads(msg.payload.decode())
        slotvalue = ""
        slotname = ""
        slotisrandom = ""
        playlistid = 1
        if len(payload['slots']) > 1:
            #check if besides the mediatitle name the random slot is given
            for item in payload['slots']:
                if item['slotName'] == 'random':
                    slotisrandom = "random"
                else:
                    slotvalue = item["value"]["value"]
                    slotname = item["slotName"]
        elif payload["slots"] != []:
            slotvalue = payload["slots"][0]["value"]["value"]
            slotname = payload["slots"][0]["slotName"]
        name = payload["intent"]["intentName"]
        session_id = payload['sessionId']
        site_id = payload['siteId']
        custom_data = payload['customData']
        #added siteId to invest who was the sending satellite
        ausgabe('"{0}" \n   -- "{1}":"{2}"\n   -- "customData":"{3}"\n   -- "{4}" wiedergabe \n   -- "sessionId":"{5}"\n   -- "siteId"   :"{6}"'\
                .format(name, slotname, slotvalue, custom_data, slotisrandom,session_id,site_id),0) # 0-->1
        ausgabe('Anfang Intent Loop')
        if kodi.check_connectivity():
            #check if kodi is online else end session
            #first check for intents which can require the session to keep alive or start a new session with tts
            if msg.topic == 'hermes/intent/' + snipsuser + 'datenbank':
                #hey snips synchronise library
                if not is_injecting and not is_injected:
                    inject()
                else:
                    end_session(session_id,
                                text="Kodi Datenbank wurde bereits injiziert.")
            elif msg.topic == 'hermes/intent/' + snipsuser + 'play_movie':
                '''
                hey snips start the movie iron man
                add the select_movie intent in case multiple titles will be found e.g. iron man 1, iron man 2, iron man 3
                slotname: movies
                slotvalue:  -filled from injection
                '''
                intent_filter = '"' + snipsuser + 'select_movie","' + snipsuser + 'play_movie"'
                main_controller(slotvalue, slotname, 'movieid',
                                kodi.get_movies(), session_id, intent_filter,
                                slotisrandom, playlistid, site_id)
            elif msg.topic == 'hermes/intent/' + snipsuser + 'select_movie':
                '''
                iron man 3
                this intent will only work if the session is keept alive with the customData "media_selected" when multiple sessions are found. so it is possible to only say the movie name without hey snips...
                slotname: movies
                slotvalue:  -filled from injection
                '''
                if payload['customData'] == "media_selected":
                    intent_filter = '"' + snipsuser + 'select_movie","' + snipsuser + 'play_movie"'
                    main_controller(slotvalue, slotname, 'movieid',
                                    kodi.get_movies(), session_id,
                                    intent_filter, slotisrandom, playlistid,
                                    site_id)
                else:
                    end_session(session_id, text="")
            elif msg.topic == 'hermes/intent/' + snipsuser + 'play_show':
                '''
                hey snips play the show marvels iron fist, hey snips play a random episode of futurama
                slotname: shows
                slotvalue:  -filled from injection
                slotname: random
                slotvalue: random +synonyms
                '''
                intent_filter = '"' + snipsuser + 'play_show","' + snipsuser + 'select_show"'
                main_controller(slotvalue, slotname, 'tvshowid',
                                kodi.get_shows(), session_id, intent_filter,
                                slotisrandom, playlistid, site_id)
            elif msg.topic == 'hermes/intent/' + snipsuser + 'select_show':
                '''
                if multiple shows are found e.g hey snips play the show marvels - marvels iron fist, marvels luke cake....
                slotname: shows
                slotvalue:  -filled from injection
                '''
                if payload['customData'] == "media_selected":
                    intent_filter = '"' + snipsuser + 'play_show","' + snipsuser + 'select_show"'
                    main_controller(slotvalue, slotname, 'tvshowid',
                                    kodi.get_shows(), session_id,
                                    intent_filter, slotisrandom, playlistid,
                                    site_id)
                else:
                    end_session(session_id, text="")
            elif msg.topic == 'hermes/intent/' + snipsuser + 'play_genre':
                '''
                hey snips play pop music
                slotname: genre
                slotvalue:  -filled from injection
                '''
                intent_filter = '"' + snipsuser + 'play_genre",' + '"' + snipsuser + 'select_genre"'
                main_controller(slotvalue, slotname, 'genreid',
                                kodi.get_genre(), session_id, intent_filter,
                                slotisrandom, 0, site_id)
            elif msg.topic == 'hermes/intent/' + snipsuser + 'select_genre':
                #maybe slotname is wrong has to be investigated : look at play show/select_show
                '''
                if multiple shows are found e.g hey snips play the show marvels - marvels iron fist, marvels luke cake....
                slotname: shows
                slotvalue:  -filled from injection
                '''
                if payload['customData'] == "media_selected":
                    intent_filter = '"' + snipsuser + 'play_genre",' + '"' + snipsuser + 'select_genre"'
                    main_controller(slotvalue, slotname, 'genreid',
                                    kodi.get_genre(), session_id,
                                    intent_filter, slotisrandom, 0, site_id)
                else:
                    end_session(session_id, text="")
            elif msg.topic == 'hermes/intent/' + snipsuser + 'play_artist':
                '''
                hey snips play songs by lady gaga
                slotname: artist
                slotvalue:  -filled from injection
                '''
                intent_filter = '"' + snipsuser + 'play_artist",' + '"' + snipsuser + 'select_artist"'
                main_controller(slotvalue, slotname, 'artistid',
                                kodi.get_artists(), session_id, intent_filter,
                                slotisrandom, 0, site_id)
            elif msg.topic == 'hermes/intent/' + snipsuser + 'select_artist':
                '''
                if multiple shows are found e.g hey snips play the show marvels - marvels iron fist, marvels luke cake....
                slotname: shows
                slotvalue:  -filled from injection
                '''
                if payload['customData'] == "media_selected":
                    intent_filter = '"' + snipsuser + 'play_artist",' + '"' + snipsuser + 'select_artist"'
                    main_controller(slotvalue, slotname, 'artistid',
                                    kodi.get_artists(), session_id,
                                    intent_filter, slotisrandom, 0, site_id)
                else:
                    end_session(session_id, text="")
            elif msg.topic == 'hermes/intent/' + snipsuser + 'play_album':
                '''
                hey snips play album ...
                slotname: albums
                slotvalue:  -filled from injection
                '''
                intent_filter = '"' + snipsuser + 'play_album",' + '"' + snipsuser + 'select_album"'
                main_controller(slotvalue, slotname, 'albumid',
                                kodi.get_albums(), session_id, intent_filter,
                                slotisrandom, 0, site_id)
            elif msg.topic == 'hermes/intent/' + snipsuser + 'select_album':
                '''
                if multiple shows are found e.g hey snips play the show marvels - marvels iron fist, marvels luke cake....
                slotname: shows
                slotvalue:  -filled from injection
                '''
                if payload['customData'] == "media_selected":
                    intent_filter = '"' + snipsuser + 'play_album",' + '"' + snipsuser + 'select_album"'
                    main_controller(slotvalue, slotname, 'albumid',
                                    kodi.get_albums(), session_id,
                                    intent_filter, slotisrandom, 0, site_id)
                else:
                    end_session(session_id, text="")
            elif msg.topic == 'hermes/intent/' + snipsuser + 'kodiNavigator':
                '''
                hey snips start navigator
                slotname: startstop
                slotvalue: start, stop +synonyms
                '''
                if slotvalue == 'start':
                    start_navigator(session_id, site_id)
                if slotvalue == 'stop':
                    end_navigator(session_id, site_id)
            elif msg.topic == 'hermes/intent/' + snipsuser + 'kodiInputNavigation':
                '''
                up, left, okay, back, search for movies with marvels
                this intent only works if the navigator loop started
                slotname: kodiinput
                slotvalue: (value, synonyms)
                    left, links, nach links
                    right, rechts, nach rechts
                    up, hoch, nach oben
                    down, runter, nach unten
                    pageup, eine seite hoch, eine seite nach oben
                    pagedown, eine seite runter, eine seite nach unten
                    select, okay, öffnen
                    back, zurück
                    info, information
                    playlist, öffne wiedergabe liste
                    queue, in playlist einreihen, zur playlist hinzufügen, zur wiedergabeliste hinzufügen
                    close, schließen
                    togglewatched, wechsel gesehen status
                    parentdir, ein ordner nach oben
                    scrollup, scroll hoch, hoch scrollen, nach oben scrollen
                    scrolldown, sroll runter, runter scrollen, nach unten scrollen
                '''
                if payload['customData'] == "kodi_navigation":
                    kodi_navigation_input(slotvalue, session_id)
                else:
                    end_session(session_id)
            elif msg.topic == 'hermes/intent/' + snipsuser + 'kodiWindowNavigation':
                '''
                hey snips open movies, home, addons
                slotname: windows
                slotvalues: (value, synonyms)
                    videos, Filme
                    shows, Serien
                    music, Musik
                    addon, Add ons
                    useraddon, benutzer addon
                    videoaddon, video addon
                    audiaddon, musik addon
                    executableaddon, programm addon
                    home, hauptmenü
                    videoplaylist, video playlist, video wiedergabeliste
                    musicplaylist, musik playlist, musik wiedergabeliste
                    fullscreenvideo, zurück zum video, zurück zur wiedergabe, zurück zum film, zurück zur serie, zurück zur folge
                    fullscreenmusic
                '''
                kodi_navigation_gui(slotvalue, session_id)
            else:
                #these intent will end the session after the function is called
                if msg.topic == 'hermes/intent/' + snipsuser + 'KodiPause':
                    #hey snips pause
                    playing_state_old = 0
                    kodi.pause()
                    #ausgabe('pause',1)
                elif msg.topic == 'hermes/intent/' + snipsuser + 'KodiResume':
                    #hey snips resume
                    playing_state_old = 0
                    kodi.resume()
                    #ausgabe('resume',1)
                elif msg.topic == 'hermes/intent/' + snipsuser + 'KodiStop':
                    #hey snips stop player
                    playing_state_old = 0
                    kodi.stop()
                    #ausgabe('stop',1)
                elif msg.topic == 'hermes/intent/' + snipsuser + 'KodiNext':
                    #hey snips play next song/episode
                    kodi.next_media()
                    #ausgabe('next_media',1)
                elif msg.topic == 'hermes/intent/' + snipsuser + 'KodiPrevious':
                    #hey snips play previous
                    kodi.previous_media()
                    #ausgabe('previous_media',1)
                elif msg.topic == 'hermes/intent/' + snipsuser + 'KodiLauter':
                    #hey snips lauter, kodi lauter, lautstärke hoch
                    if slotname == "schritte":
                        kodi.lauter(slotvalue)
                    else:
                        kodi.lauter(1)
                    #ausgabe('lautstärke_hoch',1)
                elif msg.topic == 'hermes/intent/' + snipsuser + 'KodiLeiser':
                    #hey snips leiser, nicht so laut, lautstärke runter
                    if slotname == 'schritte':
                        kodi.leiser(slotvalue)
                    else:
                        kodi.leiser(1)
                    #ausgabe('lautstärke_runter',1)
                elif msg.topic == 'hermes/intent/' + snipsuser + 'KodiSetVolume':
                    #hey snips leiser, nicht so laut, lautstärke runter
                    kodi.volume(slotvalue)
                    #ausgabe('lautstärke_setzen',1)
                elif msg.topic == 'hermes/intent/' + snipsuser + 'KodiMute':
                    #hey snips leiser, nicht so laut, lautstärke runter
                    kodi.mute()
                    #ausgabe('lautstärke_an-aus',1)
                elif msg.topic == 'hermes/intent/' + snipsuser + 'KodiShuffle':
                    '''
                    hey snips set shuffle an,off,an,aus
                    slotname: on_off
                    slotvalue: on, off +synonyms
                    '''
                    kodi.shuffle(slotvalue)
                    #ausgabe('shuffle',1)
                elif msg.topic == 'hermes/intent/' + snipsuser + 'kodiSubtitles':
                    '''
                    hey snips set subtitles off
                    slotname: on_off
                    slotvalue: on, off +synonyms
                    '''
                    kodi.subtitles(slotvalue)
                    #ausgabe('set_subtitles',1)
                elif msg.topic == 'hermes/intent/' + snipsuser + 'search_show':
                    '''
                    hey snips search show marvel
                    slotname: shows
                    slotvalue:  -filled from injection
                    '''
                    search(slotvalue, slotname, kodi.get_shows(), site_id)
                elif msg.topic == 'hermes/intent/' + snipsuser + 'search_movie':
                    '''
                    hey snips search movie spider
                    slotname: movies
                    slotvalue:  -filled from injection
                    '''
                    search(slotvalue, slotname, kodi.get_movies(), site_id)
                elif msg.topic == 'hermes/intent/' + snipsuser + 'search_artist':
                    '''
                    hey snips search artist eminem
                    slotname: artist
                    slotvalue:  -filled from injection
                    '''
                    search(slotvalue, slotname, kodi.get_artists(), site_id)
                elif msg.topic == 'hermes/intent/' + snipsuser + 'search_album':
                    '''
                    hey snips search album relapse
                    slotname: albums
                    slotvalue:  -filled from injection
                    '''
                    search(slotvalue, slotname, kodi.get_albums(), site_id)
                elif msg.topic == 'hermes/intent/' + snipsuser + 'search_genre':
                    '''
                    hey snips search genre pop
                    slotname: genre
                    slotvalue:  -filled from injection
                    '''
                    search(slotvalue, slotname, kodi.get_genre(), site_id)
                elif msg.topic == 'hermes/intent/' + snipsuser + 'play_music':
                    '''
                    hey snips starte partymode, partymode an
                    slotname: none
                    slotvalue: none
                    '''
                    start_partymode(session_id)
                elif msg.topic == 'hermes/intent/' + snipsuser + 'play_tv':
                    '''
                    hey snips spiele fernseher ab
                    intent: play_tv
                    spielt eine vorgegebene PLayliste von Serien ab
                    die playliste heisst tv.xsp
                    alternativ start_tv spiele mit tv getaggte Serien ab?
                    '''
                    #start_tv()
                    start_playlist("video/tv.xsp", 1)
                elif msg.topic == 'hermes/intent/' + snipsuser + 'kodi_wakeup':
                    '''
                    hey snips wecke kodi, kodi aufwecken, wecke kodi auf
                    holt kodi aus dem standby
                    '''
                    gui_id = kodi.get_gui()['id']
                    print('kodi_wakeup: get_gui_id=', gui_id)
                    if str(kodi.get_gui()['id']) == '13003':
                        kodi.send_input("up")
                end_session(session_id, text="")
        else:
            end_session(session_id, text="")