Kodi Remote Control

Its all changed in Python 3 by the looks of it

They say:

" The urllib2 module has been split across several modules in Python 3 named urllib.request and urllib.error ."

Best to search the Kodi forums for help on how to convert the addon as required.

I guess its something I will have to learn how to do also at some point, for some of the addons I use if they haven’t been updated.

I’ve managed to fix it I think.
Basically I first used an online Python2 > Python3 convertor to sort some things out. Then I was still getting errors on addon-startup about xbmc.abortRequested: that is not valid anymore. After some searching I replaced it with xbmc.Monitor().abortRequested():

At this point in time the errors on KODI stopped popping up. It does seem like the “Configure” menu structure is a bit hosed up, don’t understand why because that’s not something I touched.

Note that I’m not a developer at all, I’ve never actually written any Python code in my life, but I can understand a bit and do some trial & error.

And finally I’ve checked on my Reactor sensor and it seems the states (start/stop/end/pauze) do seem to arrive at my Veraplus, so this is to confirm it works.

I’ve attached the converted file here for whoever might need it, just rename it to extension .py and place it in the correct addon-folder.

default.py.zip (46.5 KB)

1 Like

Hello

I made the modification of the addon.xml and the default.py in the shield but kodi 19.2 still does not see the extension for the vera
How did you proceed thank you

for information I have this plugin there
https://www.smarthome.com.au/smarthome-blog/xbmc-vera-z-wave-addon/

this avoids installing xbmcstate or kodiremote on the vera and just to launch a scenen or two that’s enough for me but the operation is practically identical

What do you mean by this : “but kodi 19.2 still does not see the extension for the vera”’

So this this addon install correctly in the first place ? You performed its configuration (eg. IP of the Vera etc)

In my case I updated the default.py file in the Kodi ZIP package and it installed without errors/warnings etc.

I know this is an old thread, but i had not updated kodi since this plugin stopped working in matrix. Since it was no longer supported, i decided to update it and fix it myself. All the menus work like they did previously. You still need the xbmcstate on your vera. You can install through unknown sources and install from zip file. Tested on 19.3.

Note: I should mention, I’m not the original developer. I just decided to update the script for python3 as well as the settings.xml file to support the new matrix format. Also the language support changes for matrix so it only supports ‘english’ settings - i dont think it ever support anything other than that though.

micasaverde.addon.v1.3.zip (36.3 KB)

Tks a lot,
Does properly install and run on Kodi 19.1.0 for Linux Fedora finally.

By the way, does anybody know how to delete this boring warning “Can’t detect device” on UI7 and also get the XbmcState icon back ?

I was able to install your version… it kept all of my settings, and it seems to be enabled… but it’s not sending any of the events to my Vera. Did you have to do anything else special?

@mike_m,
Did you set your Kodi IP in your device parameters on Vera side ?
On Kodi side, did you set your device ID in your extension settings (and then restart Kodi) ?

It was already set as I was using the old version with Kodi 18 for years. I just checked and they are both set correctly…

Do you get “up” and “down” at least respectively when Kodi computer’s up and down or just"–" instead ? (could be the IP not set correctly. Maybe the port is missing or something ?)
Did you check every event is set to “yes” under “xbmc state” settings on Kodi ?
Otherwise, I have no idea. All I can say is that it works perfectly well for me.

I cleared out and entered in the IP on the vera plugin.

Then on the kodi machine (libreelec), I made sure that the webserver was running on port 8080 and that all events were checked as yes.

My vera logs show the events:

06 03/22/22 13:20:37.147 Device_Variable::m_szValue_set device: 26 service: urn:upnp-org:serviceId:XBMCState1 variable: PlayerStatus was: Video_resume now: Video_pause #hooks: 0 upnp: 0 skip: 0 v:(nil)/NONE duplicate:0 <0x70bd0520>
06 03/22/22 13:20:43.048 Device_Variable::m_szValue_set device: 26 service: urn:upnp-org:serviceId:XBMCState1 variable: PlayerStatus was: Video_pause now: Video_resume #hooks: 0 upnp: 0 skip: 0 v:(nil)/NONE duplicate:0 <0x70f01520>
variable: ActualUsage was: 1 now: 1 #hooks: 0 upnp: 0 skip: 0 v:0x148f228/NONE duplicate:1 <0x76686520>
06 03/22/22 13:20:50.123 Device_Variable::m_szValue_set device: 26 service: urn:upnp-org:serviceId:KODIRemote1 variable: PingStatus was: up now: up #hooks: 0 upnp: 0

But somehow PLEG’s events tied to them are not firing off.

Did you delete your kodi machine’s old instance of the plugin and reinstall or just install over the one that was there?

I’ve changed both my Vera and Kodi machine in between.
So it was a complete new install on both sides personally.

I appreciate you sharing your experience though…

I turned on debugging and from Libreelc I see:

2022-03-24 00:38:32.893 T:1565 DEBUG : http://xxx:3480/data_request?id=variableset&DeviceNum=xxx&serviceId=urn:upnp-org:serviceId:XBMCState1&Variable=PlayerStatus&Value=Video_pause

I thought it was weird, because the older version I had installed was using KODIState1 not XBMC1. So in default.py I replaced all of the references of XBMCState to KODI.

My KODIRemote on Vera has a device type of “urn:schemas-upnp-org:device:KODIRemote:1”

I wonder what yours looks like…

I thought it was weird that it was referencing XBMCState1 and not KODIRemote1 as the plugin in Vera was expecting. I did a sed replace on those values in default.py and it is all working now. Not sure if @dbldown768 wants to add that to his code or not.

Also, the reason why the buttons on the Kodi plugin on Vera don’t work is because “As for many things Wiki is out of date. For security reasons there is a significant change in v18 that prevents GET working for most of the API commands. Use POST instead.”

So the get commands in the plugin like:

luup.inet.wget(“http://” … ipAddress … “:8080/jsonrpc?request=%7b%22jsonrpc%22%3a+%222.0%22%2c+%22method%22%3a+%22Player.GetActivePlayers%22%2c+%22id%22%3a+1%7d”, 5)
local jsondecoded = endecoder.decode(result1);

need to be called with a POST instead:

curl -X POST -H ‘Content-Type: application/json’ -i http://x:8080/jsonrpc --data ‘{“jsonrpc”: “2.0”, “method”: “Player.GetActivePlayers”, “id”: 1}’

And the port 8080 is hard coded in.

Hello, I’m reaching out again because I’ve just switched to Kodi Matrix and Vera Edge with UI7, and my xbmcstate is no longer working. I’ve been trying to tinker with it, but nothing seems to work, neither with Kodiremote nor xbmcstate. I’m a bit lost after reading all the posts that often refer to UI5 and Kodi 18. If a kind soul could guide me through the process to make it work with Kodi 20 and UI7, I would greatly appreciate it. It would be worth updating this plugin, as it’s quite useful. I believe I’m not the only one in this situation. Thank you very much.

If you have Philips Hue lights? There is a Kodi addon for that which works similar to what KodiRemote did.

Thats what I used instead, havent used XbmcState or KodiRemote for a long time.

Also the newer versions of Kodi use Pyrhon 3 for the addons. So any older addons that were not rebuilt for Python 3 just dont work.

You need to try this modified version of the addon.