NextPVR Forums
  • ______
  • Home
  • New Posts
  • Wiki
  • Members
  • Help
  • Search
  • Register
  • Login
  • Home
  • Wiki
  • Members
  • Help
  • Search
NextPVR Forums Public Developers v
« Previous 1 2 3 4 5 … 93 Next »
Webapi

 
  • 0 Vote(s) - 0 Average
Webapi
greg in kansas
Online

Member

Posts: 182
Threads: 27
Joined: Feb 2007
#1
2020-07-13, 11:49 PM
I have been looking, but cannot find a list of commands that can be used here-
[b]http://192.168.2.10:8866/services/service?method= ????? &format=json[/b]
[b]If there is a command for "is playing " or " is recording this might be a way to get the info into my Openhab controller[/b]

[b]Thanks[/b]
mvallevand
Offline

Posting Freak

Ontario Canada
Posts: 53,104
Threads: 957
Joined: May 2006
#2
2020-07-13, 11:55 PM
Would method=system.status do what you want?

Martin
greg in kansas
Online

Member

Posts: 182
Threads: 27
Joined: Feb 2007
#3
2020-07-14, 12:05 AM
Just got this. Looks like under streams you get a 0 "program recording". That might work.

Thanks

stat "ok"
status

0
oid 21
identifier "IPTV (http://*****.live:826/...)"
streams
0 "/record/Hoarders/Hoarders_20200714_00000100.ts"
1
oid 22
identifier "IPTV (https://raw.githubusercontent.com/...)"
streams []
greg in kansas
Online

Member

Posts: 182
Threads: 27
Joined: Feb 2007
#4
2020-07-25, 11:11 PM
This does get me the recording status.
Thanks for that, is there somewhere I can get a list of commands?

this is what is working for me
This is for Openhab 1.8
Openhab items-

Switch ISNasRecording_SW
String ISNasRecording "Recording [%s]" {http="<[http://192.168.2.10:8866/services/servic...0:JSONPATH($.status.[0].streams)]" }

Rules-

rule "Process JSON from nas freevo"
when
Item ISNasRecording changed
then
logInfo("RULE", "JSON ISNasRecording!")

val jsonString = ISNasRecording.state.toString
if (jsonString != null) {

postUpdate(ISNasRecording_SW, ON)
logInfo ("RULE", (ISNasRecording.toString ) ) }

if (jsonString == "[]" ) {
postUpdate(ISNasRecording_SW, OFF)
logInfo ("RULE", "Not recording ")
}
end
sub
Offline

Administrator

NextPVR HQ, New Zealand
Posts: 106,789
Threads: 769
Joined: Nov 2003
#5
2020-07-25, 11:56 PM
(2020-07-25, 11:11 PM)greg in kansas Wrote: Thanks for that, is there somewhere I can get a list of commands?
There is no documented list, you can you can look at the source code of the kodi pvr.nextpvr addon for usage of the majority of them. Alternatively the web app also demos pretty much all the calls.

Alternatively, just ask what you're interested in doing, and I'll point you in the right direction for what call to use. There is calls for all the types things you'd expect, like getting the channel list, getting the recording list, scheduling recordings, cancelling recordings etc.
greg in kansas
Online

Member

Posts: 182
Threads: 27
Joined: Feb 2007
#6
2020-07-25, 11:58 PM (This post was last modified: 2020-07-26, 12:00 AM by greg in kansas.)
Thanks SUB https://github.com/kodi-pvr/pvr.nextpvr looks like it will have all I need.
mvallevand
Offline

Posting Freak

Ontario Canada
Posts: 53,104
Threads: 957
Joined: May 2006
#7
2020-07-26, 06:15 PM
I thought I posted yesterday. You need &format=json or a Accept: application/json header to get json responses.

Sub's code in wwwroot and component can be useful and you can see the responses in the browser dev mode. The system.status call isn't in pvr.nextpvr so it isn't one stop shopping.

Martin
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)



Possibly Related Threads…
Thread Author Replies Views Last Post
  webapi and silly cross site scripting stuff reven 6 3,148 2014-01-20, 03:06 AM
Last Post: reven

  • View a Printable Version
  • Subscribe to this thread
Forum Jump:

© Designed by D&D, modified by NextPVR - Powered by MyBB

Linear Mode
Threaded Mode