]> www.infradead.org Git - users/dwmw2/esp32-pool.git/commitdiff
Report BLE-YC01 battery to Domotiz
authorDavid Woodhouse <dwmw@amazon.co.uk>
Wed, 6 Sep 2023 11:35:37 +0000 (12:35 +0100)
committerDavid Woodhouse <dwmw@amazon.co.uk>
Wed, 6 Sep 2023 11:35:37 +0000 (12:35 +0100)
pool.yaml

index 75ba9cd65ba673b2f55e1134a7238be7b43138ce..ffb3cadd5c596d28487c96b699fde46bc5909f20 100644 (file)
--- a/pool.yaml
+++ b/pool.yaml
@@ -452,6 +452,14 @@ sensor: #### Template sensor as their values are publish from a lambda or the BL
     state_class: measurement
     device_class: battery
     icon: mdi:battery
+    on_value:
+      then:
+        lambda: |-
+           id(mqtt_client).publish_json("domoticz/in", [=](JsonObject root) {
+                                                           root["command"] = "udevice";
+                                                           root["idx"] = 519;
+                                                           root["svalue"] = std::to_string(x);
+                                        });
 
   - platform: template
     name: "BLE-YC01 CL"