Client for the 'ZENTRA Cloud' API

Provides functionality to read settings, statuses and readings of weather stations from the 'ZENTRA Cloud' API < https://zentracloud.com/api/v1/guide#APIGuidelines>.


rzentra

Lifecycle:maturing CRANstatus R buildstatus codecov

An R client for Zentracloud API.

Installation

Example

library("rzentra")

Authentcation

To work with the API you first need to authenticate. The zc_token() function authenticates you with your username and password and returns a token that can be used in subsequent API-calls.

The username & password are by default read from environmental variables ZC_USERNAME and ZC_PASSWORD, but you can provide them also in every function call using the username= and password= arguments.

token <- zc_token(username = "yourname", password = "yourpassword")$token

Querying data

Device settings

Querying the settings of a device can be done with zc_settings

zc_settings(token = token, 
  sn = "z6-00033", 
  start_time = as.numeric(as.POSIXct(Sys.Date(), origin = "1970-01-01"))
  )

Device statuses

Querying the settings of a device can be done with zc_statuses

zc_statuses(token = token, 
  sn = "z6-00033", 
  start_time = as.numeric(as.POSIXct(Sys.Date(), origin = "1970-01-01"))
  )

Device readings

zc_readings(token = token, 
  sn = "z6-00033", 
  start_time = as.numeric(as.POSIXct(Sys.Date(), origin = "1970-01-01"))
  )

Parsing data

Readings can be parsed into a long time-series table with zc_timeseries()

head(
  zc_timeseries(readings)
)

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("rzentra")

0.1.0 by Eduard Szöcs, 6 years ago


Browse source code at https://github.com/cran/rzentra


Authors: Eduard Szöcs [aut, cre] , BASF SE [cph]


Documentation:   PDF Manual  


GPL-3 license


Imports httr, jsonlite, magrittr, dplyr, lubridate, purrr, methods, data.table

Suggests testthat, spelling


See at CRAN