I did this (tried everything you said above) and it ran a couple times, then quit, was sporadic, but still, the most success I've had among all code I've come across (so thanks for the hope!). One time, for example, it changed to profile 2 (my away) then when I disarmed, it attempted to change back to 1 (my home), but gave:
12:06:07 PM: debug Could not adjust Blue Iris Profile
12:06:07 PM: debug BI_Found profile 1
12:06:07 PM: debug BI_modeChange matched to Home
12:06:07 PM: debug BI_modeChange detected. Home
I also use separate users, for the same reason as you stated.
I already have this, so I'm good there... in the posts where you took some code (I've been following them very well, too!) a lot of people obviously don't run this externally encrypted (wow), so see my next response!
I am running Stunnel, would love a readme on adding a cert to BI! I thought you had a post that mentioned something about getting a legit cert for free from some site? I don't see that in your post... of course, that and not knowing where/how to setup the cert on my BI server (windows 10) is my hang up.
Ok, so it gets weirder. I created two new routines in Smartthings, 1 is "I'm back" which manually sets ST to home (disarmed) and another is "Goodbye" (or maybe those were already in there, ha, thought I added them, but now not sure, not too pertinent though). When I use those routines to push/change the mode, Blue Iris Fusion shows the profile as changing to the appropriate profile each time in IDE. I see in the BI log that it actually does connect, but it connects as anonymous. However, the profile doesn't actually change in BI. So, I set BI to require all connections (this will mess up a few of my motion things (I use a couple BI cameras as motion detectors in Smartthings), but I can fix that)) to require a login. Then, I unchecked "Secure Only" for authentication under WebServer in BI. Using the routine Arm (Away) or Disarm then gave sporadic results. The same with manually changing mode from the dashboard. However, now when I use the routines "Goodbye!" or "I'm back!" it changes the profile correctly every time. All four routines however report in the IDE. So, I'm getting somewhere. I want to keep Secure Only checked in BI since I use UI2 and I don't want the window to pop up (also want to make sure my login is secured externally) and I want to not have to login via the LAN (for my android monitor), but that is a bit outside of the scope of Smartthings. Anyhow, perhaps this extra info will help.
Goodbye! and I'm Back! routines use my phones as presense (geolocation in ST), so maybe they were already there.. been so long since I used them. BI's geolocation just never worked well for me, so that is another reason I wanted ST to change the profile as it has been 100% unless the servers/db were having issues.
I could be a little fuzzy on everything above because I was trying so many different things, but in a nutshell, to get local connections to work, you have to play around with BI (I'm currently running version 184.108.40.206 x64 as a service), I have a feeling this may matter for everyone, whether or not they use encryption. Go to Blue Iris Options, the Web server tab, under Advanced, make sure Secure only is unchecked and Authentication must be at the least set to Non-LAN only. One thing I am wary about, when I'm connecting to the web pages externally, even though I am using stunnel, I believe my authentication is still encrypted, but I am not 100% sure. I guess I'll have to get wire shark out... that being said, since it is using https and that is ALL I have (via the port I am using) punched open on the firewall, I feel a little better about that.