WebApi - MetiumIoT/Metium GitHub Wiki

Home โ€นโ€น

WebApi

Api to communicate with Metium. To prepare Api you have to create user with "remote access" permission. Then you make request to your page with specific params:

connection - check the connected devices (same info as in "Connection" panel)

request:

GET http://192.168.10.100:8001/json.htm?
name={user-name};
pass={full-user-pass};
report=connection;

For example:

http://192.168.10.100:8001/json.htm?name={user-name};pass={full-user-pass};report=connection;

response:

    {"time":1494761980401,"connection":[{"name":"","MAC":"00000000","addr":"","VCC":""},{"name":"hx711","MAC":"00190000","addr":"","VCC":""},{"name":"T - mmax zew","MAC":"00002200","addr":"","VCC":""},{"name":"T - mmax 2","MAC":"00210001","addr":"","VCC":""},{"name":"T - Biurko A1","MAC":"00170302","addr":"","VCC":""},{"name":"T - WC A5","MAC":"0017031F","addr":"","VCC":""},{"name":"T - temp A8","MAC":"00170383","addr":"","VCC":""},{"name":"T - Podloga A9","MAC":"001703FA","addr":"","VCC":""},{"name":"T - Okno u E_R temp2","MAC":"0017024C","addr":"","VCC":""},{"name":"T - Sufit A4","MAC":"00170485","addr":"","VCC":""},{"name":"K - mc6553","MAC":"00230000","addr":"","VCC":""},{"name":"test","MAC":"00130020","addr":"","VCC":""},{"name":"T - Zielona antena","MAC":"00170312","addr":"","VCC":""},{"name":"T - Antena WiFi","MAC":"001701ED","addr":"","VCC":""},{"name":"P - Monitor 1","MAC":"00220030","addr":"","VCC":""},{"name":"P - Komputer2","MAC":"00220031","addr":"","VCC":""},{"name":"K - Drzwi lazienki","MAC":"00230002","addr":"","VCC":""}]}

measure - same as periodic report

parameters:

  • mac - sensors' MAC address
  • fromtime - unix time msec
  • tilltime - unix time msec
  • raster - step between value (1 - month,2 - week, 3 - days, 4 - hour, 5 - min, 6 - sec)
GET http://192.168.10.100:8001/json.htm?
name={user-name};
pass={full-user-pass};
report=measure;
mac={MAC};
fromtime={from-time};
tilltime={till-time};
param=3;
raster={raster};

resposnse:

[ 0, 21.5, 20.8, 20.6, 20.5 ]

oscilloscope

for fast changed signals (eq.heart preasure) parameters:

  • mac - MAC address
  • fromtime - unix time msec
  • tilltime - unix time msec