Kodi add-on to control Domoticz

Moderator: leecollings

Chopper_Rob
Posts: 17
Joined: Wednesday 28 May 2014 21:11
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: NL
Contact:

Kodi add-on to control Domoticz

Post 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.
Heisenberg
Posts: 135
Joined: Monday 27 January 2014 14:12
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: Netherlands
Contact:

Re: Kodi add-on to control Domoticz

Post by Heisenberg »

Great! Will download Kodi and test this add on
Raspberry Pi Type B
Raspberry Pi Type B2
RFXCOMtrx433e
Raspberry Piet
Posts: 158
Joined: Saturday 11 January 2014 16:21
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: NL
Contact:

Re: Kodi add-on to control Domoticz

Post 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.
Chopper_Rob
Posts: 17
Joined: Wednesday 28 May 2014 21:11
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: NL
Contact:

Re: Kodi add-on to control Domoticz

Post 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"
Raspberry Piet
Posts: 158
Joined: Saturday 11 January 2014 16:21
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: NL
Contact:

Re: Kodi add-on to control Domoticz

Post 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!
Chopper_Rob
Posts: 17
Joined: Wednesday 28 May 2014 21:11
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: NL
Contact:

Re: Kodi add-on to control Domoticz

Post 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)
Chopper_Rob
Posts: 17
Joined: Wednesday 28 May 2014 21:11
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: NL
Contact:

Re: Kodi add-on to control Domoticz

Post 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.
Derik
Posts: 1601
Joined: Friday 18 October 2013 23:33
Target OS: Raspberry Pi / ODroid
Domoticz version: BETA
Location: Arnhem/Nijmegen Nederland
Contact:

Re: Kodi add-on to control Domoticz

Post 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?
Xu4: Beta Extreme antenna RFXcomE,WU Fi Ping ip P1 Gen5 PVOutput Harmony HUE SolarmanPv OTG Winddelen Alive ESP Buienradar MySensors WOL Winddelen counting RPi: Beta SMAspot RFlinkTest Domoticz ...Different backups
Raspberry Piet
Posts: 158
Joined: Saturday 11 January 2014 16:21
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: NL
Contact:

Re: Kodi add-on to control Domoticz

Post 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!
Derik
Posts: 1601
Joined: Friday 18 October 2013 23:33
Target OS: Raspberry Pi / ODroid
Domoticz version: BETA
Location: Arnhem/Nijmegen Nederland
Contact:

Re: Kodi add-on to control Domoticz

Post by Derik »

What is the best or nice version?
openelec or Raspbmc or Xbian
Xu4: Beta Extreme antenna RFXcomE,WU Fi Ping ip P1 Gen5 PVOutput Harmony HUE SolarmanPv OTG Winddelen Alive ESP Buienradar MySensors WOL Winddelen counting RPi: Beta SMAspot RFlinkTest Domoticz ...Different backups
Raspberry Piet
Posts: 158
Joined: Saturday 11 January 2014 16:21
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: NL
Contact:

Re: Kodi add-on to control Domoticz

Post 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.
Chopper_Rob
Posts: 17
Joined: Wednesday 28 May 2014 21:11
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: NL
Contact:

Re: Kodi add-on to control Domoticz

Post 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.
Chopper_Rob
Posts: 17
Joined: Wednesday 28 May 2014 21:11
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: NL
Contact:

Re: Kodi add-on to control Domoticz

Post 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?
Raspberry Piet
Posts: 158
Joined: Saturday 11 January 2014 16:21
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: NL
Contact:

Re: Kodi add-on to control Domoticz

Post 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?
Chopper_Rob
Posts: 17
Joined: Wednesday 28 May 2014 21:11
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: NL
Contact:

Re: Kodi add-on to control Domoticz

Post 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.
Raspberry Piet
Posts: 158
Joined: Saturday 11 January 2014 16:21
Target OS: Raspberry Pi / ODroid
Domoticz version: Beta
Location: NL
Contact:

Re: Kodi add-on to control Domoticz

Post by Raspberry Piet »

That would be fine!
Thank you very much!

edit: variable for active profile would be awesome!
tommysharp
Posts: 33
Joined: Thursday 05 June 2014 13:09
Target OS: Linux
Domoticz version:
Contact:

Re: Kodi add-on to control Domoticz

Post 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....
Chopper_Rob
Posts: 17
Joined: Wednesday 28 May 2014 21:11
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: NL
Contact:

Re: Kodi add-on to control Domoticz

Post 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.
Chopper_Rob
Posts: 17
Joined: Wednesday 28 May 2014 21:11
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: NL
Contact:

Re: Kodi add-on to control Domoticz

Post 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.
Chopper_Rob
Posts: 17
Joined: Wednesday 28 May 2014 21:11
Target OS: Raspberry Pi / ODroid
Domoticz version:
Location: NL
Contact:

Re: Kodi add-on to control Domoticz

Post by Chopper_Rob »

I updated the add-on, you can now use the left and right keys to switch between the different views.
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests