From: David Woodhouse Date: Tue, 11 Feb 2025 20:07:01 +0000 (+0000) Subject: If sunrise is before 07:30, we don't want to know X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=2d70dbbfe41fd7c0fc62b809030e16a99401dd94;p=users%2Fdwmw2%2Fesp32-pool.git If sunrise is before 07:30, we don't want to know --- diff --git a/blind.yaml b/blind.yaml index 5ee217f..9f0ca69 100644 --- a/blind.yaml +++ b/blind.yaml @@ -14,7 +14,7 @@ esphome: upload_speed: 921600 on_boot: - tmc2209.configure: - microsteps: 2 # ${microsteps} + microsteps: ${microsteps} interpolation: true tcool_threshold: 400 - tmc2209.stallguard: @@ -68,13 +68,28 @@ wifi: logger: level: INFO +time: + - platform: sntp + on_time: + - seconds: 0 + minutes: 30 + hours: 7 + then: + lambda: | + if (id(sol).is_above_horizon()) + id(pd_blinds)->make_call().set_command_open().perform(); sun: + id: sol latitude: !secret latitude longitude: !secret longitude on_sunrise: - then: - - cover.open: pd_blinds + - lambda: | + auto time = id(sntp_time).now(); + if (time.is_valid() && (time.hour >= 8 || + (time.hour == 7 && time.minute >= 30))) + id(pd_blinds)->make_call().set_command_open().perform(); on_sunset: - then: - cover.close: pd_blinds