]> www.infradead.org Git - users/dwmw2/esp32-pool.git/commitdiff
oldsoftener bl0942 test
authorDavid Woodhouse <dwmw@amazon.co.uk>
Fri, 6 Sep 2024 21:58:45 +0000 (22:58 +0100)
committerDavid Woodhouse <dwmw@amazon.co.uk>
Fri, 6 Sep 2024 21:59:30 +0000 (22:59 +0100)
oldsoftener.yaml

index a0cae9cea9294ca7f2f2919b7fb9063d9dde8293..ad71215c099601a2330af6781ef0383be53ad21b 100644 (file)
@@ -5,6 +5,10 @@
 # GPIO16: Onboard relay (bathroom fan)
 # GPIO13: DHT22
 
+
+substitutions:
+  name: oldsoftener
+
 esphome:
   name: oldsoftener
 
@@ -50,24 +54,43 @@ switch:
     id: fan_relay
     pin: GPIO16
 
+uart:
+  id: uart_bus
+  tx_pin: GPIO17
+  rx_pin: GPIO18
+  baud_rate: 4800
+  stop_bits: 1
+  debug:
+    direction: BOTH
+    dummy_receiver: false
+    after:
+      delimiter: "\n"
+    sequence:
+      - lambda: UARTDebug::log_hex(direction, bytes, ' ');
+
+
 sensor:
-  - platform: hx711
-    dout_pin:
-      number: GPIO13 # Orange
-      mode:
-        input: true
-        pullup: true
-    clk_pin: GPIO14 # Yellow
-    gain: 128
-    update_interval: 30s
-    name: "HX711 value"
-    filters:
-    - calibrate_linear:
-        - 424400 -> 0
-        - -1592100 -> 89.05
-    unit_of_measurement: kg
-    on_value:
-      then:
-        lambda: |-
-#          if (!isnan(x))
-#            id(tell_domo_svalue)->execute(524, std::to_string(x));
+  - platform: internal_temperature
+    name: "${tongou_name} Internal Temperature"
+
+  - platform: bl0942
+    voltage_reference: 15968
+    current_reference: 124180
+    power_reference: 309.1
+    uart_id: uart_bus
+    line_frequency: 50Hz
+    address: 0
+    update_interval: 20s
+    current:
+      name: ${tongou_name} Current
+    voltage:
+      name: ${tongou_name} Voltage
+    power:
+      name: ${tongou_name} Power
+      filters:
+        multiply: -1
+    energy:
+      name: ${tongou_name} Energy
+    frequency:
+      name: ${tongou_name} Frequency
+      accuracy_decimals: 2