Google Search

Custom Search

Powered by...

Find us on Facebook

Friday, 17 April 2015

KodiRemote for Micasaverde Vera Home Automation - Part 1

I previously wrote about the excellent XBMCState add-ons for XBMC and Vera here, which enabled you to run scenes in Vera based upon XBMC’s current playback status of either videos or music. For example you could create scenes to have your room lights automatically dim down when a movie starts and then if you paused or stopped the movie the lights would automatically brighten back up.

Recently I discovered there is a newer project called KodiRemote which is based on XBMCState, but expands its functions in Vera and adds basic playback transport controls and navigational buttons, so you can now control Kodi Media Center from the Vera web UI.

image

image

KodiRemote currently works with UI5 I believe and the developer says he is working on UI7 support for Vera. As I am running a VeraLite on UI5 this guide will be based on that version of the Vera Z-wave Home Automation controller. This article Part One, will cover the installation and setup of KodiRemote both on Vera side and in Kodi Media Center.
Part Two will probably cover creating scenes in Vera to work with KodiRemote for auto controlling your lights for example. I may also discuss how to setup a Virtual switch in Vera to specify if Kodi should be linked to Vera or not? Doing this you can turn off the integration between Kodi and Vera when you don’t want it to happen!

The setup for KodiRemote is more difficult than XBMCState as you need to SSH in to your Vera box to upload a file to it but I will demonstrate how I did this, we will also need to discover the root password for the Vera box to be able to do this. You can also see the developers setup instructions on the first page of this thread here. At the time of writing 17/04/2015 all the installation files you will need are also found on this thread and I will be linking to these, please note if you are reading this guide sometime later that these links may have changed which is beyond my control.

OK so lets get started and we will do the hardest part first which is SSH access in to your Vera box. Here are the developers comments about this, which is not allot to go on.

Requirements -

akb-json.lua (in Vera, Place it in /usr/lib/lua/)

1. Discover the root password (The following instructions were taken from this Wiki page here)

So how do we do this? Firstly we need to know the root password of the Vera box, I believe some Vera units have the root password printed on a sticker somewhere on the back, check yours first can you see it? If so write it down and make a note of it and you can skip this section. If not? Then you need to do the following to discover what your password is?

In Vera UI5 go to the Account tab and login to your MiOS account. Now select “Tech Support” it should be disabled, now click the “Enable It” button.

image

You will then see something like the below screen shot, note I have blacked out my Vera units serial number, you will see your own serial number in these locations.

image

Look at this section and make a note of the number after you serial number, in this example its 305052
This is a temporary password to give us some SSH access to the Vera box.

image

Now we need a client program that we can use to SSH in to the Vera box, I use Putty on my Windows 7 workstation.

You can download and install Putty from here.

Open Putty, enter the IP address of your Vera box and ensure you have 22 in the Port field. Also ensure SSH is checked. Then click the Open button.

image

A black terminal window will then be displayed showing a Login As: prompt.

Enter the username: remote

Now enter the temporary password you discovered previously.

You should then see a screen like this one.

image

Now type in this command to discover your root password!

nvram show | grep pass

Where you can see the red line, is where your root password will be displayed, write this down and make a note of it.

image

You can now close the Putty program. Don’t forget to go back in to the Vera web UI and Disable the temporary Tech Support access, by clicking the “Disable It” button.

2. Uploading the akb-json.lua file to your Vera box

Here are the developers further instructions:

You'll have to SSH into your Vera.
perhaps scp will be a much easier.
go to your terminal window (Mac or Linux) and run something like this:
scp /local/path/to/akb-json.lua root@your.vera.ip.address:/usr/lib/lua/


OK so first you need to download the akb-json.lua file to your workstation PC. Go to the forum page here and download the akb-json.lua  file from the first post, save it to your desktop or somewhere.

