Blue Iris to trigger TP Link switch

After a recent theft of a couple of my bikes from my back porch, I would like to get my BlueIris to turn on my TP Link light switch upon motion detection. I have both BlueIris and TPLink components set up in my Hassio setup (video feeds from BlueIris). I also have an MQTT server set up in Hassio. I’ve seen a few threads discussing automation using BlueIris, but haven’t seen anything directly addressing in simple terms my simple needs. Can anyone point me in the right direction with a tutorial or thread? Thanks.

You could do a simple automation like this
The binary_sensor.front_motion is my BlueIris MQTT that detects the motion.
And the garage_light is the light in the garage.

- id: '1580704402821'
  alias: Front Motion
  description: ''
  - entity_id: binary_sensor.front_motion
    platform: state
  condition: []
  - entity_id: light.garage_light
    service: light.turn_on

You can poke around in blue iris to configure the mqtt reporting for alerts. There is a blue iris HA tutorial:

If that helps prevent bikes getting stolen then it’s worth it. However depending on where you live, if you are depending on local law enforcement to recover stolen bikes, they won’t be interested at all in the videos, let alone the crime in most cases. In that case it’s better to keep the bikes inside, or get a good lock for them.

I’m interested in doing something similar. What’s the delay between the Blue Iris motion detection and the light turning on?

I actually ended up setting it up with IFTTT and webhooks. No noticable delay that I am aware of. Of course, for my use case, immediacy isn’t crucial. I know that this won’t prevent theft, but hopefully it will discourage a crime of opportunity. I’m also locking the bikes now (which foolishly, I had not been doing. I had locked them at first, but got out of the habit, with no consequences for at least 4 years. But now the replacement bikes will stay religiously locked).


The exact speed depends on several factors. The camera has to first process video, then send mqtt to the broker (to ha). For most decent ipcameras this happens almost instantly (30ms ish). From there, ha must process the mqtt message and execute some automation. Generally ha will also respond very fast, but again how fast depends on resources of the machine (30msec ish). Most ha setups are ‘light enough’ to give this very fast response even with a pi3.

Otoh, if that pi is also handling an intensive task like video management (security cam storage/processing) then any process, including responding to mqtt with automations, will be delayed… often to the point of not being useable for things like lighting.

I have a separate pc handling vms duties (blue iris), and a pi4 for ha… video motion automations have an average turnaround well under 100msec (about 60ms is from ha, zwave, etc all stuff that happens after ha gets a message). That makes it very useful for almost any application; plenty fast enough for lighting.

The trick with video based automations is getting your triggers setup properly for the location (usually the cameras have powerful triggering options built in, and BI has some useful triggers as well). You end up doing things to filter random stuff like moving shadows etc… which often results in a ‘positive’ being triggered some time after the ‘subject’ is in view of the cam. Tuning these ‘triplines’ and ‘active areas’ reduces latency and false positives… good cams have lots of other settings you can tune to help too (like object size and direction… super reliable for guarding walkways and driveways where subjects always move along some axis). So it is good to keep these features in mind when building a system.

1 Like

It does suck to be reminded the hard way, but that is human nature nobody enjoys being worried and locking up stuff… so if we can get by without then we do. Cameras are a great deterrant… just make sure they are easily visible. I saw some of my daughter’s classmates doing some silly stuff (TP’ing our trees) and heard one of them ask another (via camera microphone) ‘are there any cameras?’, to which the other answered ‘no’, oops! Lol no harm was done other than a very embarrassing cleanup for those boys the next morning.

My cameras are not hidden at all. After that I put in a lawn sign to make it more obvious. That said, I do think professional criminals won’t miss the cameras, and will take careful note if they are professional quality units… so far they haven’t even tried. A next door neighbor without cams got hit by pros, and those guys seemed to know to avoid my LPR camera (that is aimed partially in street in front of the neighbors home). Those are the guys that make us spend so much on security. If they win, we loose A LOT as they drive off with a moving van full of our stuff (far worse than a kid riding off with a $1000 bike and a $300 xbox under their arm… just as infuriating but far more painful).

Wow, appreciate the time and thorough answer!