Git Product home page Git Product logo

Comments (2)

XtremeOwnageDotCom avatar XtremeOwnageDotCom commented on September 23, 2024

Here is a partial config from mine. I did get temp sensing working.

Not a clue if it is accurate or not, however, the provided value matches what I would expect. I borrowed the code from somewhere else on the internet.

sensor: 
  - platform: hlw8012
    cf_pin: GPIO05
    cf1_pin: GPIO13 # not used because it is not available on the 1PM but it is needed to compile
    sel_pin: GPIO14 # not used because it is not available on the 1PM but it is needed to compile
    power:
      name: "${name_a} Watts"
      unit_of_measurement: W
      id: "${devicename}_power"
      icon: mdi:flash-circle
      accuracy_decimals: 0
      filters:
      # Map from sensor -> measured value
      - calibrate_linear:
          - 0.0 -> 1.0
          - 110.33186 -> 20.62
          - 131.01909 -> 24.32
          - 341.33920 -> 62.08
          - 5561.41553 -> 1000.0
          - 2975.51221 -> 535.7
          - 9612.66309 -> 1720.0
          - 14891.35352 -> 2679.0      
      # Make everything below 2W appear as just 0W.
      # Furthermore it corrects 1.0W for the power usage of the plug.
      - lambda: if (x < (2 + 1)) return 0; else return (x - 1);
    update_interval: 3s
  # Wifi Signal Sensor
  - platform: wifi_signal
    name: "${devicename} WiFi Signal"
    update_interval: 60s

  # NTC Temperature
  - platform: ntc
    sensor: temp_resistance_reading
    name: ${devicename} Temperature
    unit_of_measurement: "°C"
    accuracy_decimals: 1
    icon: "mdi:thermometer"
    calibration:
      b_constant: 3350
      reference_resistance: 10kOhm
      reference_temperature: 298.15K
    on_value_range:
      - above: 85.0
        then:
          # - light.turn_off: lightid1
          # - fan.turn_off: fanid1
          - homeassistant.event:
              event: esphome.overheat
              data:
                title: ${devicename} has overheated.
  - platform: resistance
    id: temp_resistance_reading
    sensor: temp_analog_reading
    configuration: DOWNSTREAM
    resistor: 32kOhm
  - platform: adc
    id: temp_analog_reading
    pin: A0
binary_sensor:
  # Binary sensor for the button press
  - platform: gpio
    name: button
    pin:
      number: GPIO4
    on_state:
      - switch.toggle: relay
    internal: true
output:
  # Relay state led
  - platform: esp8266_pwm
    id: state_led
    pin:
      number: GPIO00
      inverted: true

from esphome-configs.

jonathanadams avatar jonathanadams commented on September 23, 2024

@XtremeOwnageDotCom do you mind adding a pull request with your config.

from esphome-configs.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.