From 5649afaabd5bbdfbbbcd5926e769fad45b11b4ae Mon Sep 17 00:00:00 2001 From: David Woodhouse Date: Wed, 6 Sep 2023 12:35:37 +0100 Subject: [PATCH] Report BLE-YC01 battery to Domotiz --- pool.yaml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/pool.yaml b/pool.yaml index 75ba9cd..ffb3cad 100644 --- 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" -- 2.49.0