]> www.infradead.org Git - users/dwmw2/esp32-pool.git/commitdiff
Filter out zero temperatures too
authorDavid Woodhouse <dwmw@amazon.co.uk>
Fri, 10 Nov 2023 12:24:21 +0000 (12:24 +0000)
committerDavid Woodhouse <dwmw@amazon.co.uk>
Fri, 10 Nov 2023 12:24:21 +0000 (12:24 +0000)
pool.yaml

index ebb8779ad624d39ce2e056e872df028c04ab67ec..cc0b41ba88177477caf607cf33cb801d9e49a5c1 100644 (file)
--- a/pool.yaml
+++ b/pool.yaml
@@ -68,7 +68,7 @@ script:
         auto outtemp = id(solar_out).state;
         auto intemp = id(solar_in).state;
 
-        if (isnan(outtemp) || isnan(intemp))
+        if (isnan(outtemp) || isnan(intemp) || outtemp == 0.0 || intemp == 0.0)
           return;
 
         // We consumed this reading pair.
@@ -410,23 +410,36 @@ sensor: #### Template sensor as their values are publish from a lambda or the BL
     address: 0xd4030497940a0e28
     name: "Solar in"
     id: solar_in
+    filters:
+      filter_out: 0.0
     on_value:
       then:
         lambda: |-
-           id(solar_in_fails) = 0;
-           id(tell_domo_svalue)->execute(507, std::to_string(x));
-           id(control_valve)->execute();
+           if (x != 0.0) {
+             id(solar_in_fails) = 0;
+             id(tell_domo_svalue)->execute(507, std::to_string(x));
+             id(control_valve)->execute();
+           }
 
   - platform: dallasng
     address: 0xa0031397941af528
     name: "Solar out"
     id: solar_out
+    filters:
+      filter_out: 0.0
     on_value:
       then:
        - lambda: |-
-           id(solar_out_fails) = 0;
-           id(tell_domo_svalue)->execute(508, std::to_string(x));
-           id(control_valve)->execute();
+           if (x != 0.0) {
+             id(solar_out_fails) = 0;
+             id(tell_domo_svalue)->execute(508, std::to_string(x));
+             id(control_valve)->execute();
+           }
+
+  - platform: dallasng
+    address: 0x39666b9c1e64ff28
+    name: "Shed temperature"
+    id: shed_temp
 
 #  - platform: dallasng
 #    address: 0xc603156332b8ff28