# \[V4\] Module Kodi

**URL:** <https://community.gladysassistant.com/t/v4-module-kodi/5131>\
**Category:** Développement\
**Created:** [December 18, 2019, 9:09pm UTC](https://community.gladysassistant.com/t/v4-module-kodi/5131 "2019-12-18T21:09:15Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![euguuu](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/euguuu/32/5061_2.png) [@euguuu](https://community.gladysassistant.com/u/euguuu)\
**Post date:** [December 18, 2019, 9:09pm UTC](https://community.gladysassistant.com/t/v4-module-kodi/5131/1 "2019-12-18T21:09:15Z")

</div>

Hello,

I am trying to create a service to allow me to control my Kodi instance.  
I have managed to create a service that sends requests to Kodi and can launch or search for a movie.

Now I want to make it so that Gladys performs actions when I ask phrases like:

- Launch the movie ‹&nbsp;bidule&nbsp;›
- Play reggae music (streaming or directly on Kodi)

But I don’t know what I need to do for Gladys to associate a phrase with the launch of an action by my service or other.  
Is there a simple example in the existing code that I can rely on?

Thanks in advance

---

<div class="post-metadata">

**Author:** ![AlexTrovato](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/alextrovato/32/10705_2.png) [@AlexTrovato](https://community.gladysassistant.com/u/AlexTrovato)\
**Post date:** [December 18, 2019, 9:58pm UTC](https://community.gladysassistant.com/t/v4-module-kodi/5131/2 "2019-12-18T21:58:17Z")

</div>

Hello, search for the word `intent` (as far as I remember).  
You will find it for the lights.

---

<div class="post-metadata">

**Author:** ![euguuu](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/euguuu/32/5061_2.png) [@euguuu](https://community.gladysassistant.com/u/euguuu)\
**Post date:** [April 27, 2020, 10:38am UTC](https://community.gladysassistant.com/t/v4-module-kodi/5131/3 "2020-04-27T10:38:35Z")

</div>

Hello,

I have made good progress on this module and can now control my Kodi instance from phrases in Gladys chat.

For now, it only works for ‹&nbsp;simple&nbsp;› actions (play/pause, stop, mute, unmute, setvolume, increase/decrease volume…)

I have a problem, however, with more complex phrases, like ‹&nbsp;Kodi play the movie bidule&nbsp;›

I put in the brain «&nbsp;Kodi open movie %moviename%&nbsp;» but when I look at the classification result I do not find the value %moviename%, is there a particular configuration to tell the brain to search for these variables?

I have another small issue on the dashboard, I would just like to display the state of the media center in the device box of a room, but there it does not find the device in the living room (I have room in the db on my device and a poll command that works), what do I need to add for this device to appear automatically?

Thanks in advance

---

<div class="post-metadata">

**Author:** ![pierre-gilles](https://gladys-assistant-community.b-cdn.net/user_avatar/community.gladysassistant.com/pierre-gilles/32/5886_2.png) [@pierre-gilles](https://community.gladysassistant.com/u/pierre-gilles)\
**Post date:** [April 27, 2020, 11:23am UTC](https://community.gladysassistant.com/t/v4-module-kodi/5131/4 "2020-04-27T11:23:55Z")

</div>

Hi @euguuu! Thanks for your development, it’s great!

We use the NPM module [nlp.js](https://github.com/axa-group/nlp.js) in Gladys.

You must have taken inspiration from other sentences, where we say for example «&nbsp;What’s the temperature in the %room%?&nbsp;»

«&nbsp;%room%&nbsp;» is a «&nbsp;named entity&nbsp;» that we have defined in Gladys, so it is recognized by default without configuration.

In your case, you can rather take inspiration from this example:

> <https://github.com/GladysAssistant/Gladys/blob/master/server/config/brain/taxi/questions.en.json>

You can define «&nbsp;slots&nbsp;» in Gladys (check the nlp.js documentation to see how it works)

Do not hesitate if you have questions
