Help with XBMC integration

Posted on
Sat Nov 23, 2013 8:24 pm
tenallero offline
Posts: 94
Joined: Oct 31, 2011
Location: Barcelona

Re: Help with XBMC integration

Hi,

Apologies to be so late.

This link points to the documentation about my Roomba plugin:
https://www.dropbox.com/s/9ghepfwbxdaw0 ... plugin.pdf

Inside you will find the link to download the code and setup instructions.

Some notes about it:
English is not my language. So, apologies about any linguistic incorrection.
I have publish it as a PDF file, because I have not found the correct way to do it as a readable forum entry (mainly about including pictures from my desktop)
The code is open. I will find the way to publish it on github or similar.
This plugin is my first Indigo's plugin and my first lines of python code. I would like to thank to Dan Noguerol (https://bitbucket.org/whizzosoftware/in ... ddy-plugin), because his work around "irrigation caddy plugin" give me inspiration and confidence to start coding a python plugin for Indigo.
Also congratulate Matt and Jay with the well done work with Indigo. It has been a nice experience to develop an Indigo plugin and collaborate with Matt testing some Fibaro's zwave devices.


Stoffergoffer, you opened the thread. Next point will be about XBMC and PiFace plugin.

Regards,

Ramon

Posted on
Sat Nov 23, 2013 8:43 pm
tenallero offline
Posts: 94
Joined: Oct 31, 2011
Location: Barcelona

Re: Help with XBMC integration

kwijibo007 wrote:
Hi Ramon,

Sounds excellent. I can't wait to see the plugin.

I was thinking the exact same thing except using the RESTful API for communications. I'm a novice programmer so am sure that sockets are a much better way to do it.

I plan to remove the brains of an old hard wired ADT alarm system with a Piface and Indigo.

Pete


Hi Pete,

I choose sockets instead of RESTful because it is a bi-directional communication. PiFace send to Indigo about inputs events (sensors), and Indigo sends to RaspberryPi about outputs (actions). So, you need to build two Restful servers. One inside the RaspPI and other inside the Indigo Plugin. IMHO, too much "infrastructure" for only sending a 8 bits little package.

In my home's setup, I have found socket solution to be very fast.

Regards,
Ramon

Posted on
Sun Nov 24, 2013 3:36 am
durosity offline
User avatar
Posts: 4320
Joined: May 10, 2012
Location: Newcastle Upon Tyne, Ye Ol' England.

Re: Help with XBMC integration

tenallero wrote:
Hi,

Apologies to be so late.

This link points to the documentation about my Roomba plugin:
https://www.dropbox.com/s/9ghepfwbxdaw0 ... plugin.pdf

Inside you will find the link to download the code and setup instructions.

Some notes about it:
English is not my language. So, apologies about any linguistic incorrection.
I have publish it as a PDF file, because I have not found the correct way to do it as a readable forum entry (mainly about including pictures from my desktop)
The code is open. I will find the way to publish it on github or similar.
This plugin is my first Indigo's plugin and my first lines of python code. I would like to thank to Dan Noguerol (https://bitbucket.org/whizzosoftware/in ... ddy-plugin), because his work around "irrigation caddy plugin" give me inspiration and confidence to start coding a python plugin for Indigo.
Also congratulate Matt and Jay with the well done work with Indigo. It has been a nice experience to develop an Indigo plugin and collaborate with Matt testing some Fibaro's zwave devices.


Stoffergoffer, you opened the thread. Next point will be about XBMC and PiFace plugin.

Regards,

Ramon


Looks great, I look forward to being able to get a roomba/roowifi in the new year to try it out! You might want to ask about getting a 3rd party developer forum setup here, otherwise i suspect the roomba plugin will get lost in the XBMC thread :)

Computer says no.

Posted on
Sat Nov 30, 2013 8:05 pm
tenallero offline
Posts: 94
Joined: Oct 31, 2011
Location: Barcelona

Re: Help with XBMC integration

Hi stoffergoffer,

In the following link, you will find documentation for the XBMC plugin:
https://www.dropbox.com/s/swg416uu7u2f5 ... plugin.pdf

I hope the plugin cover what you need.
Let us know your feedback.

Regards,
Ramon

Posted on
Mon Dec 02, 2013 5:15 pm
stoffergoffer offline
Posts: 37
Joined: Apr 16, 2013

Re: Help with XBMC integration

