Hi,
here the new topic for the XBMCState plugin. Due to the change of the owner, it better to start a fresh topic with all the good information.
Instruction:
1-Install the XBMCState plugin from the mios app store (take note of your vera IP and XBMCState device ID)
2- Install the xbmc addon from the zip file below. (If you use safari, be careful cause it automatically unzip the file and xbmc give some error to install it)
3- Go to the addon setting and put the vera IP, xbmcstate device ID, put yes to all the event that you are interested in.
4-RESTART XBMC. When you change the ip address and id device you absolutely have to restart xbmc to take affect.
6-Try it out.
For now these event are triggered:
Music started
Video Started
Music paused
Video paused
Music resumed
Video resumed
Music stopped
Video stopped
Music ended
Video ended
Home menu
Video menu
Music menu
Weather menu
Setting menu
Program menu
Picture Menu
Music and video title of the file that is actually played is also showed.
There also now a debug mode that show what is send to vera in the log file if activate.
Edit on 14 march 2013:
Add debounce function for the video and music.
Add custom menu.
Add notification when plugin start (can be remove in the addon setting.)
Tested on Frodo
Windows 7 = OK
Windows 8 = OK
Linux = OK
Mac = OK
Raspberry = OK
OpenElec =OK
Mmmiam… Cool to see things progressing… When I get my Vera it was my first though to have a XBMC plugin.
I’ve tried to build a plug-in but is was way over may coding abilities…
the best I can do is trying to give good feedback. So tomorow, I will reinstall XBMC on an old laptop and try this.
Mic,
Nice work.
One admin suggestion… keep a changelog in post #1 and name the posted file with the version # so it simply takes a quick glance to see if we are up to date, and what has changed? I’m happy to test new version but I don’t want to keep asking, or guessing
also, in XBMC there is a naming structure for addons. Yours should be named: script.micasaverde - or similar.
This is extremely cool and perfect timing as I am in the middle of a migration from MCE to XBMC and I am really going to miss the mControl Home Automation add-on for MCE and Vera control.
I just installed the XBMCState Vera add-on and the XBMC add-on. In the XBMC add-on I entered the IP of my VeraLite and the device number of the XBMCState device in Vera which is #53.
In Vera it was asking me to enter an IP in Advanced settings, I presume this is the IP address of the XBMC PC.
Presume I can create more instances of XBMCState devices for multiple XBMC PCs?
In the XBMC add-on under player state I set to yes Music - Paused / Started / Stopped. I then restarted XBMC application.
Looking at the XBMCState Device in VeraLite it says Ping status: UP
If I start playing an Album the XBMCState device in Vera says Play State - Audio Started if I pause the music it says Audio Paused, so seems to be working.
Now ideally Id like to use this to dim and brighten my lamps in the lounge when I play and pause movies. How do I do this? Do I use the XBMCState device as a trigger on one of my lighting scenes?
Also we would need some kind of control over when this happens, obviously we don’t want lights coming on during the day when watching movies.
Yes, you’re right, when releasing next version, will make a number in the zip file. I’m like you i hate to follow all the topic to see every version that have been release. So when something new will be released, it will be edited in the first post with the change log and the new download. That also why i started a new topic. Did you test it Aaron?
Glad to see it working @cw-kid. In the vera plugin, i had all the trigger that xbmc send so, for me, i have make a scene named:
Xbmc led tele
And in the scene, i put a trigger of each event that i want. (go in the trigger tab, add xbmcstate and chose the one that you want)
When the trigger is created, there’s luup code at the right of the created trigger.
Just put the luup code that you want. For sure you could put more trigger and use diffirent luup code for each trigger.
If you are not familiar with luup code , this help me a lot when i started: http://wiki.micasaverde.com/index.php/Luup_Scenes_Events
Check, there are a code for (if the it’s the night, do it or not).
Let me know if you have some difficulty.
Here’s what I did so far, I created a second XBMCState Device instance for my Linux / XBMC PC that is actually connected to my TV.
Device ID = #54. Setup the XBMC add-on again and checked the status changes in Vera for the XBMCState device which indeed it does.
I then edited one of my existing scenes - Lounge On which turns the lights on 100% added a trigger as shown in the screen shot. But when I pause the lights do not brighten up to 100%.
I will look at this properly tomorrow as its late here now and I’ve had a few beers
It seems that you have the old vera plugin, you should not. Strange cause i upload the new one. The old one didn’t care about the music or video playback so that why it does not work. Sorry about that. I check that right now.
It’s the first time that i try to upload code to the mios app. If you want to try it tonight, here the link of the file that you need to upload in the app developer tab:
just upload it in your vera and trigger should now appear with the music menu and video option. I will check and comeback to you when update will be passed.
Sorry again
EDIT: link from dropbox have been remove, it seems like dropbox make the json file a html file.
Use the link below.
Change is in the hand of micasaverde. Need to wait the approval before releasing it. My fault sorry. Like i say in the previous post, if you don’t want to wait, just upload the file with the link to your vera.
I uploaded the new Json file to Vera. I was then checking the settings in XBMC on my Windows Laptop and accidently clicked the Defaults button which wiped out all the settings in the XBMC add-on. I entered the Vera IP and Device ID again etc in XBMC.
Now when looking at the XBMC-Laptop device in Vera it looks like the screen shot below, is this correct?
The icon has gone and so has the Ping / Play state etc.
I just turned on the Linux XBMC PC and reloaded Vera and that device has changed as well so presume this is expected. Will try some triggers next.
Thanks
EDIT: Neither XBMC-State device is listed now in trigger devices you can select. For example the Linux XBMC PC device in Vera I assigned to the Living Room. But if you look at the screen shot I cant see the XBMC device to select as a trigger.
lol, i just realized in is an error when downloading the file from dropbox, it also save’s the html stuff to the file when I use “Save Link as…” directly on the link in the forum. I attached it again to this post, right click and save the file to your pc, the upload it to the vera.
I downloaded the Json file again and uploaded to Vera, now I am able to select XBMC - Lounge as a trigger device.
However when I pause video playback in XBMC the lights are still not turning on to 100%
EDIT: Also the XBMC-State devices in the Vera Device tab are still blank i.e. the dont show the Ping / Play status as they did initially.
EDIT2: Its just started working! Maybe it took a while for everything to pick up the changes!
When uploading a json file manually, always make sure you reload your lua engine and after it has reloaded, reload the vera UI in your browser. Then it usually works on the first try.
I just edited the lighting scenes and the XBMC Device triggers. On the Trigger tab I clicked the Luup Event button and added in this is night code as shown in screen shots.
Now when I pause / play the video in XBMC the lights do not come on / dim down. I will wait till it gets dark and test again.