[ST Edge] Breaking boundaries: supporting Blue Iris motion alerts and Shelly wifi Motion Sensors

Thanks again for the explanation. Everything has been rock solid.

If you do spend any further time adding features, the ability to send a web request within the device would be the only suggestion I have to offer.

My DTH type devices always say “checking” in the dashboard presentation so absolutely love that I can see motion at a glance. I also appreciate that they all still worked even though I lost internet for about 15 minutes (I use them to trigger outdoor floods).

Thanks again and please let me know if there is anything else I can test.

1 Like

Let’s get you set up with the CLI. Then you can use that to install the updated driver. I don’t know why it wouldn’t be automatically happening as long as you explicitly selected that driver to install from my regular channel. I want to try and avoid disrupting your setup and having to recreate everything!

I’m going to assume you have a Windows machine for the instructions below, but Mac and Linux is also supported.

  • Go to this link to download the Windows zip file.
  • With Windows File Explorer, navigate to your Windows downloads folder and unzip the file (highlight the downloaded zip file and select Extract / Extract all from the menus at the top of the window). Here you can also chose where to extract the file, so I would chose C:\Users\<yourid>
  • Open a command prompt window (search for ‘command prompt’ to find the app)
  • Normally you are sitting in the C:\Users\<yourid> folder and hopefully this is where you extracted the smartthings.exe file to. If you extracted it to a different location, you’ll have to navigate to that folder first.
  • To make sure it is working type

smartthings -v

You should get the version info

  • Now try an actual CLI command and type

smartthings devices

Because you are running a command for the first time, it will open up a browser window and ask you to sign in to your SmartThings account and authorize access. Do that and then when it says you can close the browser, do so and return to your command prompt window. You should shortly see a complete list of all your Smartthings Devices (not just Edge!).

  • You’re all set. Reference this document for a list of all the commands you can use.

Please note that you CANNOT just double-click on the smartthings.exe file from the Windows File Explorer. It must be run from a command prompt window.


Some key commands you’ll probably want to use are below. Note that these are the ‘quick’ versions of these commands, which will then prompt you for any additional input needed like, selecting which hub, which driver, which channel, etc. As you get proficient, you can provide those inputs as parameters on the command line. Just reference the document above.

List installed Edge drivers:

smartthings edge:drivers:installed

Start logging:

smartthings edge:drivers:logcat

Install (or update) an Edge driver:

smartthings edge:drivers:install

Uninstall an Edge driver (you’ll need to delete all devices first):

smartthings edge:drivers:uninstall


EDIT: Some additional info as you try to update your driver…

I’d recommend opening a second command prompt window and starting logging for the driver in question there. That way you’ll be able to see what’s going on as you issue commands from the first command prompt window.

Once you’ve started logging, confirm which driver is installed by checking the version info back in your first window. Then you can try to install the newer driver. Just be sure to select my shared projects channel (ID=e6e29aeb-2793-4ebf-b8f6-e37b69e32c61), and the LAN Motion driver (ID=e8a1a0b7-32e4-4882-8d38-45a96ead543d) when prompted.

Keep an eye on the log output to make sure the install doesn’t get hung up on repeating cosock errors or just hangs. If that happens, you could try rebooting your hub. You’ll have to stop and restart logging if you do this, as it won’t automatically resume when the hub is back up. So Ctrl-c out of logging, reboot your hub, wait a couple minutes to let your hub restart, then start logging again. You’ll be able to see if the driver is quiet (that’s good) or if it is still in an endless re-install loop. If none of that is successful, then at that point I’d say you will have to delete your devices, uninstall the driver, and install it again. Wait a minute between uninstalling and installing.

4 Likes

That all worked perfectly. Driver updated and devices still properly working. Thank you again for all the work and assistance!

2 Likes

Couple of questions. Is this method going to work even when the IDE is deprecated? Currently I only use BI Fusion for motion alerts as I don’t do much with profiles at the current time (continuos recording in BI).

Second, for us that are a little green at this depth of SmartThings, any chance of a step by step walkthrough (complete with screenshots for the slower among us) for getting this up and running on our hubs? They were a tremendous help in BI Fusion and I think it would appeal to a broader group. If I had the chops to understand it all thoroughly I would make them myself and share, but alas it’s Greek to me for the most part.

Hi there. Yes, this approach is all centered around the new Edge platform (still in beta) and has no dependencies on the legacy stuff (IDE/ Groovy).

I can definitely look at beefing up the instructions. Have you read the ones here?

Admittedly, the full how-to is split between the bridge server app and the LAN Motion driver since they are two independent things, but when used together, provide a solution for local BI motion alerts. Probably between @netcsk and I, we can put a complete how-to together in short order.

2 Likes

I wrote a little something here:
[RELEASE] BI Fusion v3.0 - Adds: Blue Iris Device Type Handler, Blue Iris Camera DTH, Motion Sensing - #500 by netcsk?
It also links to another post with some BI specific commands, which probably just solidifies that it would be helpful to make a guide.

1 Like

