Active TopicsActive Topics  Display List of Forum MembersMemberlist  Search The ForumSearch  HelpHelp
  RegisterRegister  LoginLogin
PowerHome Programming
 PowerHome Messageboard : PowerHome Programming
Subject Topic: json Interface to Blue Iris Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
smarty
Super User
Super User
Avatar

Joined: May 21 2006
Location: United States
Online Status: Offline
Posts: 728
Posted: December 07 2017 at 13:18 | IP Logged Quote smarty

Ken,
I have downloaded and installed V2.2.3 of your program. Kudos to you; it works nicely for me.

I am starting to use it (rather than using "BIcommand.exe" as BIcommand.exe is no longer downloadable from the "cam-it" forum or the Blue Iris site (as it used to be). Plus, you program supports more json BI control functionality.

I do have a question for you though.

When trying to send one http call after another (I do wait for the return success confirmation in the "C:\biRtnCodes.txt" file), I can only send about 2-3 commands before Blue Iris "chokes" and sends back a failure message (in the text file).

When I put in longer pauses (say about 2-3 seconds), I get the same "choking"/fail result. I have to wait about 1/2 minutes before it starts working again.

As an idea, I thought I would try to logoff after each logon. It appears that I don't know how to properly log off. Any pointers?

What does a proper log off look like (command wise)?

......

FYI, In the case of turning my cams from one IR mode to another IR mode (day/night/auto), I have realized it seems to work better when my command string looks like this:

ph_run("C:\powerhome\jsonBI-2.2.3\jsonBI.exe login http://192.168.0.100:80/json loginname password; ptz GateHD 36; ptz BBQ_SE 36; ptz DrvGate 36; ptz DrvWest 36; ptz ScrnPrch 36; ptz DrvEast 36; ptz BBQ_N 36; ptz InsideHD 36; ptz Mailbox 36; ptz PatioFridge 36; ptz GateBuzzer 36; ptz RidgeNS 36")


Rather than trying to send one http call per camera (like this):

ph_run("{BI-PATH-LOGIN}"+"ptz GateHD 36")
wait for a return success, then:
ph_run("{BI-PATH-LOGIN}"+"ptz NextCam 36")
wait for a return success, then:
ph_run("{BI-PATH-LOGIN}"+"ptz AnotherCam 36")
etc...

...because I run into the "choking" that I mentioned".

I really would prefer to do it sequentially without the choking. Any thoughts?

Thanks,
Steve




Edited by smarty - December 07 2017 at 13:19


__________________
Elk - Insteon - BlueIris - DMC1 - PowerHome - XLobby - HA_Bridge w/Dots - Brultech
Back to Top View smarty's Profile Search for other posts by smarty
 
smarty
Super User
Super User
Avatar

Joined: May 21 2006
Location: United States
Online Status: Offline
Posts: 728
Posted: December 07 2017 at 13:24 | IP Logged Quote smarty

Another question....

Is there any way to pull the state information from a given camera? For example, how could I tell if the IR was on or off or in auto mode?

The BI help section for json commands was pretty sparse about this....and the cam-it forum topic string you mention in your readme file is no longer available (at least I couldn't find it).

__________________
Elk - Insteon - BlueIris - DMC1 - PowerHome - XLobby - HA_Bridge w/Dots - Brultech
Back to Top View smarty's Profile Search for other posts by smarty
 
GadgetGuy
Super User
Super User
Avatar

Joined: June 01 2008
Location: United States
Online Status: Offline
Posts: 942
Posted: December 08 2017 at 06:28 | IP Logged Quote GadgetGuy

Steve -

It's been several years since I last used my BI JSON App and I have no means to test here in our new home since we moved to Florida. So I am guessing a bit, but will do my best to give you some answers.

Have you found and read over my Care & Feeding BI User Guide to my BI JSON App? Hopefully it will help give you more insight into all the commands, but I will review again here.

Re: BI jamming up, Note that BI automatically logs a connection out after 2-3 seconds of inactivity, so your 30 sec pause error comment might be due to the fact that your connection was logged out already.

That said, I have found the BI sw to sometimes be a bit sluggish, especially if you aren't running it on a pretty fast, multi-processor computer, but your 1/2 minute experiences may be solely the result of an auto logout. My first suggestion is to email the author of BI who if memory serves me correctly is Ken Pletzer at ken@blueirissoftware.com. If that doesn't work try support@blueirissoftware.com.

I've usually found good responses from them all.

If that path is unsuccessful, the logout command should be (expressed for your particular domain setup)

        ph_run("C:\powerhome\jsonBI-2.2.3\jsonBI.exe login http://192.168.0.100:80/json loginname password;logout")

or better just include the "logout" command at the end of your command strings since the logout is automatic after 2-3 secs anyway and the long command above isn't needed.

To get the status from a camera, try...

       camconfig camName

where 'camName' is the short name of the camera you want status from. The status (if available) will be in the Return code stored in the txt file as I recall.

Hopefully, even with my stale knowledge, this has been some help.
[:-)} ken b



Edited by GadgetGuy - October 10 2019 at 07:50


__________________
Ken B - Live every day like it's your last. Eventually, you'll get it right!
Back to Top View GadgetGuy's Profile Search for other posts by GadgetGuy
 
smarty
Super User
Super User
Avatar

Joined: May 21 2006
Location: United States
Online Status: Offline
Posts: 728
Posted: December 11 2017 at 06:07 | IP Logged Quote smarty

Ken,
   Thanks for your comments. They got me going on the right track. Adding the "logout" to the end of each string allowed for me to send a battery of sequential control strings without an error.

"Camconfig" does indeed report back cam status (but not IR status unfortunately) via the return .txt file (need to read the .txt file BEFORE the logout command is processed).

Thanks for your help.
Steve

__________________
Elk - Insteon - BlueIris - DMC1 - PowerHome - XLobby - HA_Bridge w/Dots - Brultech
Back to Top View smarty's Profile Search for other posts by smarty
 
GadgetGuy
Super User
Super User
Avatar

Joined: June 01 2008
Location: United States
Online Status: Offline
Posts: 942
Posted: December 11 2017 at 10:08 | IP Logged Quote GadgetGuy

Steve -

I'm so glad I could be of help. When I saw your post
I thought, "OMG, I don't remember much at all about
what I did."

Fortunately I am a voracious commenter in my Code, and
it paid off big time here, as I was able to quickly
come back up to speed and take some educated guesses.

Hopefully it is as useful to you as it was for me. I
was very frustrated with my home theater interacting
with my security system as one of my cameras picked up
the scene on my 11' screen and keep reporting
"intruder motion" until I wrote the JSON code to be
able to easily enable/disable the camera, and having
gotten that far just decided to go for it and help
others as much as possible.


__________________
Ken B - Live every day like it's your last. Eventually, you'll get it right!
Back to Top View GadgetGuy's Profile Search for other posts by GadgetGuy
 
nick7920
Senior Member
Senior Member


Joined: March 04 2008
Location: United States
Online Status: Offline
Posts: 193
Posted: January 27 2018 at 13:01 | IP Logged Quote nick7920

Just in case

Blue Iris 4 and up support Http command for basic
stuff.
but you will have to turn off (un check)- Use secure
session keys and login page - in blue iris under web
server - advance setting.

for something simple to turn motion trigger just create
different profile in blue iris camera setting and use
http to turn off motion and other thru profile.

example to change profile

http://x.x.x.x:port/admin?
user=username&pw=password&camera=short_camera_name&profi
le=2


Edited by nick7920 - January 27 2018 at 13:04
Back to Top View nick7920's Profile Search for other posts by nick7920
 
GadgetGuy
Super User
Super User
Avatar

Joined: June 01 2008
Location: United States
Online Status: Offline
Posts: 942
Posted: May 18 2019 at 15:09 | IP Logged Quote GadgetGuy

Nick-
Thanks for sharing. That is a great find.
gadget guy

__________________
Ken B - Live every day like it's your last. Eventually, you'll get it right!
Back to Top View GadgetGuy's Profile Search for other posts by GadgetGuy
 
MARMIZ
Newbie
Newbie
Avatar

Joined: August 23 2019
Location: United States
Online Status: Offline
Posts: 1
Posted: October 10 2019 at 03:06 | IP Logged Quote MARMIZ

I tried everything but always answers me {login:'fail'} without the session variable. I tried Jquery ajax, Vue http-request,
Rest Api Chrome Extension, but nothing anything.


Edited by MARMIZ - October 10 2019 at 03:06
Back to Top View MARMIZ's Profile Search for other posts by MARMIZ Visit MARMIZ's Homepage
 
GadgetGuy
Super User
Super User
Avatar

Joined: June 01 2008
Location: United States
Online Status: Offline
Posts: 942
Posted: October 10 2019 at 08:06 | IP Logged Quote GadgetGuy

MARMIXZ-
I'm not clear about exactly you are doing. Normally you would not be seeing the BI jason Response as that is all handled in the "jsonBI.exe" App.

You would normally give a command from within a PH Macro that looked like this.
Code:
ph_run("C:\powerhome\jsonBI.exe login http://192.168.1.90:1002/json keb 00QAZwsx; status")


where the IP/port address is for the BI server and the LI/PW are what you use to login to BI.

Are you trying to drive BI directly instead of thru my jasonBI App?



__________________
Ken B - Live every day like it's your last. Eventually, you'll get it right!
Back to Top View GadgetGuy's Profile Search for other posts by GadgetGuy
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

<< Prev Page of 2
  Post ReplyPost New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum