From: David Woodhouse Date: Fri, 6 Sep 2024 21:58:45 +0000 (+0100) Subject: oldsoftener bl0942 test X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=0f3a22ac83c8d327e14589a019f74fff6b4c00aa;p=users%2Fdwmw2%2Fesp32-pool.git oldsoftener bl0942 test --- diff --git a/oldsoftener.yaml b/oldsoftener.yaml index a0cae9c..ad71215 100644 --- a/oldsoftener.yaml +++ b/oldsoftener.yaml @@ -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