Kaynağa Gözat

esphome 2025.07 - arduino to idf

Patryk M. Gutowski 3 ay önce
ebeveyn
işleme
1e4bacd221
2 değiştirilmiş dosya ile 49 ekleme ve 25 silme
  1. 47 23
      ff-bath-bt-proxy-02.yaml
  2. 2 2
      gf-bt-proxy-01.yaml

+ 47 - 23
ff-bath-bt-proxy-02.yaml

@@ -3,25 +3,25 @@ substitutions:
   low_devicename: ff_bath_bt_proxy_02
   friendly_devicename: FF Bath Bluetooth Proxy
 
-globals:
-  - id: asia_low
-    type: float
-    initial_value: '60.0'
-  - id: asia_high
-    type: float
-    initial_value: '94.95'
-  - id: patryk_low
-    type: float
-    initial_value: '95.0'
-  - id: patryk_high
-    type: float
-    initial_value: '120.0'
-  - id: ala_low
-    type: float
-    initial_value: '10.0'
-  - id: ala_high
-    type: float
-    initial_value: '20.0'
+# globals:
+#   - id: asia_low
+#     type: float
+#     initial_value: '60.0'
+#   - id: asia_high
+#     type: float
+#     initial_value: '94.95'
+#   - id: patryk_low
+#     type: float
+#     initial_value: '95.0'
+#   - id: patryk_high
+#     type: float
+#     initial_value: '120.0'
+#   - id: ala_low
+#     type: float
+#     initial_value: '10.0'
+#   - id: ala_high
+#     type: float
+#     initial_value: '20.0'
 
 esphome:
   name: $devicename
@@ -30,8 +30,8 @@ esphome:
 esp32:
   board: esp32dev
   framework:
-    type: arduino
-#    type: esp-idf
+#    type: arduino
+    type: esp-idf
 #    sdkconfig_options:
 #      CONFIG_BT_BLE_50_FEATURES_SUPPORTED: y
 #      CONFIG_BT_BLE_42_FEATURES_SUPPORTED: y
@@ -69,14 +69,34 @@ esp32_ble_tracker:
 # bluetooth_proxy:
 #  active: true
 
+time:
+  - platform: homeassistant
+    id: esptime
+
 sensor:
+  - platform: template
+    name: "Xiaomi Mi Scale Weight Time"
+    id: xiaomi_weight_time
+    lambda: "return id(xiaomi_weight_time).state;"
+    device_class: timestamp
+
   - platform: xiaomi_miscale
     mac_address: 'd0:3e:7d:3e:e3:5e'
     clear_impedance: true
     weight:
       name: "Xiaomi Mi Scale Weight"
       id: weight_miscale
-      force_update: true
+      # force_update: true
+      filters:
+        - timeout:
+            timeout: 30s
+            value: !lambda return 0;
+      on_value:
+        then:
+          - sensor.template.publish:
+              id: xiaomi_weight_time
+              state: !lambda "return id(esptime).now().timestamp;"
+
         #      on_value:
         #        then:
         #          - lambda: |-
@@ -90,7 +110,11 @@ sensor:
     impedance:
       name: "Xiaomi Mi Scale Impedance"
       id: impedance_miscale
-      force_update: true
+      # force_update: true
+      filters:
+        - timeout:
+            timeout: 30s
+            value: !lambda return 0;
         #      on_value:
         #        then:
         #          - lambda: |-

+ 2 - 2
gf-bt-proxy-01.yaml

@@ -10,8 +10,8 @@ esphome:
 esp32:
   board: esp32dev
   framework:
-    type: arduino
-    # type: esp-idf
+    # type: arduino
+    type: esp-idf
 
 packages:
    # Enable Home Assistant API