XBMCState has been replaced? Superseded? by a new Vera and Kodi add-on called KodiRemote. KodiRemote is based off XBMCState however it also now has playback transport controls and navigational buttons, so you can control Kodi from the Vera web UI.
You should now install KodiRemote rather than XBMCState so follow the new setup guide here.
END OF UPDATE
Those of you who read my blog regular, will know I have been using Windows Media Center and the mControl Home Automation add-in for controlling my Micasaverde VeraLite Z-wave gateway. If not you can take a peek here.
It works well and I can control and view the status of lights, door & motion sensors, IP cameras and run scenes in Vera from the Windows Media Center UI on the TV.
I am currently working on migrating away from Windows Media Center to XBMC running on Linux Ubuntu and one of the biggest things I will miss in XBMC is this type of integration with my Vera Home Automation system.
What I am going to write about today is no where near as advanced as what I have setup in Windows Media Center, however its a good starting point and I am going to demonstration some basic Vera / XBMC integration using the new XBMCState add-on.
What I am going to setup is so the lights in my Living room automatically brighten up to 100% if I stop or pause Video playback in XBMC and when I start or resume Video playback in XBMC the lights automatically dim down to 25%.
As of writing today the XBMCState add-on is not in the Mios App store properly so you need to download and install it manually, if you are reading this much later then you will probably find it in the Mios app store by then.
Introduction: From the developer..
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 add-on 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.
Tested on Frodo
Windows = OK
Linux = OK
Mac = OK
Raspberry = OK
Getting started:
Install the XBMCState Vera add-on from the mIOS apps page here
This should create a new XBMCState device in Vera under the Devices tab (no room)
Click the Spanner on this device go to the Advanced tab and make a note of the Device ID number.
You can change the name: field from XBMCState to something meaningful like XBMC – Lounge or XBMC – Bedroom etc. I will come back to this later as you need to add an IP address as well.
Download the Zip file for the XBMC add-on here save it to some where your XBMC PC can access. Go in to XBMC and go to System – Settings – Add-ons. Select Install from zip file
Browse to the zip file and the add-on will be installed and enabled
Now from System – Settings – Add-ons, select Enabled Add-ons
Select Services
Right click the Micasaverde XBMC event item and select Configure
Insert the IP address of your Vera unit and enter the Device ID number of the XBMCState device in Vera.
XBMC state tab
Player state tab
Here you can select the different events that can happen in XBMC and that the XBMCState device in Vera will detect. I have selected Yes on the following Video playback states. Click OK and reboot the XBMC PC.
Go back to Vera and configure the new XBMCState device, go to the Advanced tab, I changed the name to XBMC – Lounge and enter the static IP address of your XBMC PC. Assign the device to a room. Save the changes and Reload Vera.
Now we can test its working? start playing a Video in XBMC.
The XBMCState Device status in Vera should say:
Computer: Up
Player: Video_start
Pause the Video playback in XBMC, the player status should change to Video_pause
This tells us that the XBMC add-on is successfully communicating with Vera.
Now we just need to add some triggers to our lighting scenes so the lights can be controlled via the Video playback status of XBMC.
In Vera I created two new scenes, you might be able to just use some of your existing scenes
XBMC – Lounge On (Scene)
So in my Lounge I have two lamps I want to be turned on when Video playback in XBMC is stopped or paused, so I just clicked both of these lamps to be on in the scene.
Next go to the Triggers tab of the scene
I added two new triggers one for Video Stopped and one for Video Paused
Video Stopped trigger
Device = Select your XBMCState device in this case #53 XBMC – Lounge
What type of event is the trigger? = Player State Changes
Name for this Trigger = Video Stopped
Player State = Video is Stopped
Now repeat this and recreate the second trigger for Video Paused.
Now we only want this to happen if its night time, you don’t want your lights coming on and off with video playback in XBMC if its day time. So for both of the triggers you just setup you need to click in to each Luup Event button
And paste in this is_night code:
if ( luup.is_night() ) then
return true
else
return false
end
Click the Save Lua button – then Confirm changes and save in Vera etc.
XBMC – Lounge Dim 25% (Scene)
Now we need to setup the scene that dims down the lights when Video playback in XBMC is Started or Resumed. Its the same as the above but your triggers are slightly different.
Set your lights to dim to the desired percentage
Again I have two triggers but this time for Video Resumed and Video Starting
Video Resumed trigger
Video Starting trigger
Again you need to click the Luup Event buttons on each trigger and add in the is_night code as before.
Save all that in Vera and Reload.
Now at night time when you start or resume video playback in XBMC your lights should auto dim down and when you stop or pause video playback the lights will brighten up.
More than one XBMC PC ?
If you have multiple XBMC PCs you can simply create more XBMCState devices in Vera, to do this go to the Apps tab in Vera scroll down and find the XBMCState app click It.
Click create another.
Obviously you will need to install the XBMCState add-on in to XBMC on those other XBMC PCs.
Summary
This is revision one of this guide so things maybe updated and changed as the XBMCState Vera / XBMC add-ons are further developed.
This is certainty not mControl in Windows Media Center but its definitely a first step in the right direction and thanks to the developers I am feeling slightly happier about the test Linux / XBMC PC that is sat in my living room, now that the lights can be controlled with XBMC Video playback!
{"id":null,"mode":"button","open_style":"in_place","currency_code":"GBP","currency_symbol":"\u00a3","currency_type":"decimal","blank_flag_url":"https:\/\/thedigitallifestyle.com\/w\/wp-content\/plugins\/tip-jar-wp\/\/assets\/images\/flags\/blank.gif","flag_sprite_url":"https:\/\/thedigitallifestyle.com\/w\/wp-content\/plugins\/tip-jar-wp\/\/assets\/images\/flags\/flags.png","default_amount":500,"top_media_type":"none","featured_image_url":false,"featured_embed":"","header_media":null,"file_download_attachment_data":null,"recurring_options_enabled":true,"recurring_options":{"never":{"selected":true,"after_output":"One time only"},"weekly":{"selected":false,"after_output":"Every week"},"monthly":{"selected":false,"after_output":"Every month"},"yearly":{"selected":false,"after_output":"Every year"}},"strings":{"current_user_email":"","current_user_name":"","link_text":"Leave a tip","complete_payment_button_error_text":"Check info and try again","payment_verb":"Pay","payment_request_label":"TheDigitalLifestyle.com","form_has_an_error":"Please check and fix the errors above","general_server_error":"Something isn't working right at the moment. Please try again.","form_title":"TheDigitalLifestyle.com","form_subtitle":null,"currency_search_text":"Country or Currency here","other_payment_option":"Other payment option","manage_payments_button_text":"Manage your payments","thank_you_message":"Thank you for being a supporter!","payment_confirmation_title":"TheDigitalLifestyle.com","receipt_title":"Your Receipt","print_receipt":"Print Receipt","email_receipt":"Email Receipt","email_receipt_sending":"Sending receipt...","email_receipt_success":"Email receipt successfully sent","email_receipt_failed":"Email receipt failed to send. Please try again.","receipt_payee":"Paid to","receipt_statement_descriptor":"This will show up on your statement as","receipt_date":"Date","receipt_transaction_id":"Transaction ID","receipt_transaction_amount":"Amount","refund_payer":"Refund from","login":"Log in to manage your payments","manage_payments":"Manage Payments","transactions_title":"Your Transactions","transaction_title":"Transaction Receipt","transaction_period":"Plan Period","arrangements_title":"Your Plans","arrangement_title":"Manage Plan","arrangement_details":"Plan Details","arrangement_id_title":"Plan ID","arrangement_payment_method_title":"Payment Method","arrangement_amount_title":"Plan Amount","arrangement_renewal_title":"Next renewal date","arrangement_action_cancel":"Cancel Plan","arrangement_action_cant_cancel":"Cancelling is currently not available.","arrangement_action_cancel_double":"Are you sure you'd like to cancel?","arrangement_cancelling":"Cancelling Plan...","arrangement_cancelled":"Plan Cancelled","arrangement_failed_to_cancel":"Failed to cancel plan","back_to_plans":"\u2190 Back to Plans","update_payment_method_verb":"Update","sca_auth_description":"Your have a pending renewal payment which requires authorization.","sca_auth_verb":"Authorize renewal payment","sca_authing_verb":"Authorizing payment","sca_authed_verb":"Payment successfully authorized!","sca_auth_failed":"Unable to authorize! Please try again.","login_button_text":"Log in","login_form_has_an_error":"Please check and fix the errors above","uppercase_search":"Search","lowercase_search":"search","uppercase_page":"Page","lowercase_page":"page","uppercase_items":"Items","lowercase_items":"items","uppercase_per":"Per","lowercase_per":"per","uppercase_of":"Of","lowercase_of":"of","back":"Back to plans","zip_code_placeholder":"Zip\/Postal Code","download_file_button_text":"Download File","input_field_instructions":{"tip_amount":{"placeholder_text":"How much would you like to tip?","initial":{"instruction_type":"normal","instruction_message":"How much would you like to tip? Choose any currency."},"empty":{"instruction_type":"error","instruction_message":"How much would you like to tip? Choose any currency."},"invalid_curency":{"instruction_type":"error","instruction_message":"Please choose a valid currency."}},"recurring":{"placeholder_text":"Recurring","initial":{"instruction_type":"normal","instruction_message":"How often would you like to give this?"},"success":{"instruction_type":"success","instruction_message":"How often would you like to give this?"},"empty":{"instruction_type":"error","instruction_message":"How often would you like to give this?"}},"name":{"placeholder_text":"Name on Credit Card","initial":{"instruction_type":"normal","instruction_message":"Enter the name on your card."},"success":{"instruction_type":"success","instruction_message":"Enter the name on your card."},"empty":{"instruction_type":"error","instruction_message":"Please enter the name on your card."}},"privacy_policy":{"terms_title":"Terms and conditions","terms_body":null,"terms_show_text":"View Terms","terms_hide_text":"Hide Terms","initial":{"instruction_type":"normal","instruction_message":"I agree to the terms."},"unchecked":{"instruction_type":"error","instruction_message":"Please agree to the terms."},"checked":{"instruction_type":"success","instruction_message":"I agree to the terms."}},"email":{"placeholder_text":"Your email address","initial":{"instruction_type":"normal","instruction_message":"Enter your email address"},"success":{"instruction_type":"success","instruction_message":"Enter your email address"},"blank":{"instruction_type":"error","instruction_message":"Enter your email address"},"not_an_email_address":{"instruction_type":"error","instruction_message":"Make sure you have entered a valid email address"}},"note_with_tip":{"placeholder_text":"Your note here...","initial":{"instruction_type":"normal","instruction_message":"Attach a note to your tip (optional)"},"empty":{"instruction_type":"normal","instruction_message":"Attach a note to your tip (optional)"},"not_empty_initial":{"instruction_type":"normal","instruction_message":"Attach a note to your tip (optional)"},"saving":{"instruction_type":"normal","instruction_message":"Saving note..."},"success":{"instruction_type":"success","instruction_message":"Note successfully saved!"},"error":{"instruction_type":"error","instruction_message":"Unable to save note note at this time. Please try again."}},"email_for_login_code":{"placeholder_text":"Your email address","initial":{"instruction_type":"normal","instruction_message":"Enter your email to log in."},"success":{"instruction_type":"success","instruction_message":"Enter your email to log in."},"blank":{"instruction_type":"error","instruction_message":"Enter your email to log in."},"empty":{"instruction_type":"error","instruction_message":"Enter your email to log in."}},"login_code":{"initial":{"instruction_type":"normal","instruction_message":"Check your email and enter the login code."},"success":{"instruction_type":"success","instruction_message":"Check your email and enter the login code."},"blank":{"instruction_type":"error","instruction_message":"Check your email and enter the login code."},"empty":{"instruction_type":"error","instruction_message":"Check your email and enter the login code."}},"stripe_all_in_one":{"initial":{"instruction_type":"normal","instruction_message":"Enter your credit card details here."},"empty":{"instruction_type":"error","instruction_message":"Enter your credit card details here."},"success":{"instruction_type":"normal","instruction_message":"Enter your credit card details here."},"invalid_number":{"instruction_type":"error","instruction_message":"The card number is not a valid credit card number."},"invalid_expiry_month":{"instruction_type":"error","instruction_message":"The card's expiration month is invalid."},"invalid_expiry_year":{"instruction_type":"error","instruction_message":"The card's expiration year is invalid."},"invalid_cvc":{"instruction_type":"error","instruction_message":"The card's security code is invalid."},"incorrect_number":{"instruction_type":"error","instruction_message":"The card number is incorrect."},"incomplete_number":{"instruction_type":"error","instruction_message":"The card number is incomplete."},"incomplete_cvc":{"instruction_type":"error","instruction_message":"The card's security code is incomplete."},"incomplete_expiry":{"instruction_type":"error","instruction_message":"The card's expiration date is incomplete."},"incomplete_zip":{"instruction_type":"error","instruction_message":"The card's zip code is incomplete."},"expired_card":{"instruction_type":"error","instruction_message":"The card has expired."},"incorrect_cvc":{"instruction_type":"error","instruction_message":"The card's security code is incorrect."},"incorrect_zip":{"instruction_type":"error","instruction_message":"The card's zip code failed validation."},"invalid_expiry_year_past":{"instruction_type":"error","instruction_message":"The card's expiration year is in the past"},"card_declined":{"instruction_type":"error","instruction_message":"The card was declined."},"missing":{"instruction_type":"error","instruction_message":"There is no card on a customer that is being charged."},"processing_error":{"instruction_type":"error","instruction_message":"An error occurred while processing the card."},"invalid_request_error":{"instruction_type":"error","instruction_message":"Unable to process this payment, please try again or use alternative method."},"invalid_sofort_country":{"instruction_type":"error","instruction_message":"The billing country is not accepted by SOFORT. Please try another country."}}}},"fetched_oembed_html":false}
Richard Danis liked this on Facebook.