Created
July 26, 2022 15:40
-
-
Save baobabprince/5b6fafa354c88b860388e52bcfa91e3b to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sensorID = "Your sensibo ID" | |
apikey = readLines("sensibo.api") | |
## commented lines run only once | |
# file.create("./sensibo.csv") | |
# data <- jsonlite::fromJSON(url)$result | |
# write(as.character(names(data)), "./sensibo.csv", sep=",") | |
url = paste0("https://home.sensibo.com/api/v2/pods/", sensorID, "/measurements?apiKey=", apikey) | |
while(1 == 1){ | |
data <- jsonlite::fromJSON(url)$result | |
text <- paste(as.character(unlist(data)), collapse = ",") | |
write(text, "./sensibo.csv", append = T) | |
Sys.sleep(120) | |
} | |
# in terminal run: | |
# nohup Rscript scripts/log_sensibo.R &>/dev/null & |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment