Package 'rzentra'

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

Help Index


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 zc_readings as returned by zc_readings()

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 ZC_USERNAME

password

password. Read by default from environment variable ZC_PASSWORD

Value

api token

Examples

## Not run: 
token <- zc_token("xxxx", "yyyyy")

## End(Not run)