From 2d70dbbfe41fd7c0fc62b809030e16a99401dd94 Mon Sep 17 00:00:00 2001 From: David Woodhouse Date: Tue, 11 Feb 2025 20:07:01 +0000 Subject: [PATCH] If sunrise is before 07:30, we don't want to know --- blind.yaml | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) 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 -- 2.51.0