]> www.infradead.org Git - users/dwmw2/esp32-pool.git/commitdiff
If sunrise is before 07:30, we don't want to know
authorDavid Woodhouse <dwmw@amazon.co.uk>
Tue, 11 Feb 2025 20:07:01 +0000 (20:07 +0000)
committerDavid Woodhouse <dwmw@amazon.co.uk>
Tue, 11 Feb 2025 20:07:01 +0000 (20:07 +0000)
blind.yaml

index 5ee217fdca5d4c0753d499b90e0071db0ca85c65..9f0ca69efb45724722444a573a9fee0c5ade8a46 100644 (file)
@@ -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