Setting schedules via MQTT?

Stortota

n3wb
Apr 28, 2018
3
3
Hi there!
Just purchased the full license and I'm really pleased to see the MQTT-implementation. I've been browsing the settings for some time now and haven't found any setting that makes it possible to use MQTT-topics to change schedule.

The use case is that my home router detects if any trusted mobile devices are at home. If no such device is present, a MQTT payload is sent to indicate no presence. When one of us get home and is connected to the router, the payload reports the presence. I would like to use this message the turn off indoor recording when we are at home.

Is it doable?
 
  • Like
Reactions: carter
By the lack of response, I reckon the potential of MQTT is not obvious to most people. So, what is MQTT? It's a very lighweight protocol that can be used to send easy commands over less than perfect connect between multiple devices. IBM was involved in the development to enable its future IoT-ambitions so it's not just any arbitrary enthusiast protocol. Here is a 5 minute video that explains the basics:

I am using a Raspberry Pi as Home automation bus (Software: OpenHAB) and i run a MQTT broker on the same machine (Software: Mosquitto). By adding various USB-dongles to the RPi, you can easily control your connected home. I use Bluetooth, Zigbee (Ikea and Philips lights + more) and Z-Wave as protocols for now. On top of that, I have MQTT and HTTP-bindings that can receive and send information and commands.

Now, what good is this for Blue Iris users? Let me give you a couple of example of how MQTT can be used together with BI:

1) Rather than using a good old infrared motion detection sensor to turn on lights etc., you can have your camera detect motion for you. When your driveway camera detects motion, a MQTT payload is sent, and as a result driveway lights are turned on and after a few seconds, some indoor lights ar turned on too. When your porch camera detects motion, you can turn on even some additional lights or maybe your Smart TV. By doing so, you can simulate home presence in a much better way than just using motion triggered flood lights.
Tl;dr: The cameras publish MQTT-messages on certain events and the home automation system picks up these messages to carry out actions.

2) If you use a connected smoke alarm, you can have the home automation system broadcast alarms via MQTT and thereby trigger indoor cameras to help you see if there is a fire or if it's just your trusty old neighbour, burning trash in his backyard. You maybe don't want to have indoor recording turned on by default and by doing this way, you can be sure to follow important events at home.
Tl;dr: The home automation system publish MQTT-messages on events that is picked up by Blue Iris to control cameras.
 
I'm just starting to learn about MQTT so I can't offer anything on that front. But if you're looking for a way to change your BI profile* (e.g., to a profile that won't record on your indoor cameras), then you can send a http command in the format of:
http://IPADDRESS:PORT/admin?profile=x&lock=y [Set the active profile to x. Use x=-1 to toggle the lock status, or set the lock=y, 0=run, 1=temp, 2=hold]
[This is from BI's built-in help, "The Web Server" section]​
There are many other useful commands that you can send from your home automation server (e.g., when a sensor is tripped, then start recording your outdoor cameras).

I also found this thread helpful so that I don't need to send my username/password in the clear:
Only Sent Out Email When Alarm Is Set


*You mentioned changing "schedules" but I assume you meant "profile." In any case, the help file lists ways to change schedule, too.
 
You're right, it's the profile I'm looking to change and the http-way might be a way to solve it. The downside, compared to being able to change it via MQTT is that another step (and another component) is required. MQTT-devices have to possibility to act on payloads without any intermediary. Thanks for the reply.
 
You're right, it's the profile I'm looking to change and the http-way might be a way to solve it. The downside, compared to being able to change it via MQTT is that another step (and another component) is required. MQTT-devices have to possibility to act on payloads without any intermediary. Thanks for the reply.

You can use MQTT to change profiles. Enable MQTT in Blue Iris Options and publish something like this:

Topic: BlueIris/admin
Payload: profile=x&lock=y

Note: I've had pretty severe stability problems with Blue Iris since enabling MQTT. I don't know if it's the MQTT piece or something else, so it is currently disabled.

Anyway, from BI's help:

MQTT is quickly becoming the protocol of choice for communication among IoT (Internet of Things) devices. Configure your MQTT server by using the MQTT button. The software will listen for any topic matching BlueIris/#, currently only BlueIris/admin is expected. When a message is received on this topic, the message payload is parsed and processed exactly as if it were received via the web server following /admin?. Example payloads are "signal=0" and "camera=cam1&trigger".
 
You can use MQTT to change profiles. Enable MQTT in Blue Iris Options and publish something like this:

Topic: BlueIris/admin
Payload: profile=x&lock=y

Note: I've had pretty severe stability problems with Blue Iris since enabling MQTT. I don't know if it's the MQTT piece or something else, so it is currently disabled.

Anyway, from BI's help:

MQTT is quickly becoming the protocol of choice for communication among IoT (Internet of Things) devices. Configure your MQTT server by using the MQTT button. The software will listen for any topic matching BlueIris/#, currently only BlueIris/admin is expected. When a message is received on this topic, the message payload is parsed and processed exactly as if it were received via the web server following /admin?. Example payloads are "signal=0" and "camera=cam1&trigger".


I just enabled this, I have home assistant with node red and mqtt, do you know how to configure mqtt to send commands to BI? I am using ssl in my MQTT server.