Now I am using my Windows 7 laptop as my workstation PC and I wasn’t sure how to upload the akb-json.lua file to Vera directly using Windows. The developer says use the terminal window on your MAC or Linux PC. I do have an Apple MAC here which is our family computer, so I could have used that machine. However I decided to use one of my Linux PCs, actually I used one of the Kodi OpenElec HTPCs to do this.

I used my Windows 7 PC workstation to connect to the SAMBA shares of the OpenElec PC, to do this I just used the Windows RUN dialog and entered \\192.168.X.X the IP address of my OpenElec PC.

image

I then copied the akb-json.lua file from my Windows 7 PC’s desktop and pasted it into the Downloads folder on my OpenElec PC.

image

Next I used Putty to connect to my OpenElec PC via SSH. This time entering the IP address of the OpenElec HTPC.

image

The default username and password for OpenElec are root and openelec

You will then see a terminal window like this one

image

Now type: cd downloads and press Enter on the keyboard

image

Now run this command to upload the akb-json.lua file which is located in the downloads folder on your OpenElec PC to the /usr/lib/lua/ folder on your Vera box.

scp akb-json.lua root@your.vera.ip.address/usr/lib/lua/

So it should be something like

scp akb-json.lua root@192.168.1.10/usr/lib/lua/

If 192.168.1.10 was the IP address of your Vera box for example.

You will then be prompted for the Vera units root password, which you wrote down earlier in the previous step.

If it works and the akb-json.lua file is copied up to the Vera unit it will look like the below screen shot and say 100%.

image

Success! you have now completed the difficult part of this guide, the rest should be much easier going, you can now exit the Putty terminal program.

Note:- I am no Linux guru and there are probably several other easier ways to get the akb-json.lua file uploaded to your Vera box, but this is how I did it.

3. Install the KodiRemote plug-in on to your Vera unit.

The KodiRemote plug-in for Vera can be found on the MiOS Marketplace here. Go to this webpage, ensure you are logged in with your MiOS account and select your Vera unit, then select Latest Release

image

And then select the Install button

image

The KodiRemote plug-in will then be pushed out to your Vera unit and installed.

When it has been installed if you go to the APPS tab in the Vera web UI you should see it listed as being installed etc.

image

You also need to install the Day or Night plug-in for Vera as this is also a requirement. Follow the same install procedure for the Day or Night plug-in from the MiOS Marketplace here if you don’t already have it installed?

image

4. Install the KodiRemote add-on for Kodi Media Center (or XBMC).

At the time of writing 17/04/2015 there are two download links on the Micasaverde forum page. One for Kodi Helix and one for presumably older versions of XBMC. Again these download links may change over time and be updated on the forum post, so it will be up to you to download and install the correct add-on zip files.

Kodi Helix add-on can be currently found on this post here named script.service.micasaverde.zip

And for other versions of XBMC the add-on named micasaverde.addon.zip can be found here. (I’ve not personally tested this one).

As I am using OpenElec 5.0.8 Kodi version 14.2 I downloaded the script.service.micasaverde.zip file to my Windows 7 PC workstation.

Again using the Windows RUN dialog I connected to the SAMBA shares on my OpenElec PC and copied the script.service.micasaverde.zip file in to the Downloads folder there.

Next in Kodi you need to install the add-on.

Note:- If you already have the XBMCState add-on which is named “Micasaverde XBMC Event” installed in Kodi / XBMC, you should first uninstall this add-on. To do this go to Kodi System Settings – Addons – Enabled Addons – Services find the “Micasaverde XBMC Event” add-on and uninstall it.

To install the new KodiRemote add-on which is named “Micasaverde Kodi Event” you need to do the following:

Navigate to System Settings – Addons – Install from ZIP file

image

Now browse to your Downloads folder on the OpenElec HTPC or to where ever you saved the  .zip file, where your Kodi PC can access that file location.

In my case I need to select the HOME FOLDER

image

Then I selected the Downloads folder

image

And finally selected the script.service.micasaverde.zip file that I placed into this downloads folder.

