Page 1 of 2

Kodi add-on to control Domoticz

Posted: Thursday 25 December 2014 10:46
by Chopper_Rob
Hi everybody,

I've created a simple add-on for Kodi / XBMC to control Domoticz. It allows you to switch the favorite marked switches from anywhere in Kodi even when you're watching a movie. To use this you need to add a keymap to the script.

https://www.chopperrob.nl/xbmc-add-ons/ ... -from-kodi

At the moment it is a very simple script, but it should work.

Re: Kodi add-on to control Domoticz

Posted: Thursday 25 December 2014 10:55
by Heisenberg
Great! Will download Kodi and test this add on

Re: Kodi add-on to control Domoticz

Posted: Thursday 25 December 2014 12:54
by Raspberry Piet
Just installed your add-on for Kodi.
Works very well, i like it!
Thank you very much.

Edit: Maybe add option to select own script/API/JSON url when your Kodi add-on is opened.
And also select a different script/API/JSON url when the add-on is closed.

Re: Kodi add-on to control Domoticz

Posted: Thursday 25 December 2014 15:54
by Chopper_Rob
Thx for the feedback.
I just uploaded a new version with some small changes to the UI. Looks a bit better this way.

@Raspberry Piet. What exactly do you mean? That you can choose other lists then the favorites? That is already something on my "maybe-to-do-in-the-future-list"

Re: Kodi add-on to control Domoticz

Posted: Thursday 25 December 2014 21:59
by Raspberry Piet
Chopper_Rob wrote:Thx for the feedback.
I just uploaded a new version with some small changes to the UI. Looks a bit better this way.
Looks indeed better with icons!
Chopper_Rob wrote:@Raspberry Piet. What exactly do you mean? That you can choose other lists then the favorites? That is already something on my "maybe-to-do-in-the-future-list"

What i like to achieve is making specific devices/scenes actived or deactivated as favorite when your add-on is opened or closed.

Like this way:

Code: Select all

#!/bin/bash
curl -s "http://192.168.1.17:8080/json.htm?type=command&param=makefavorite&idx=20&isfavorite=1" 
curl -s "http://192.168.1.17:8080/json.htm?type=command&param=makefavorite&idx=21&isfavorite=0" 
But i think your idea on your "maybe-to-do-in-the-future-list" could be the solution for me?
Choosing specific devices/scenes instead of showing all favorites would be nice!

Re: Kodi add-on to control Domoticz

Posted: Thursday 25 December 2014 22:54
by Chopper_Rob
I'm looking into showing a specific roomplan, this way you could control from Domoticz which devices you want to see in the Kodi add-on. Might be better than making devices on the fly favorite and also better than just showing all the favorites.
Besides that i'm thinking of making this configurable in the addon settings. That way everybody can choose whatever they want (scenes, specific room or favorites)

Re: Kodi add-on to control Domoticz

Posted: Friday 26 December 2014 2:14
by Chopper_Rob
So I uploaded another version. (0.0.3)
In this version i changed a small UI thing. Now it will calculate the minimum height that is needed to show the devices. So if you only have a couple of devices it doesn't use the whole screen anymore.

I've also added some extra settings. You can now choose what you want to see, you can choose between all swithces, favorite switches, scenes, a specific roomplan or you can enter custom idx numbers.

Re: Kodi add-on to control Domoticz

Posted: Friday 26 December 2014 11:07
by Derik
mhwwwaaa.

Looks great..
Kodi is on my wishlist:-)

Is there a option that i can run kodi on the same hardware device as domoticz?

Re: Kodi add-on to control Domoticz

Posted: Friday 26 December 2014 12:01
by Raspberry Piet
V0.0.3 is very promising!
I like the option roomplan.
Roomplan shows the devices but doesn't show scenes?

I allready use your Kodi status script wich works well.
Should it be possible to implement its functions to the add-on?
Then activate a scene/switch when Kodi is playing or paused watching a movie.
And activate a different scene/switch when Kodi is playing or paused music.

Thanks again!

Re: Kodi add-on to control Domoticz

Posted: Friday 26 December 2014 12:11
by Derik
What is the best or nice version?
openelec or Raspbmc or Xbian

Re: Kodi add-on to control Domoticz

Posted: Friday 26 December 2014 12:23
by Raspberry Piet
Derik wrote:What is the best or nice version?
openelec or Raspbmc or Xbian
Maybe you can find your answer here:
http://gathering.tweakers.net/forum/lis ... es/1511319

I prefer Openelec but it is not installed on my RPI so can't provide an advice.
Tried Raspbmc and Xbian long time ago but i didn't like the responsiveness of it.

Re: Kodi add-on to control Domoticz

Posted: Friday 26 December 2014 14:39
by Chopper_Rob
Raspberry Piet wrote:V0.0.3 is very promising!
I like the option roomplan.
Roomplan shows the devices but doesn't show scenes?

I allready use your Kodi status script wich works well.
Should it be possible to implement its functions to the add-on?
Then activate a scene/switch when Kodi is playing or paused watching a movie.
And activate a different scene/switch when Kodi is playing or paused music.

Thanks again!
I don't think it is possible. It would mean that my add-on has to run as a service in Kodi and that would mean that i have to change a lot.
But i could change the "Kodi Status Script" to provide that functionality, the information on what type of media is playing is already send to the script thru the API. But my script is just ignoring this and is only triggering on playing or not.

@Derek. I also prefer OpenELEC, but it's been a long time since i tried the other ones on the rpi.

Re: Kodi add-on to control Domoticz

Posted: Friday 26 December 2014 14:45
by Chopper_Rob
If i change the Kodi script. Would you prefer to have a variable with the type of media that is playing or a switch for every type of media?

Re: Kodi add-on to control Domoticz

Posted: Friday 26 December 2014 15:13
by Raspberry Piet
Chopper_Rob wrote:If i change the Kodi script. Would you prefer to have a variable with the type of media that is playing or a switch for every type of media?
Can those variables be used within my own bash scripts or only in your python scipts? (Python looks too complex for me at this moment.)
Otherwise switch or perhaps Text-Sensor would be fine.
Is by chance information sent thru the API wich profile is active by Kodi?

Re: Kodi add-on to control Domoticz

Posted: Friday 26 December 2014 15:20
by Chopper_Rob
The script would fill a variable in Domoticz.

If i do a quick check it seems possible to retrieve the current Kodi profile.

Re: Kodi add-on to control Domoticz

Posted: Friday 26 December 2014 15:34
by Raspberry Piet
That would be fine!
Thank you very much!

edit: variable for active profile would be awesome!

Re: Kodi add-on to control Domoticz

Posted: Saturday 27 December 2014 10:13
by tommysharp
Works great on my Openelec system!

Do open/close sensors work yet? I was able to open the front gate from within Kodi but the Domoticz sensor device does not show that the gate is now open....

Re: Kodi add-on to control Domoticz

Posted: Saturday 27 December 2014 14:25
by Chopper_Rob
At the moment it can only work with switches that have an On/Off state. I'll see if i can change this.

@Raspberry Piet: I changed the Kodi script.

Re: Kodi add-on to control Domoticz

Posted: Saturday 27 December 2014 15:18
by Chopper_Rob
I uploaded a new version that supports more switch types, if your sensor is still not working please let me know what type of sensor it is.

Re: Kodi add-on to control Domoticz

Posted: Tuesday 23 June 2015 23:03
by Chopper_Rob
I updated the add-on, you can now use the left and right keys to switch between the different views.