made script loop every 1 minutes
This commit is contained in:
parent
56a47ea0f7
commit
deafa827fa
@ -13,7 +13,7 @@ bucket = "home_assistant"
|
|||||||
home_assistant <- InfluxDBClient$new(url = "https://influxdb.dendroalsia.net",
|
home_assistant <- InfluxDBClient$new(url = "https://influxdb.dendroalsia.net",
|
||||||
token = token,
|
token = token,
|
||||||
org = org)
|
org = org)
|
||||||
|
update_interval <- 5
|
||||||
# ---- set variables
|
# ---- set variables
|
||||||
entities <- data.frame(name = c("washing machine", "dryer"), entity_id = c("lamp_a_power", "lamp_b_power"))
|
entities <- data.frame(name = c("washing machine", "dryer"), entity_id = c("lamp_a_power", "lamp_b_power"))
|
||||||
|
|
||||||
@ -62,5 +62,5 @@ update_data <- function(){
|
|||||||
|
|
||||||
for(i in 1:8640){
|
for(i in 1:8640){
|
||||||
update_data()
|
update_data()
|
||||||
Sys.sleep(60)
|
Sys.sleep(60*update_interval)
|
||||||
}
|
}
|
@ -4,6 +4,7 @@ output: html_document
|
|||||||
---
|
---
|
||||||
|
|
||||||
updated: `r format(Sys.time(), format = "%A %I:%M %p", tz = "America/Chicago")`
|
updated: `r format(Sys.time(), format = "%A %I:%M %p", tz = "America/Chicago")`
|
||||||
|
this site updates every `r update_interval` minutes
|
||||||
|
|
||||||
## The washing machine is currently: `r current_status[["lamp_a_power"]]`
|
## The washing machine is currently: `r current_status[["lamp_a_power"]]`
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user