Archive for January, 2018

Plex switch

Posted: January 20, 2018 in Home Media, Plex, Watching
Tags: , , ,

The current Kodi – Emby setup has been working well until recently. For some reason, the Kids profile is now refusing to play back certain files that work fine in the main profile. Other files play without issue in both profiles. I’ve also had the Emby client not working properly on the Roku boxes. Stuff has played on one Intel box that then refuses to play on the other one… even though it’s more powerful. With kids wanting to watch their stuff, having to troubleshoot which of their shows does and doesn’t work became increasingly frustrating.

Emby had been our default choice for one simple reason – it allow me to build profiles that meant the kids could have their stuff and just watch it. The non-kid friendly content was under a different profile. While this functionality was available in Plex, it cost money.

With a mix of self-built Intel platforms & Roku boxes, the need for a central server to handle synchronisation duties between all devices is critical; trying to juggle which particular episode of Pokemon the kids have watched is a full time job! Using Plex on the Roku and Emby on the Intel has been the work around, but this means trying to manually update both Emby and Plex watched statuses.

As part of the Black Friday deals I finally succumbed to buying a Plex pass… and a lifetime one at that. I mostly bought it to get access to the live TV and PVR capabilities allowing me to retire the TVHeadend Server that I never could get to work in the way I wanted.

After another episode – the Emby app crashed on the Roku3 – I decided to see what the actual front end Plex client was like. Initially I built a ‘simple’ RaspberryPi based Plex Media Player (PMP) to see how it could work and to see what the experience was like. Installation was simple and I was surprised to see that it was based on the same LibreELEC platform that we use for our Kodi players. The plan was to use the RPi in the playroom and see if the kids were happy with using it before thinking about updating their Kodi player.

After a ‘play-date’ with a room full of kids wanting to watch TV and the same issue of films NOT wanting to play – that was a happy 10 minutes – I finally decided to scrap their Kodi installation and install the PMP client. It’s an old NVidia Ion Atom board, so nothing huge, but runs 1080p content without issue and is speedy enough with a 30Gb SSD. The PMP installer did it’s stuff and within 10 minutes we had a working player. The only issue was that it wouldn’t detect my local Plex server automatically – it kept trying to route out of the house to Plex and then back again. Manually adding the local server IP address soon fixed that issue.

The kids are happily using the PMP client without issue on their box.

I should add that the issue has never been with Kodi as far as I can tell – it has always been with the backend Emby infrastructure – either the Roku app wouldn’t start or if it did it wouldn’t play back content. On the other side the Kodi plugin fails to play content under one profile that plays perfectly under another on the same device. Using the direct path capability was how it was originally setup, but this kept failing, so the only way to play stuff was through the plugin.

I can’t say that the the issue doesn’t lie with me using Emby as a Docker container on the unRAID platform and these issues aren’t related to this additional complexity, but all I know is that I run Plex the same way and it hasn’t caused issues yet.

After a couple of weeks running PMP on the kids box, I’ve also now migrated the main lounge player across to PMP as well. My biggest niggle about using the box is that the Harmony remote can no longer shutdown the box. I have to manually shut down before using the power off command to turn the rest off.

I felt bad moving away from Kodi – I’ve been using it in some form or another since the original XBMP on the first gen XBox – complete with Mechwarrior 2 hack to install it! I do miss the skins – the Plex interface is functional, it’s not pretty. I just don’t have the opportunity to debug/fix stuff when the kids want TV.

Advertisements

Xiaomi Smart Home

Posted: January 6, 2018 in HA, Hardware
Tags: ,

The OpenHAB community have been taking about Xiaomi and the raft of components that you can get relatively cheaply (even cheaper direct from China!). It’s ZigBee based, so it shouldn’t interfere with current devices.

I’m not keen on the idea of adding another hub/gateway to my setup, but for roughly £20, it might be worth a punt. I always tell myself that “worse case I can sell it on eBay”. Never actually happens though…. So AliExpress and GearBest both list the gateway, but the one on GearBest appears to be the 3rd generation. From reading the notes on the OpenHAB documents and forums it seems that gen 2 or later is supported. AliExpress may have the gen 2 and gen 3, but as all the suppliers use the same stock photo, it’s quite difficult to see. Being Christmas, there’s a sale on, so I’ve also picked up a button and 2 door sensors. Total cost ~ £30 with shipping.

Let’s be honest I couldn’t get 2 Z-Wave door sensors in the UK for that price!

The downside to all this is the time for delivery. I ordered the kit on 21st December and it finally arrived on 4th January. Not long really given the Xmas holidays, but I get impatient waiting for new toys!

Unboxing

When the parcel finally arrived, it contained 4 small white boxes. The largest – probably 10cm a side contained the new hub.

IMAG0470

Xiaomi Smart Hub with UK Adapter

The other 3 were the same size, each containing a device.

Each box also contained a small instruction leaflet in Chinese, and if appropriate some spare double-sided tape to mount the device.

The Hub includes a LED ring for light effects, an ambient light sensor as well as a speaker. The idea is to plug it into the wall socket somewhere central and use these features as part of the whole home solution.

Installing

The installation of the hub and devices is a little ’round-the-houses’, but is outlined in the OH documentation here.

Slightly disconcerting is the female Chinese voice bellowing out of the hub when you try to add devices. Once you jumped through the hoops of adding the hub to OpenHAB, any new devices appear in the Inbox for inclusion. As per the binding documents, I’ve blocked the hub from any external access. It means I can’t use the app, but I don’t need it as OH handles it all for me.

Using in OH

One of the things that took me a while to figure out was the alarm timer channel for the door sensor.

Number DoorSwitch_AlarmTimer <clock> { channel="mihome:sensor_magnet:<ID>:isOpenAlarmTimer" }

This value needs to be set on the hub by OH and determines how long the door should be in an OPEN state before the ‘isOpenAlarm’ switch to be triggered. I believe it’s currently defaults to 300 seconds, but I recommend experimenting.

In my rules I set the value on system startup

sendCommand(DoorSwitch_AlarmTimer,120)
or in the newer format
DoorSwitch_AlarmTimer.sendCommand(120)
So the alarm will trigger if the door is open for more than 120 seconds.
I’m happy with the kit so far, but finding somewhere to put the hub is an issue – it only comes with an integrated plug for use in China, so a China -> UK adapter is needed, which adds to the height of the device. With an adapter it is now about 15cm high, so far too big to just plug into the wall!

Next Steps

I’ve got a couple of Z-Wave Fibaro motion detectors that also supply temperature and humidity info that go through batteries at an incredible rate. To be honest, the temperature and humidity data is more important that the motion sensor, so I’ve ordered a couple of temp & humidity sensors to replace them as well as 2 more buttons.

 

FYI – These devices are NOT always CE certified for use in the UK, so using them is at your own risk.

Links:

https://xiaomi-mi.com/sockets-and-sensors/xiaomi-mi-gateway-2/

https://docs.openhab.org/addons/bindings/mihome/readme.html