Code Monkey home page Code Monkey logo

Comments (1)

robwolff3 avatar robwolff3 commented on July 16, 2024

I think I figured it out by adding these sensors:

#Total Grid Watts Import
  - platform: template
    name: Total Grid Watts Import
    id: totalGridWattsImport
    lambda: |-
      if (id(totalGridWatts).state > 0) {
        return id(totalGridWatts).state;
      } else {
        return 0;
      }
    accuracy_decimals: 1
    unit_of_measurement: W
    icon: "mdi:flash-circle"
    update_interval: ${update_time}
#Total Grid Watts Export
  - platform: template
    name: Total Grid Watts Export
    id: totalGridWattsExport
    lambda: |-
      if (id(ct1Watts).state + id(ct2Watts).state < 0) {
        return (id(ct1Watts).state * -1) + (id(ct2Watts).state * -1);
      } else {
        return 0;
      }
    accuracy_decimals: 1
    unit_of_measurement: W
    icon: "mdi:flash-circle"
    update_interval: ${update_time}

#Grid Import kWh
  - platform: total_daily_energy
    name: Grid Import kWh
    power_id: totalGridWattsImport
    filters:
      - multiply: 0.001
    unit_of_measurement: kWh
#Grid Export kWh
  - platform: total_daily_energy
    name: Grid Export kWh
    power_id: totalGridWattsExport
    filters:
      - multiply: 0.001
    unit_of_measurement: kWh

Case closed!

from expandable-6-channel-esp32-energy-meter.

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.