Archive for January, 2016

Emby Server

Posted: January 28, 2016 in Home Media
Tags: , , ,

As someone with several Kodi boxes floating around the house, I had always wanted the ability to synchronise both my library and my view state across the boxes. When this capability was introduced by using a central MySQL database I was happy – especially as it meant that rebuilds on low power devices would no longer taken hours as the entire library was rescanned.

Moving to unRAID 6 with it’s Docker eco-system made it even easier – no longer manually installing and maintaining the DB somewhere. Just install a MariaDB container, set up the user and off you go. I still needed to scan for new content on one device and update the DB, but at least it was on only one and not on all of them.

Migrating to newer versions of Kodi could still be an issue if the DB structure changed, but again, once the library was re-scanned by one machine, it was available to all the others.

Enter Plex

For various reasons – mostly that I had a couple of white NowTV boxes hanging around – I also installed Plex as a plugin on the unRAID 5 box. This was a much nicer experience than managing my data via MariaDB – using a central system with a nice GUI that then managed my library across multiple devices meant I could check the metadata and ensure that I had the right artwork. The trouble was I was now maintaining two systems, one Plex for a NowTV box and my work laptop for when I travelled and then ‘normal’ Kodi DB for the main playback machines. Replacing the playback machine with NowTV wasn’t an option – at that point they were wi-fi only and that wasn’t helpful. A small Plex OS install wasn’t available and I wasn’t going to install a full distro just to get Plex.

The Plex-XBMC plugins that were available didn’t seem to work properly – playback on one device wasn’t resumable on another and viewing history wasn’t always up to date. I also ran profiles on my system – the tv and films are split into stuff for the Kids and everything else. That way I can give the kids access to their stuff without worrying that they might decide to watch Alien or Kill Bill. While Plex eventually introduced this, it was a paid for option and it wasn’t enough on it’s own to justify the cost. With the retirement of the NowTV box, Plex became an unnecessary overhead and was shutdown.

Enter Emby

I’d played with Emby when it was MediaBrowser, but it was a little unstable and didn’t really offer anything new to me, so I left it alone. With the introduction of an Emby plugin that basically replaced the local Kodi library with a fake one that was fully populated from the central server, Emby became an important part of our setup.

Emby server runs in a Docker container on unRAID 6. It parses and manages the library providing metadata, art work and playback history that is then sent to each Kodi device at start up. It also includes profiles so I can map the local Kodi profile to a user on the Emby server and restrict access to content.

Rebuilds and updates are easy in that I have to install Kodi, install the Emby plugin and point it at the server and all my content is available for playback. This also means that I can run different versions of Kodi and point them at the same Emby server… making it much easier to update. I’m not updating several boxes at the same time to ensure that they all work with the new DB.

The one thing I DON’T allow Emby to do is handle playback – I deliberately tell the system to use the native file path for playback – and not to go through Emby. That way I’m not wasting resources on transcoding or double handling the files.



Emby Add-on for Kodi


VortexBox re-appears

Posted: January 14, 2016 in Hardware, Storing
Tags: ,

So I rebuilt the Vortexbox CD ripper last weekend… A few new CDs appeared over Xmas, so I needed to get them on to the Sonos so I could listen to them at home, not just in the car.

Last time I looked at VB it was on version ~1.5, but the current version is 2.4. It has also moved from an .ISO format to a USB installer (good news).

Trouble is that no matter what I did I couldn’t persuade the old Intel Atom board to boot into the freshly installed VB. I initially assumed that the issue was due to re-cycling of HDD – perhaps the MBR was corrupted: all the usual things that happen when you swap between OS installs. Even with a completely blank HDD (gparted rocks) it still jumped happily through the install process and then reported that ‘no boot device is present’.

Several other people reported similar issues and it looks like the hardware won’t accept a gpt boot partition, so it can’t see that it exists and so it constantly reports that no boot device is present.

The forums also reported that you can append ‘nogpt’ to the install boot params, but that didn’t work for me either. Having wasted enough time on reboots & reinstalls I eventually I found an earlier  v2.3 in .ISO format that I could copy to USB and that did work.

Repurposing Wireless Doorbell Button

Posted: January 14, 2016 in HA, Hardware
Tags: , ,

Because I found myself turning things off or down when I went to bed, I added a simple button on the OH app to run a very simple script to turn off lights and arm the motion detectors. Once I got my head around the heating API I also added calls to turn the heating in certain rooms to night mode.

This was all great, but I still had to go through the hoops of finding a device, opening the app, and pressing the button. I wanted a physical button to do this!

Enter the Nexa Push Button (LMLT-711) from Clas Olson. This is a 433Mhz device that is designed to work with various other Nexa doorbells. BUT as it is 433Mhz, and Nexa is supported by the excellent RFXCom plugin on my Veralite, it should work.

Other Nexa items – several temperature/humidity sensors have al worked perfectly with the Vera and are happily reporting from around the house (and they are a LOT cheaper than the Z-Wave equivalent).

Anyway although the device is supported and appears in the Vera console, pressing the button seems to trigger the ‘group-on’ button that automatically ties itself to Scene 100. Trouble is that scene 100 doesn’t exist… and I’ve never figured out how to create a specifically numbered scene!

Screen Shot 2016-01-14 at 09.07.32

Trying to create a new automation scene and then change the scene that gets triggered didn’t work either; it just reset back to 100. This meant that I couldn’t do much in Vera and then even less in OH.

Anyway – after discussions with Guessed & Lolodomo on the OH forum I figured out a way around the issue.

1. Connect the Nexa doorbell button to the Vera (device #134)
2. Create a virtual switch in Vera (device #140)

Screen Shot 2016-01-14 at 09.07.47

3. Create a new scene & trigger in Vera – the trigger is tied to the actual Group On/Activated event from the doorbell button. When it is triggered it runs the follow LUUP script:

status = luup.variable_get("urn:upnp-org:serviceId:VSwitch1","Status", 140)
 luup.call_action("urn:upnp-org:serviceId:VSwitch1", "SetTarget", {newTargetValue = "0"}, 140)
 luup.call_action("urn:upnp-org:serviceId:VSwitch1", "SetTarget", {newTargetValue = "1"}, 140)

This basically toggles the state of the virtual switch…. an event that I can detect and use in OH very simply.

Switch Bedtime "Bedtime" (gSettings) {mios="unit:house,device:140/service/SwitchPower1/Status"}

4. When OH Bedtime is ‘ON’ – run the script….

I currently just use a timer to reset the switch back to ‘OFF’ after 30 minutes, it doesn’t do anything, just changes the status of the switch across the different devices so it’s ready for use the next night.

Alternatively I could get it to run ‘wake up’ events instead – push on at night and then push off in the morning, but I’ve not really thought about what I could do until now…..


UK Clas Olson Nexa button – here