image

Once the add-on is installed in Kodi you can find it in the following location:

System Settings – Addons – Enabled Addons – Services and its called “Micasaverde Kodi Event”

Now right click the “Micasaverde Kodi Event” add-on entry  and select Configure.

image

Enter the IP address of your Vera unit and select OK. Now reboot your Kodi PC.

image

We can ignore the rest of the settings in here for now, as we now need to configure your first KodiRemote device instance in Vera, once we have done this we will come back to the settings in the Kodi add-on and complete the setup.

Note:- if you previously had the “Micasaverde XBMC Event” add-on installed for XBMCState, then you existing settings will still be present, some will need to be changed later.

5. Create and configure the KodiRemote Device instances in Vera

After installing the KodiRemote plug-in for Vera via the MiOS Marketplace, if you look in your Vera web UI, you should see that the first KodiRemote device instance has been automatically created.

In Vera UI5 go to the Devices tab and in the No Room section you should see the KodiRemote device.

image

This now needs to be configured to connect to the Kodi PC you just installed the “Micasaverde Kodi Event” add-on onto.

Click the Spanner icon on the KodiRemote device, go the advanced tab and in the IP field enter the static LAN IP address of your Kodi PC.

image

Note:- On my setup I also entered the real MAC address of the network adapter card in my Kodi PC in to the MAC field. I separated with colons : This may be optional.

Now you need to make a note of the Device ID in the above screen shot it is #116, you will need to enter this ID number in the “Micasaverde Kodi Event” add-on settings in Kodi later.

Give the KodiRemote device instance in Vera a suitable name. I have four Kodi HTPCs in my house and I named them KODI01 / KODI02 etc so for my Living Room HTPC I named the KodiRemote device instance “KODI01 - KODIRemote”

Here is my Living Room KodiRemote device instance, note I also assigned it to the actual room in the house where this HTPC is located.

image

Once you have configured this save and reload Vera.

Next you need to make a note of the Day or Night plug-ins device ID in Vera. Click the spanner icon and go to the advanced tab and write down the device ID number for the Day or Night plug-in.

image

At the end of this section you should have configured the first KodiRemote device instance with the IP address of your Kodi PC, given it a suitable name and assigned it to the correct room. You should have also noted down the KodiRemote device ID number and the device ID number for the Day or Night plug-in. We can now go back to Kodi and finish the configuration in there.

As I have four Kodi HTPCs I repeated this process and created a KodiRemote Device instance for each of the four Kodi PCs. To create further KodiRemote device instances, go to the APPS tab in Vera and select the KodiRemote plug-in and select the “Create Another” button.

image

6. Configuring the “Micasaverde Kodi Event” add-on settings in Kodi

System Settings – Addons – Enabled Addons – Services and its called “Micasaverde Kodi Event”
Now right click the “Micasaverde Kodi Event” add-on entry  and select Configure.

Micasaverde Setting:

You should have already entered your Vera units IP address, next in the XBMCState device ID setting, enter the KodiRemote device instance device ID number you wrote down in step 5.

And also enter the Day or Night plug-in device ID as well.

image

I also recommend you enter 5 in the “Debouncing ended video event” and” Debouncing ended audio event”.

XBMC State:

I’ve never actually used any of the features in this section of the settings, but you can have the “Micasaverde Kodi Event” add-on send status updates to Vera about which areas of the Kodi GUI are being accessed.

image

For example I just changed the “Menu Picture” option to YES. And if I then navigate in Kodi to the Pictures area of the GUI, then in Vera on the KodiRemote device instance I see the status has changed to “picture”

image

So presumably you could then use this as a trigger event in Vera to run a scene.

Player State:

OK Player State is the settings area we are really interested in!
I have “Video Title” set to Yes, this will send the title of the currently playing video to the KodiRemote device instance in Vera.

