Our full technical support staff does not monitor this forum. If you need assistance from a member of our staff, please submit your question from the Ask a Question page.


Log in or register to post/reply in the forum.

WebServer API Apple Homekit


Curt_Ingram Oct 29, 2020 06:49 PM

So I am successfully able to use HTTP Get commands to retrieve data from a datalogger, eg.:

http://192.168.1.21/?command=dataquery&uri=dl:public.freezer_temp&mode=most-recent&format=json

This works great, however I see in the manual that there are ways to use HTTP get to retrieve data from a CSI Webserver as well as from the logger.  I currently have a CR200 attached to a CR1000 and would like to know:

1.  Can I request data via API of the CR1000 and get data out of the CR200?  or

2.  Can I request directly from the CSI webserver? (there are no syntax examples that I can find).

I am using these requests to enable Apple Homekit functionality via homebridge.  It works amazingly well so far.  "Hey Siri, what temperature is my freezer?"

Thanks ahead of time :)

Curt


JDavis Oct 30, 2020 10:48 AM

The CR1000 will need to get data from the CR200 with GetVariables() or some other instruction.


jtrauntvein Oct 30, 2020 11:30 AM

The CSI Web Server provides the same API as the dataloggers for accessing data.  The only difference is that the CSI Web Server uses the concept of data sources to describe the types of data that can be accessed.  Types of data sources include the following:

- LoggerNet

- LNDB Database

- Data Files

These data sources are configured in XML files called ".sources.xml"  in the CSI Web Server's home directory (or in direct subdirectories of the web server's home directory) and are typically generated and published by the RTMC Web Publisher utility.  Even if I have no intention of using an RTMC generated web page, I have found it typically easier to use RTMC Pro to describe the data sources and use the publisher utility to generate the file.  

If you use a LoggerNet data source with the CSI Web Server, than the "uri" query parameter will look something like the following:

   dsname:logger.table

The "dsname" here (everyhing before the colon) is the assigned name of the data source in the .sources.xml.  The "logger" token here is the name of a datalogger device in LoggerNet's network map or it could also refer to the "__statistics__" data broker which contains tables the describe the operation of the server and of devices in the network map.  Finally, the "table" token here is the name of the table that you want to retrieve.

So, if your CR1000 is configured as a PakBus router, it can be used by LoggerNet to communicate with the CR200, and LoggerNet is set up to collect data from your CR200, You should be able to use the CSI Web Server to access any of the data that has been collected.

Log in or register to post/reply in the forum.