Sunday, 17 January 2021

User Presence Detection using Node-Red and Unifi


A big challenge in Home Automation is implementing a reliable mechanism for presence detection - figuring out who's home, and tailoring logic accordingly.

Here's how I do it using Node-Red, Unifi and MQTT.

Many approaches to presence detection rely on interacting with the device itself, either by way of software running on the mobile handset, or having the mobile ping or poll an external service. None of these approaches really appealed to me as they are fiddly, rely on handset configuration & maintenance and need to be reset every time someone gets a new phone.

The approach I've taken here is to rely on the fact that all the families' mobile phones are configured to connect to home WiFi (to save on data charges!). This method interrogates the home network to see what phones are present - a good indication that the person is home.

In short, I have a Node-Red flow that polls the network on a schedule, looks for named devices, and updates presence status in MQTT based on that.

I could have used a database, or flat file storage for storing state, but as I have an MQTT broker running anyway, it's a convenient and flexible approach for me.

Monday, 14 December 2020

Maybe the best gadget I've ever bought?

 

Fairly insidiously, Amazon has taken over my house.  I now have various iterations of FireTVs connected to each TV, and almost every room has an echo device.

I'm not complaining really, these are great pieces of technology, and voice control is a lot more useful that I would have envisaged a few years ago. 

And the FireTV is excellent - easy to use and supports everything I use on a regular basis; Netflix, Kodi, Spotify, Emby Amazon Video and more. However, there's one thing that' been bugging me -  it's lack of true bit-streaming of extended sound formats. I use Kodi quite a bit for my media library, and there are many titles in there with fancy surround formats that just don't make it out to my AV system unscathed.

This is only an issue in my Home Cinema which has a full 7.1.4 system that can make best use of such soundtracks (everywhere else is plain old stereo).

I've been reading about the nVidia Shield for a while and finally bought one to see if it could replace the FireTV in this room. Here's how I got on with it...

Sunday, 13 December 2020

Marantz / Denon IP Control in Node-Red

I'm enjoying my recently acquired Marantz AV8805 processor which is now the heart of my Home Cinema. My previous trusty SR7010 receiver is still working hard as a power amp, driving surround and height channels.

One of the challenges of running in this kind of configuration is that both units respond to the same remote control signals. I have switched off remote receiving on the SR7010 as I just want it to behave as a power amp. However, as the 7010 has no trigger inputs (alas, only outputs), the problem remains of how to power up the SR7010, and power it down, in tandem with the AV8805.

Here's the end result;


Here's how this was done in Node-Red....

Saturday, 5 December 2020

Set up Sky Fibre Broadband with Unifi USG

I recently moved from eir to Sky for TV, phone and broadband. My old eir modem supported bridging which allowed it play nice with my USG and the rest of the Unifi network. Unfortunately, the Sky modem does not support bridging. The usual advice online is to eliminate the Sky hardware and add a dedicated modem such as the Draytek V120. This is not an option for me as I'm also subscribing to Sky Talk, and that passes through the Sky modem.

That leaves only one option: configure the Sky modem with DMZ pointing to the USG WAN IP address. The downside is that this setup introduces double NAT which may impact some gaming setups, port forwarding etc., but it's the only way I could get interoperability...

Thursday, 26 November 2020

Configure Eir F2000 modem with Unifi USG

So I don't forget (again) ....

Having implemented a Unifi network infrastructure that's solved my home WiFI problems and introduced a degree of structure and security to my network, I wanted to document how I'd configured my service provider all-in-one modem/router to act as just a modem in front o the Unifi USG that handles or hands off everything else.

The first thing to note is that, once this is set up, it won't be possible to access the ISP modem interface from inside the network. (well, actually, it might be possible, but I was too lazy to figure out the required routing rules and configuration, so I just connect up as outlined below).

My setup sees the incoming DSL line connected to the F2000 as usual. My EirTV IPTV box is directly connected to one of the F2000 LAN ports. Another patch cable runs from another F2000 LAN port to the WAN port on the USG.

When I need to configure the F2000, I connect a laptop directly to a third LAN port. It shows up in the network of Windows 10 as follows (other OS may vary);


Friday, 17 July 2020

Problems passing through GPU to an unRaid VM?

One of the most common problems I see people seeking help for on unRaid forums, reddit and discord is the thorny issue of GPU pass-through. People with the same problems tend to ask the same questions over and over, and, somewhat tired of providing the same troubleshooting steps over and over, I thought I'd write up the main pitfalls, and possible solutions.

Here are some steps to check before reaching out for help.

1. Have you done your research?

As noted, there's a ton of threads on unRaid forums covering this, many successfully resolved. Do conduct a search there. For example, searching 'problem with gpu passthrough' today produces 40 pages of results. Chances are, your issue has been raised and resolved several times before.

Another oft-posted remark is something along the lines of 'I followed spaceinvaderone's video, and it still doesn't work'.

In most cases where I've seen this, the user has incorrectly followed the video - missing a key step or subtle point. This is NOT a straightforward process. There are many variables involved and SpaceInvaderOne's videos are packed with information. He does an amazing job of explaining the complex process step by step, so make sure to rewatch these videos several times to ensure you haven't missed anything.

If you haven't been following one of his videos for GPU pas-through, why not? Get very familiar with the process and follow along before posting queries;

Here are some links to his channels;

Research done? Let's look at some of the common missteps....