made script loop every 1 minutes

This commit is contained in:
Ben Varick 2023-11-06 17:42:51 -06:00
parent 56a47ea0f7
commit deafa827fa
Signed by: ben
SSH Key Fingerprint: SHA256:jWnpFDAcacYM5aPFpYRqlsamlDyKNpSj3jj+k4ojtUo
2 changed files with 3 additions and 2 deletions

View File

@ -13,7 +13,7 @@ bucket = "home_assistant"
home_assistant <- InfluxDBClient$new(url = "https://influxdb.dendroalsia.net",
token = token,
org = org)
update_interval <- 5
# ---- set variables
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){
update_data()
Sys.sleep(60)
Sys.sleep(60*update_interval)
}

View File

@ -4,6 +4,7 @@ output: html_document
---
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"]]`