Anyone try to set Macro Text via URL?

danbutter

Getting the hang of it
Joined
May 28, 2017
Messages
139
Reaction score
47
Trying to do this:
/admin?macro=x&text={text} Set macro number x=1-9 to value {text}
but can't seem to get it to work.
I am trying to get my own weather station to display over one of my cams. Right now I use BITools to do this, but would like to get it to show my own weather station. Using an ISY from Universal Devices and trying to use their network resources to post the info to BI. Doing so returns an 200 code which as I understand means successful, but I don't see the Macro change on the Camera.

Anyway I have also tried to get this to work via browser and it says Authorization required.
I have tried the http://USER:PASS@192.xxx.xxx.xxx as well as the
http://192.xxx.xxx.xxx:81/admin?macro=x&text={text}&user=admin&pw=adminpassword

I have authentication from Non LAN only set in BI webserver so I don't think I should need it anyway.

Any thoughts? Anyone see what I'm missing?

Thanks
 

bp2008

Staff member
Joined
Mar 10, 2014
Messages
12,666
Reaction score
14,006
Location
USA
I just gave this a shot in my browser. If I'm not authenticated to Blue Iris as an admin, it still returns code 200 but the response body is "Authorization required" and the command doesn't take effect.

I suggest you use the web server > Advanced feature "Limit IP addresses" and enter the IP this traffic is coming from along with a ^ like this:

Code:
^192.168.0.10
and that will make connections from the address always receive admin privilege without having to log in.
 
Joined
Feb 22, 2017
Messages
17
Reaction score
3
I'm so glad I came across this post, I was trying to do the same thing because the data used from WU via BITools is always way behind and doesn't support some of the data I get from my station into ISY. This is the first place I came across the macro=%text= which just made everything really easy especially since I already had ISY network resources set up to change profiles in BI so I just copied them and changed the profile part to macro.

BTW, I had no issues using http GET ip port /admin?macro=x&text={text}&user=admin&pw=adminpassword (as I used for the profiles)
 

jaydeel

BIT Beta Team
Joined
Nov 9, 2016
Messages
1,126
Reaction score
1,237
Location
SF Bay Area
BTW, we are not limited to macros 0-9. The actual upper bound is 99 (confirmed by Ken July '18). The only downside is that you cannot edit macros >9 in the BI UI (Options>Macros tab).

For example, if I send this command...
This is what I see in Reg Editor.

upload_2018-8-27_8-29-8.png

On the other hand, if I try the following...
http://ipaddress:port/admin?macro=100&text=test&session=session
the command will appear to be successfull, but a macro 100 will not appear in the registry.

This command has some pretty neat uses... For example, if you add macro %99 to a camera feed you can toggle a message to a camera's video feed by sending these commands in succession. If you loop them programmatically, you can flash a message.
Final note... The &session=session url parameter is something I learned from Ken. It eliminates the necessity of passing your credentials in the command if there exists a current session value from a JSON login (e.g, if you are running UI3 //EDIT: incorrect, see posts 6-8 below//). While this was new to me in Oct '17, Ken responded that it 'has worked for quite awhile'.
 
Last edited:
Joined
Feb 22, 2017
Messages
17
Reaction score
3
I was going to come back and post that you can use more than just the 9 macros.

I had a feeling that we'd be able to use more than just 9 so I tested yesterday while I was setting up all my weather cam overlays. So far I'm using macros 11-30.

Thanks for the info on the &session=session. To be clear this only works if you if there's another JSON login? While I'd prefer to not have to pass credentials with each command I'd rather have it always works.
 

jaydeel

BIT Beta Team
Joined
Nov 9, 2016
Messages
1,126
Reaction score
1,237
Location
SF Bay Area
To be clear this only works if you if there's another JSON login?
That's what I understand... This is not an issue for me as I have json web scripts running constantly... I'd try to test this for you, but it's not simple for me to ensure I've disabled all of my scripts... Perhaps you can test it and report back?
 
Joined
Feb 22, 2017
Messages
17
Reaction score
3
Yeah it fails. I guess for now I'll stick with using the credentials, I'd be stuck with doing that for my Dahua cameras anyways.
 

jaydeel

BIT Beta Team
Joined
Nov 9, 2016
Messages
1,126
Reaction score
1,237
Location
SF Bay Area
Thanks.
Just curious... Does it work while you have UI3 running in your browser? (I ask because I assumed it would in post #5)
 
Joined
Feb 22, 2017
Messages
17
Reaction score
3
It actually also fails with a U13 session open for me as well. I may have some other settings that are preventing it, I'll have to look deeper into it when I get a chance.
 
Top