I have changed all the various video playback statuses to Night. This means that my scenes in Vera that control the automatic dimming and brightening of my living room lights will only happen if it is night time. More about these Vera scenes and setup will be covered in Part Two.

image

And again the same for the Audio (music) section I have the “Music Title” set to Yes and all the various playback states for music are set as Night.

image

Custom Menu Event:

I’ve never used this section of the settings, my guess would be that you can specify two additional Kodi Window IDs and have the status of those sent to Vera when you access those particular areas of Kodi.

For a list of Kodi Window IDs see the Wiki here.

After configuring all of these settings you may then want to reboot your Kodi PC.

image

7. Test your setup

That’s it for the configuration and setup in Part One. I recommend you now try playing some media content in Kodi such as a movie and a music album and then look in Vera at the KodiRemote Device instance, that is says UP and that the title of what media content you are playing can also be seen in the KodiRemote device in Vera. You can also try out the new playback transport control buttons for controlling Kodi from the Vera web UI.

image

image

Summary

In Part Two I will be looking at how to create Vera scenes and use triggers from the “Micasaverde Kodi Event” add-on and the various playback states of Kodi, for example to automatically dim and brighten Z-wave lamps based on Kodi’s playback status and if it is night time.

I am very happy to see that a new developer has picked up XBMCState and created KodiRemote based off it and hopefully we will see some new features in the future and support for Vera UI7.

As a final note- if you were previously using XBMCState, once you have created all your new KodiRemote device instances in Vera and connected them to each Kodi PC in the house, you can then go ahead and delete the old XBMCState device instances from Vera and then also uninstall the XBMCState plug-in for Vera, which is what I have done. You will then need to update your Vera scenes and triggers that were previously using XBMCState with the KodiRemote device instance(s). As I said I will cover this in Part Two coming soon.

Wednesday, 15 April 2015

Vera DLNA plug-in yet more integration with Kodi Media Center

I’ve written several blog posts in the past about different ways of integrating Kodi Media Center formally XBMC with the MicasaVerde Vera Home Automation system. Which you can see on the following links.

XBMCState – Allows you to run Vera scenes based on Kodi’s video or audio playback status.

Vera Home Automation – Kodi add-on for a GUI to control Vera from within Kodi (New development starting soon, hopefully!)

Kodi OpenElec / Logitech Harmony / Vera integration – Turns a bog standard Harmony universal remote control in to a remote that can control Z-wave devices and scenes that are in Vera via your Kodi HTPC.

Kodi IP Security CAM Overlay add-on – Allows for IP camera image to pop-up in Kodi, can also be integrated with Vera.

Send pop-up notifications to Kodi from Vera – Send notifications to Kodi via Vera scenes.

My latest article is about the excellent DLNA Media Controller plug-in for Vera, which you can read more about here. With this DLNA plug-in you can then control Kodi playback / transport controls from the Vera web UI. You can also control any other DLNA compliant media box.

Here you can see my Living Room room in the Vera UI5 web interface.

image

Here is the DLNA device I have configured to connect to my Kodi01 OpenElec HTPC in my living room. You can see there are some basic transport control buttons for controlling Kodi.

image

And here is another DLNA device instance in Vera for the Kodi02 PC in my bedroom

image

Another great feature of the DLNA plug-in for Vera is you can also then sent Text-to-Speech (TTS) announcements to Kodi Media Center. which was the main reason why I installed the DLNA plug-in in the first place.

Now I configured all of this a good while ago and may not remember all the steps for the setup, so I don’t think I will be doing a detailed step-by-step guide, however I will describe the basic setup method and post some screen shots of my settings. Also you can read my thread here on the Micasaverde forum where I was talked through the DLNA plug-ins TTS feature.

Install UPnP Event Proxy plug-in for Vera:

The DLNA plug-in relies on this UPnP Event Proxy plug-in which must be installed.
Firstly install the UPnP Event Proxy plug-in for Vera, the easiest way is to install it from the MiOS marketplace via this link here. Login to your MiOS account and select the Vera unit you want to install on to. The app will then be pushed out to your Vera unit.

