Title: | Client for the 'ZENTRA Cloud' API |
Version: | 0.1.0 |
Description: | Provides functionality to read settings, statuses and readings of weather stations from the 'ZENTRA Cloud' API https://zentracloud.com/api/v1/guide#APIGuidelines. |
License: | GPL-3 |
Encoding: | UTF-8 |
LazyData: | true |
RoxygenNote: | 7.1.1 |
Suggests: | testthat, spelling |
Imports: | httr, jsonlite, magrittr, dplyr, lubridate, purrr, methods, data.table |
Language: | en-US |
NeedsCompilation: | no |
Packaged: | 2020-12-17 15:09:34 UTC; szoecse |
Author: | Eduard Szöcs [aut, cre], BASF SE [cph] |
Maintainer: | Eduard Szöcs <eduard.szoecs@basf.com> |
Repository: | CRAN |
Date/Publication: | 2020-12-21 10:20:02 UTC |
Pipe operator
Description
See magrittr::%>%
for details.
Usage
lhs %>% rhs
parse a port
Description
parse a port
Usage
parse_port(port)
Arguments
port |
port object as in zc_readings object |
parse a timepoint
Description
parse a timepoint
Usage
parse_timepoint(timepoint)
Arguments
timepoint |
timepoint object as in zc_readings object |
parse a time series
Description
parse a time series
Usage
parse_timeseries(timeseries)
Arguments
timeseries |
time series object |
retrieve settings of a device
Description
retrieve settings of a device
retrieve statuses of a device
retrieve readings of a device
Usage
zc_settings(token = NULL, sn = NULL, start_time = NULL, end_time = NULL)
zc_statuses(token = NULL, sn = NULL, start_time = NULL, end_time = NULL)
zc_readings(token = NULL, sn = NULL, start_time = NULL, start_mrid = NULL)
Arguments
token |
(required) authorization token as returned by zc_token |
sn |
(required) the serial number for the device |
start_time |
Return data with timestamps greater or equal start_time. Specify start_time in UTC seconds, e.g. 1579474800)' |
end_time |
Return data with timestamps smaller or equal end_time. Specify end_time in UTC seconds, , e.g. 1579474800))' |
start_mrid |
Return data with mrids greater or equal start_mrid. This can be user to query data that has not been received yet, see guidelines. |
Examples
## Not run:
zc_settings(token = "yourtoken",
sn = "z6-00033",
start_time = as.numeric(as.POSIXct(Sys.Date(), origin = "1970-01-01")))
## End(Not run)
## Not run:
zc_statuses("yourtoken", sn = "z6-00033",
start_time = as.numeric(as.POSIXct(Sys.Date(), origin = "1970-01-01")))
## End(Not run)
## Not run:
zc_readings("yourtoken", sn = "z6-00033",
start_time = as.numeric(as.POSIXct(Sys.Date(), origin = "1970-01-01")))
## End(Not run)
parse readings into a long data.frame
Description
parse readings into a long data.frame
Usage
zc_timeseries(readings)
Arguments
readings |
object of class |
Examples
## Not run:
readings <- zc_readings("yourtoken",
sn = "z6-00033",
start_time = as.numeric(as.POSIXct(Sys.Date(),origin = "1970-01-01")))
zc_timeseries(readings)
## End(Not run)
retrieve authentication token from zentracloud
Description
retrieve authentication token from zentracloud
Usage
zc_token(
username = Sys.getenv("ZC_USERNAME"),
password = Sys.getenv("ZC_PASSWORD")
)
Arguments
username |
username. Read by default from environment variable |
password |
password. Read by default from environment variable |
Value
api token
Examples
## Not run:
token <- zc_token("xxxx", "yyyyy")
## End(Not run)