YES, this works flawless.
I only have one question now: When a movie is paused and you start playing again, indigo won't act on the "is playing video" trigger. To trigger anything when going from pause to playing I have to select "Player changed" trigger. Is this a bug?

Posted on
Tue Dec 03, 2013 8:51 am
tenallero offline
Posts: 94
Joined: Oct 31, 2011
Location: Barcelona

Re: Help with XBMC integration

Hi,

I am happy the pluggin work for you.
Did you have any trouble during setup. Or any issue not pointed by documentation?


About your question:

The plugin has some "custom states" that mirror what is happening on your xbmc:

* media (video, audio, livetv, radio, pictures, etc)
* player (playing, paused, stopped)
* menu (video,audio,livetv, etc)
* muted (No/Yes)
* volume (0 to 100%)
* title (the media's title the player is on)


And most of the triggers are mapped to the different values these "custom states" have.

The "player is stopped/playing/paused" triggers indicate the xbmc's player status.
Very similar to Indigo iTunes plugin
(http://www.perceptiveautomation.com/wik ... states.png)

The "is playing ..." triggers family is linked to what kind of media the xbmc's player is using.


So,
When you launch XBMC, you have:

media = nothing
player = stopped

When you start watching a video, you have:

media = video
player = playing

When you pause the video, you have:

media = video
player = paused
(note: You can see the media has not changed. But the status is paused)

When you continue watching video, you have:

media = video
player = playing

When you stop watching, you have:

media = nothing
player = stopped

If you go to your XBMC music submenu, and begin to listen music, you have:

media = audio
player = playing

And so on ...

So, if you want to switch on/off your room's light when you pause/resume watching an XBMC video ... you must use the "the player is" triggers.
Maybe you can use "media=video" as a condition for the trigger. So, you will not switch off/on the lights when pausing music or pictures.

I hope I have understand your question. If not, let me know.
Of course, this plugin can be improved a lot.

Ramon

Posted on
Thu Dec 05, 2013 3:39 am
stoffergoffer offline
Posts: 37
Joined: Apr 16, 2013

Re: Help with XBMC integration

Thanks a lot! I found the directions to be very clear and easy to follow, and this just cleared up some confusion for me. For your information i am using frodo 12.2, so your plugin works for this version.

The problem for me is that i have a variable i want to copy into another variable when the movie starts (the current house state: sleep, awake, away etc. into variable 'lasthousestate'), then change house variable to 'playing', and when the movie ends put the house variable back to the previous value again.

The procedure seems easy at first, but the problem is when the movie pauses and then starts playing again, it triggers the same actions as when the movie starts. And i get the 'playing' value in both housestate and lasthousestate.
I then created a second trigger called 'movie plays again' with the condition that the xbmc device state has to be paused. This didn't work... The reason is that the trigger look at the conditions after it has been triggered, and at this moment the xbmc state is actually playing.

So i created my own variable which changes with the xbmc state only with a 1 second delay, and i now use this to know the previous state of the player :)

Thank you very much for your work with these plugins. I also think you should have your own subforum so this doesn't get buried.

Posted on
Thu Dec 05, 2013 5:59 am
tenallero offline
Posts: 94
Joined: Oct 31, 2011
Location: Barcelona

Re: Help with XBMC integration

Hi,

Nice. You found the "glue" between your "home logic" and "xbmc logic".

Did you test sending any actions toward xbmc from Indigo?
Like quit xbmc, mute, change volume, stop/start playing, etc ...
Maybe, I could develop a GUI remote control as an IndigoTouch web page.

Now, I can see these plugins are useful.
After publishsing the PiFace plugin, I think I will request a subforum.


Ramon

Posted on
Thu Dec 05, 2013 12:05 pm
Korey offline
User avatar
Posts: 811
Joined: Jun 04, 2008
Location: Henderson, NV

Re: Help with XBMC integration

tenallero wrote:

In the following link, you will find documentation for the XBMC plugin:
https://www.dropbox.com/s/swg416uu7u2f5 ... plugin.pdf

I hope the plugin cover what you need.
Let us know your feedback.

Regards,
Ramon


Just installed and configured the plugin, it works great!

Now I can get rid of all the scripting in XBMC that I was using to trigger Indigo events :P

Thank you very much for this Fantastic Plugin! :D

--
Korey

Posted on
Mon Dec 09, 2013 2:56 am
tenallero offline
Posts: 94
Joined: Oct 31, 2011
Location: Barcelona

Re: Help with XBMC integration

Korey wrote:
tenallero wrote:

In the following link, you will find documentation for the XBMC plugin:
https://www.dropbox.com/s/swg416uu7u2f5 ... plugin.pdf

I hope the plugin cover what you need.
Let us know your feedback.

Regards,
Ramon


Just installed and configured the plugin, it works great!

Now I can get rid of all the scripting in XBMC that I was using to trigger Indigo events :P

Thank you very much for this Fantastic Plugin! :D


Hi Korey,

I remember your target was syncronizing your room lights with xmbc player status.
Thanks for your feedback.

Ramon

Posted on
Fri Jan 03, 2014 3:02 pm
rlust offline
Posts: 93
Joined: Jan 12, 2009
Location: Ohio

Re: Help with XBMC integration

Great job on this plugin!!

I am using XBMC Frodo 12.3.

I have tried to send a pause and resume with a action group and I am getting a error below.

jan 3, 2014, 4:00:41 PM
Action Group XBMC rasp Pi Play Pause FR copy
XBMC Error XBMC FR Rasp pi: RPC API Error: {"error":{"code":-32100,"message":"Failed to execute method."},"id":12,"jsonrpc":"2.0"}

Should this work?

Thanks again!

Posted on
Fri Jan 03, 2014 3:30 pm
tenallero offline
Posts: 94
Joined: Oct 31, 2011
Location: Barcelona

Re: Help with XBMC integration

Hi rlust,

Happy New year.
I will try to help you as soon as possible.

The error message ""Failed to execute method."" comes from XBMC.
So, XBMC is running in your RaspberryPI and received the request from Indigo ... but it did not liked it :-(

Can you post more info to help me reproduce your problem with my own XBMC?
Can you post how did you defined your indigo's action group? (some picture?)

What media did your XBMC was playing? music? video? livetv?
Did you have success with other XBMC requests?

Regards,
Ramon

Posted on
Sat Jan 04, 2014 2:10 pm
tenallero offline
Posts: 94
Joined: Oct 31, 2011
Location: Barcelona

Re: Help with XBMC integration

Hi rlust,

I have been trying to reproduce the error you reported.

On my system, I have created two action groups. One for pause, other for resume.
If XBMC is playing something (a video, in my test), when I execute "pause" action group ... xbmc pauses the video. And the same with resume action group.
But, If XBMC is not playing any video (by example, just starting xbmc) ... I get the same error that you reported.

The answer from XBMC is correct. It can not pause/resume nothing if nothing is playing.
Maybe, in a future release, I could check the plugin "player status" previously to send pause/resume to xbmc.

Can you execute your "pause/resume" action groups without error if your XBMC is playing a video?

Regards,
Ramon

Posted on
Sat Jan 04, 2014 5:08 pm
mattggarland offline
Posts: 49
Joined: Jan 06, 2013

Re: Help with XBMC integration

Hi tenallero,
I have been using applescript to control XBMC running from my Mac Mini through a HDMI matrix. It's a nightmare! I have issues like HDMI not handshaking with the audio and its very delayed responses from the remote control.

Perhaps you can help with an installation issue, for some reason XBMC is telling me the add-on file does not have the correct structure?
I'm no good with XBMC's add ons and any suggestions would be a great help!

Your work is much appreciated!

Matt

Posted on
Sat Jan 04, 2014 9:04 pm
tenallero offline
Posts: 94
Joined: Oct 31, 2011
Location: Barcelona

Re: Help with XBMC integration

Hi mattggarland,

Yes, the zip file must follow a determined internal structure:
http://wiki.xbmc.org/index.php?title=Add-on_structure

Which version of XBMC are you running? Frodo (Rel. 12), Gotham (Rel.13)?
I have only tested this addon with Frodo and Gotham. Maybe you are running an older release (Eden rel.11?)
I understand that your XBMC is running under OSX.

I have recreated the zip file.
I have cleaned some OSX hidden files inside the zip that maybe cause the problem.
But, it is strange. Other users did not report any issue about the zip file.

The link to download is the same as documentation indicates:
https://www.dropbox.com/s/296580e0ep0vl ... indigo.zip
Please, download it another time.

Remember that:

* The full setup consist about two different zip files.
* One zip file is for XBMC. The other is for Indigo.
* service.indigo.zip is the file that contains the XBMC Addon. Be sure to point to this file when installing from XBMC.
* You must not unzip the file. XBMC will extract it by itself.

I hope it will work.

Regards,
Ramon

Who is online

Users browsing this forum: No registered users and 3 guests