[V4] Module Kodi

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 ‹ bidule ›
  • 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

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

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 ‹ simple › actions (play/pause, stop, mute, unmute, setvolume, increase/decrease volume…)

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

I put in the brain « Kodi open movie %moviename% » 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

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

We use the NPM module nlp.js in Gladys.

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

« %room% » is a « named entity » 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:

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

Do not hesitate if you have questions