I don’t recall having to change any settings to the UPnP Event Proxy device in the Vera web UI as it just runs a simple HTTP server on your Vera which listens for UPnP NOTIFY messages and forwards them on to another MiOS plugin.

image

Install DLNA plug-in for Vera:

Next install the DLNA plug-in for Vera, again install this from the MiOS marketplace via this link here.

Creating DLNA device in Vera:

When installing the DLNA plug-in via the MiOS marketplace your first DLNA device instance in Vera will be automatically created for you. To create more DLNA devices in Vera refer to the “Create Device” instructions on the MiOS marketplace here.

Kodi UPnP settings:

Next you need to check out the UPnP settings in Kodi Media Center, go to Settings –> Services – UPnP. I just enabled the option “Allow control of Kodi via UPnP”

image

You can create multiple instances of the DLNA device in the Vera web UI, one for each of your Kodi HTPCs for example. So you would also need to enable this setting on every Kodi PC.

Select your media renderer:

You will also have to then link your new DLNA device in Vera to a physical media renderer device aka your Kodi PC. Follow the instructions entitled “Select your media renderer” as seen on the MiOS marketplace webpage here.

DLNA Device tabs:

Control Tab – On this tab we can see the playback transport control buttons, you can also see I am currently playing a music track on my Kodi HTPC.

image

Player Tab – On this tab we see more details about the currently playing media, in this case a music album I am playing in Kodi. The transport control buttons can also be seen and used on this tab.

image

TTS Tab – On this tab you can manually send TTS announcements.

image

However you can also add them to your Vera scenes, for example on my Doorbell scene, when the doorbell has been pressed it will send a Google TTS announcement to each Kodi PC around the house that “There is someone at the door”.

image

Again if you are interested in the TTS side of things I’d recommend you read the thread I started about it on the Miscasaverde forum here as there were a few pit-falls from what I recall.

Settings Tab – On this tab you can see that this particular DLNA device instance is linked to my Kodi01 PC. Which is the HTPC in my living room.

image

In each room where I have a Kodi PC I have also created a DLNA device instance in Vera for that room / Kodi PC.

Help Tab – Not really sure what this tab is for? It appears to be listing some current information about what media content is playing in Kodi.

image

Advanced Tab – I do remember making some changes to some of the fields on this tab. For example in the name field this is where you name your DLNA device instance. You need to ensure in the IP and MAC fields you have the correct static IP address of your Kodi PC and also the network cards MAC address.

image

Device Options Tab – There isn’t any.

image

Also check out the advanced scene functionality here of the DLNA plug-in to see what else you might be able to do with it.

Summary

As I stated the main reason for me installing the DLNA plug-in was for the Text-to-Speech features and then being able to have the Kodi PCs make announcements sent from Vera scenes.

Having the playback / transport control buttons for each Kodi PC in the Vera web UI is handy now and again. However where I can really see this becoming useful is when Vera mobile apps like Authomation HD for Android start supporting the DLNA plug-in! You would then be able to have playback control over your Kodi PC in your Vera mobile app which would be more useful.

I have asked the question about Authomation HD support this? here.

UPDATE:

I have been informed that the latest beta version of the Automation HD app for Android does have basic support included for the DLNA plug-in. I was also told that the Authomation HD app development is currently on hold.

Here are some screen shots of the Authomation HD beta app on an Android tablet and the Kodi / DLNA device.

Music Playback - shows the album cover and I get metadata being displayed, such as track, album and artist name.



































Live TV Playback - shows the channel logo image.



































Movie Playback - there seems to be an issue with the DLNA plug-in in Vera not showing any metadata for videos that are played in Kodi, I will have to look in to this further. It seems perfectly fine for music playback however. In the screen shots below I was playing the movie title "300" but only a Kodi logo gets displayed and no metadata information about the movie title is shown.