Yes your post is how I stumbled on this haha. I haven’t tried running this method yet, mainly because from reading the install I am not exactly sure what I will be doing (again, that’s a me issue, not a dev issue). BI fusion was fairly straight forward with the guide. I remember a couple hiccups but didn’t struggle too much with them. Still plan on giving it a go, but like all kids pictures (screenshots) help me a ton lol

@TAustin it appears yesterday’s firmware update broke my motion sensors with all of them showing offline. A hub reboot did not help. Is there an easier way you know of to get them back other than deleting the devices, driver, and setting them back up?

Is is possible that the IP address of your hub changed?

Here’s what I would try:

Go in to the device settings for your SmartThings motion device(s) and temporarily change the bridge address to something else (wrong) and press OK. Wait a couple seconds, then change it back to what it should be. That will force a re-registration with the bridge server, which might be needed if the hub rebooted. Watch the bridge server log output for any errors.

If the above doesn’t work, I would restart the bridge server, then perform the steps above again.

Let me know if that gets things going again.

That worked perfectly. No hub IP changes (static IP and I confirmed the lease). Thanks!

1 Like

@TAustin, I really love this solution and I was wondering if you thought about expanding the functionality at all? I’m not sure how Shelly (or other brands) might benefit, but it would be amazing if this driver could handle an outgoing web request too.

There is a use case where I have an non-camera motion detector that I want to trigger my BI cameras. From user perspective, its easy to have a device state trigger your motion detectors but nothing makes it back to BI. Currently, I use the web requestor to do this but it would be fantastic if it was built in.

I also understand the LAN devices have had some changes in architecture so maybe we wait until we are out of beta.

Thanks again for all the fantastic work you do to support the community!

Just a thought, but is MQTT an option you’d consider? I’m working on some new solutions in this area at the moment, and since you want two-way messaging with your Blue Iris server, this might be a better overall fit for what you want to do.

What exactly are you thinking here? From your description it sounds like these would be two separate motion devices in SmartThings - one triggered BY your camera (what you have today), and the other that would send a trigger TO BI (new). So I’m assuming you’re looking for one driver that would support both scenarios? It’s certainly possible, assuming BI supports an API for incoming triggers like that. You’d have to point me to some documentation.

Tod, I do appreciate your willingness to ask for more details. To be honest, mqtt sounds amazing but I don’t know that I have capacity to learn a new language and hardware.

As far as BI http documentation, it’s fairly thorough, page 225.

Below is the url for triggering active and inactivr of a camera:
http://192.168.50.111:1234/admin?camera=CAM7&trigger=-1
http://192.168.50.111:1234/admin?camera=CAM7&trigger=0

For some reason my web requestor driver doesn’t have a menu any more so I can’t access my settings to give more examples. Let me know you need more and I’ll reinstall.

Thanks again for what you do for this community!

It may be simpler than what you are thinking. If you know how to install packages onto your BI server, I’m sure you could manage. The MQTT is kind of a load and forget kind of service. But I do appreciate the fact that it’s one more thing to deal with!

Can you elaborate? You mean you literally don’t have the three vertical-dot menu in the upper right of the device Controls screen?

We’ll figure out how to get you back up and running. Those two http requests should be super simple to get working if that’s all you really need.

So I should have taken a screen shot but it’s fixed now. So I had no status info or menu dots. I hade a couple hug resets last night that may have done it. If it was you, thanks yet again :grin:

Please let me know if/when you need me test.

Can you now add those two http requests in available slots in web requestor device Settings?

e.g…

Web Request #3
GET:http://192.168.50.111:1234/admin?camera=CAM7&trigger=1

Web Request #4
GET:http://192.168.50.111:1234/admin?camera=CAM7&trigger=0

I can, yes, so any urgency on the motion sensor has passed. I’d still love to see a way to have those calls within the motion sensor and not use an automation slot.

Thanks again!

1 Like

I had the edge driver together with the edge bridge working great on my blueiris setup
Edge bridge server is running on same PC as Blueiris.
I was getting motion alerts from blue iris in smart things reliably.
Suddenly, for reasons I don’t understand I can’t send any web request/mqt alert via blue iris to edge bridge. When trying to do so Blue Iris reports “web: error no stream” usually with either a 400 or 12029 code after.
No clue what changed

I’ve not seen that error before.

I take this to mean that nothing is making it from Blue Iris to the edge bridge; i.e. you are not seeing anything being received from Blue Iris in the edge bridge console log?

It sounds like some kind of TCP communications glitch within your server. I don’t know what OS you are running on it, but if Linux, have you tried restarting the networking service?

I would probably first try to restart your Blue Iris server, and if that doesn’t clear it up, restart edge bridge, and if that still doesn’t solve it, reboot your computer.

I am seeing some activity within edge bridge.
I’ll have to look tonight what it said again
I believe something like “bad argument”
It’s windows 10. I’ve updated windows, blue iris, rebooted multiple times, rebooted entire network including router and POE switch.
I’m at a loss.
Is there a way I can test it from outside blue iris?
Like a way to send the same request that blue iris should be doing but isn’t apparently.