Page 1 of 1

Domoticz service addon for Kodi

Posted: Monday 25 January 2016 8:39
by moengiant
I created an addon for Kodi that uses the player's status to control Domoticz scenes. You can configure the addon to activate different scenes when the player starts, is paused, stopped or ends. This can also be configured separately for audio playback as well.

If you know how to create or edit a key map for Kodi you can additional create a custom menu with 5 additional settings of your choosing.
Very easy to add to the keymap. Just add this line between the <keyboard></keyboard> tags:

<keymap>
<global>
<keyboard>
<d mod="ctrl">SetProperty(Domoticzmenu,true,10000)</d>
</keyboard>
</global>
<Home>
<keyboard>
</keyboard>
</Home>
</keymap>

Now when the control + d keys are pressed the Domoticz menu will display.

Default location for the keymap.xml file - In some cases you will need to create the file.
Operative system File path
Android: Android/data/org.xbmc.kodi/files/.kodi/userdata/ (see note)
iOS: /private/var/mobile/Library/Preferences/Kodi/userdata/
Linux: ~/.kodi/userdata/
Mac: /Users/<your_user_name>/Library/Application Support/Kodi/userdata/ (see note)
OpenELEC: /storage/.kodi/userdata/
Windows: Start - type %APPDATA%\kodi\userdata - press <Enter>


This addon is a port of Brad Arthur's hard work with his Insteon addon that I tweaked to work for both InControl and now Domoticz.
If something doesn't work let me know as I didn't do any major testing on this.

Here is the link on Github - https://github.com/moengiant/DomoKodi

Re: Domoticz service addon for Kodi

Posted: Sunday 03 April 2016 15:30
by Deluka
Hello
Trying this script but getting a error inside KODI to check the log
This is what i get there

Code: Select all

ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: 
Error Contents: global name 'user' is not defined
Traceback (most recent call last):
File "/storage/.kodi/addons/DomoKodi-master/default.py", line 533, in 
Domoticz_direct( ip = hip, port = hport, username = huser, password = hpword, command = g_video_paused )
File "/storage/.kodi/addons/DomoKodi-master/default.py", line 79, in Domoticz_direct
url = 'http://%s:%s\@%s:%s/json.htm?type=command&param=switchscene&idx=%s&switchcmd=On' % (user,password,ip,port,command)
NameError: global name 'user' is not defined
-->End of Python script error report<--
I'm using version 6.0.3 of openelec

Re: Domoticz service addon for Kodi

Posted: Sunday 29 May 2016 1:17
by moengiant
On line 79 (user,password,ip,port,command) should be (username,password,ip,port,command)

Re: Domoticz service addon for Kodi

Posted: Wednesday 17 October 2018 16:32
by moengiant
Deluka wrote: Sunday 03 April 2016 15:30 Hello
Trying this script but getting a error inside KODI to check the log
This is what i get there

Code: Select all

ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: 
Error Contents: global name 'user' is not defined
Traceback (most recent call last):
File "/storage/.kodi/addons/DomoKodi-master/default.py", line 533, in 
Domoticz_direct( ip = hip, port = hport, username = huser, password = hpword, command = g_video_paused )
File "/storage/.kodi/addons/DomoKodi-master/default.py", line 79, in Domoticz_direct
url = 'http://%s:%s\@%s:%s/json.htm?type=command&param=switchscene&idx=%s&switchcmd=On' % (user,password,ip,port,command)
NameError: global name 'user' is not defined
-->End of Python script error report<--
I'm using version 6.0.3 of openelec
Hey Deluka,
Did you get this working? Can I mark this solved.

Re: Domoticz service addon for Kodi

Posted: Wednesday 17 October 2018 16:52
by moengiant
Deluka wrote: Sunday 03 April 2016 15:30 Hello
Trying this script but getting a error inside KODI to check the log
This is what i get there

Code: Select all

ERROR: EXCEPTION Thrown (PythonToCppException) : -->Python callback/script returned the following error<--
- NOTE: IGNORING THIS CAN LEAD TO MEMORY LEAKS!
Error Type: 
Error Contents: global name 'user' is not defined
Traceback (most recent call last):
File "/storage/.kodi/addons/DomoKodi-master/default.py", line 533, in 
Domoticz_direct( ip = hip, port = hport, username = huser, password = hpword, command = g_video_paused )
File "/storage/.kodi/addons/DomoKodi-master/default.py", line 79, in Domoticz_direct
url = 'http://%s:%s\@%s:%s/json.htm?type=command&param=switchscene&idx=%s&switchcmd=On' % (user,password,ip,port,command)
NameError: global name 'user' is not defined
-->End of Python script error report<--
I'm using version 6.0.3 of openelec
Hey Deluka,
Did you get this working? Can I mark this solved?