Kodi Remote Control

[quote=“jvanhambelgium, post:180, topic:184260”]Thanks! Indeed the “Play” state never really worked. My light would not dim when starting a movie, I had to quickly “pause” “unpause” to make the lights go out.
Let me fix that in the code as you mentioned.
Hmm, running KODI on Adroid (ShieldTV) is slightly more annoying to make quick changes to files…[/quote]

If you have the Plex Server enabled, then you can go to Settings > Storage & Reset and enable Transfer files over network. It will give you a username and password. Then, from your Windows PC, you can browse to [font=courier]\<shield_ip>\internal[/font], enter the username and password, and access and edit the files directly.

I was on Kodi 18.0 until today, I just updated to Kodi 18.2

Thanks for the heads up, this info found here

On Leia the workflow is a bit different:

  • onPlayBackStarted() is triggered when the player is initialized, it does not mean media is playing
  • onAVChange() (new) is triggered when the player gets a stream either video, audio or subtitles
  • onAVStarted() (new) is called when the player actually starts playing the stream

So, please use self.isPlayingVideo() in the onAvStarted() event rather than on onPlayBackStarted()

1 Like

Anyone used/tested this micasaverde-plugin on the new KODI 19 release ? Works fine on KODI Leia 18.9 but KODI 19 “Matrix” uses Python 3.x and not 2.7 anymore.

I’ve not really looked properly in to the whole Kodi V19 and Python V3 thing yet.

Will Kodi V19 break compatibility with all add-ons that haven’t been updated by their developer to support it ?

For dormant and abandoned addons, is it not just a case of yourself changing the python dependency in one of the addons files ?

“bump the xbmc.python dependency to 3.0.0 in your addon.xml file”

I don’t have this Kodi Remote add-on installed any more on my HTPC, as I’m using the “Hue Service” addon instead.

But looking at its addon.xml file now, I can see:

I’d hazard a guess it’s just a case of changing that line to version 3.0.0 ?

Worth a try to see if it makes “broken” addons then work ?

Try it with the Kodi Remote addon and let us know what happens ?

I don’t plan to update to Kodi V19 anytime soon till the dust settles a bit however.

Sounds like there could be a lot more to it, reading from the below wiki page.

I have some old addons I am still using in Kodi, like the CAM Overlay addon for bringing up IP camera images in Kodi.

And other addons, if they won’t work in Kodi V19 looks like I maybe stuck on Kodi V18.9 for quite some time.

I guess its going to be a case of changing the addon.xml file and the xbmc.python dependency to 3.0.0 and just seeing if these various old addons will still work or not?

https://kodi.wiki/view/General_information_about_migration_to_Python_3#Porting_Existing_Addons

Porting Existing Addons

A brief procedure for porting existing code to Python 3-compatible with Future library:

  1. Install Future library into your working Python 2 virtual environment: pip install future.
  2. Run futurize utility to convert all your scripts and modules to portable code.

Test your new or converted addon in Kodi with Python 2 interpreter and fix all found issues. After that test the addon in Kodi with Python 3 interpreter and again fix all found issues. You can use Web-PDB debugger for troubleshooting issues in your code. It is compatible with both Python 2 and 3.

Arrggh, for some reason my KODI was auto-updated to Matrix 19 and I can confirm the Micasaverde addon is broken ;-(
I’ve edited the XML file on my Android box and placed 3.0.0 in the python field but no luck.

As you mentioned, there a few things different python 2.7 <> 3.x and it looks like the addon itself (default.py) needs some modifications.

Eg. I’m seeing errors in the KODI log on "No Module named ‘urllib2’
Also it seems the “import” syntax needs different way of coding in Python 3 ?

You rebooted also ?

That is quite possible

Sounds like its throwing Python exceptions then

Have a look for this folder on your Kodi box:

/usr/lib/python2.7

Can you see that folder ? and a urllib2 file in there ?

Also look in your /python3.0 folder is that file in there ?

I’m not sure.

All this is going to break a great many addons for everyone.

I’m using a nVidia ShieldTV and looking with the (non root) ES-file explorer but it seem the regular system-tree is not visible. Cannot see any /usr/… structure.
I did not reboot, just stopped/started KODI each time, then looked at logviewer etc.

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?