Skip to content

Allow the utility_meter to net meter rather than only allow increases.#21204

Merged
dgomes merged 7 commits into
home-assistant:devfrom
JBassett:feature/utiliyMeter-NetMetering
Feb 23, 2019
Merged

Allow the utility_meter to net meter rather than only allow increases.#21204
dgomes merged 7 commits into
home-assistant:devfrom
JBassett:feature/utiliyMeter-NetMetering

Conversation

@JBassett
Copy link
Copy Markdown
Contributor

@JBassett JBassett commented Feb 19, 2019

Description:

This PR allows utility_meter components to be net metered. My personal use-case is monitoring net power consumption because of solar feeding back to the grid.

Pull request in home-assistant.io with documentation (if applicable): home-assistant/home-assistant.io#8631

Example entry for configuration.yaml (if applicable):

utility_meter:
  daily_energy:
    source: sensor.solar_raw_lifetime_net_energy
    cycle: daily
    net_consumption: True
  monthly_energy:
    source: sensor.solar_raw_lifetime_net_energy
    cycle: monthly
    net_consumption: True

Checklist:

  • The code change is tested and works locally.
  • Local tests pass with tox. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.

If user exposed functionality or configuration variables are added/changed:

  • Documentation added/updated in home-assistant.io

  • Tests have been added to verify that the new code works.

Comment thread homeassistant/components/utility_meter/sensor.py Outdated
Comment thread homeassistant/components/utility_meter/__init__.py Outdated
Comment thread homeassistant/components/utility_meter/sensor.py Outdated
Comment thread homeassistant/components/utility_meter/sensor.py Outdated
Comment thread homeassistant/components/utility_meter/const.py Outdated
Copy link
Copy Markdown
Contributor

@dgomes dgomes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should add a test

@dgomes
Copy link
Copy Markdown
Contributor

dgomes commented Feb 19, 2019

I've been thinking maybe the name should be more obvious to users:
"net_comsumption" ?

@JBassett
Copy link
Copy Markdown
Contributor Author

I agree that net_consumption would be a better name. I'll change that along with the other comments.

Comment thread tests/components/utility_meter/test_sensor.py
Comment thread tests/components/utility_meter/test_sensor.py
Copy link
Copy Markdown
Contributor

@dgomes dgomes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

Comment thread homeassistant/components/utility_meter/sensor.py
@dgomes dgomes merged commit 02745be into home-assistant:dev Feb 23, 2019
@ghost ghost removed the in progress label Feb 23, 2019
@dgomes
Copy link
Copy Markdown
Contributor

dgomes commented Feb 23, 2019

tks! 🥇

@balloob balloob mentioned this pull request Mar 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants