Title: | Client for the 'ZENTRA Cloud' API |
---|---|
Description: | Provides functionality to read settings, statuses and readings of weather stations from the 'ZENTRA Cloud' API <https://zentracloud.com/api/v1/guide#APIGuidelines>. |
Authors: | Eduard Szöcs [aut, cre], BASF SE [cph] |
Maintainer: | Eduard Szöcs <[email protected]> |
License: | GPL-3 |
Version: | 0.1.0 |
Built: | 2024-12-12 06:58:56 UTC |
Source: | CRAN |
parse a port
parse_port(port)
parse_port(port)
port |
port object as in zc_readings object |
parse a timepoint
parse_timepoint(timepoint)
parse_timepoint(timepoint)
timepoint |
timepoint object as in zc_readings object |
parse a time series
parse_timeseries(timeseries)
parse_timeseries(timeseries)
timeseries |
time series object |
retrieve settings of a device
retrieve statuses of a device
retrieve readings of a device
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)
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)
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. |
## 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)
## 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
zc_timeseries(readings)
zc_timeseries(readings)
readings |
object of class |
## 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)
## 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
zc_token( username = Sys.getenv("ZC_USERNAME"), password = Sys.getenv("ZC_PASSWORD") )
zc_token( username = Sys.getenv("ZC_USERNAME"), password = Sys.getenv("ZC_PASSWORD") )
username |
username. Read by default from environment variable |
password |
password. Read by default from environment variable |
api token
## Not run: token <- zc_token("xxxx", "yyyyy") ## End(Not run)
## Not run: token <- zc_token("xxxx", "yyyyy") ## End(Not run)