From: David Woodhouse Date: Wed, 6 Sep 2023 11:35:37 +0000 (+0100) Subject: Report BLE-YC01 battery to Domotiz X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=5649afaabd5bbdfbbbcd5926e769fad45b11b4ae;p=users%2Fdwmw2%2Fesp32-pool.git Report BLE-YC01 battery to Domotiz --- 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"