Skip to content

Energyid integration#138206

Merged
frenck merged 147 commits into
home-assistant:devfrom
EnergieID:energyid-webhooks
Nov 26, 2025
Merged

Energyid integration#138206
frenck merged 147 commits into
home-assistant:devfrom
EnergieID:energyid-webhooks

Conversation

@Molier
Copy link
Copy Markdown
Contributor

@Molier Molier commented Feb 10, 2025

Breaking change

Proposed change

Introducing the EnergyID integration! EnergyID is an online energy monitoring platform. This integration allows you send sensors from within Home Assistant (eg. energy meters, solar panels, batteries, ...) to your EnergyID-record, using their webhooks.

  • Some reasons why you would want to upload data (specifically energy measurements) to EnergyID:

    • To store your data online, as a backup
    • To use the EnergyID web-app and/or mobile app. We have many analyses, dashboards, reports you might want to use.
    • To participate in energy communities via EnergyID (energy sharing, virtual power plants etc.)
    • Benchmarking of energy data with other users on EnergyID
    • Data portability (people want to get data into EnergyID that they can only get from within their local network, hence they want to leverage Home Assistant)

As seen before in some threads and git repos (1 , 2) there was some demand for an official integration for data -> EID and not just the other way around.

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New integration (thank you!)
  • New feature (which adds functionality to an existing integration)
  • Deprecation (breaking change to happen in the future)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

Checklist

  • The code change is tested and works locally.
  • Local tests pass. Your PR cannot be merged unless tests pass
  • There is no commented out code in this PR.
  • I have followed the development checklist
  • I have followed the perfect PR recommendations
  • The code has been formatted using Ruff (ruff format homeassistant tests)
  • Tests have been added to verify that the new code works.

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

If the code communicates with devices, web services, or third-party tools:

  • The manifest file has all fields filled out correctly.
    Updated and included derived files by running: python3 -m script.hassfest.
  • New or updated dependencies have been added to requirements_all.txt.
    Updated by running python3 -m script.gen_requirements_all.
  • For the updated dependencies - a link to the changelog, or at minimum a diff between library versions is added to the PR description.

To help with the load of incoming pull requests:

Copy link
Copy Markdown
Contributor

@home-assistant home-assistant Bot left a comment

Choose a reason for hiding this comment

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

Hi @Molier

It seems you haven't yet signed a CLA. Please do so here.

Once you do that we will be able to review and accept this pull request.

Thanks!

Copy link
Copy Markdown
Contributor

@home-assistant home-assistant Bot left a comment

Choose a reason for hiding this comment

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

Hi @Molier

It seems you haven't yet signed a CLA. Please do so here.

Once you do that we will be able to review and accept this pull request.

Thanks!

Comment thread homeassistant/components/energyid/strings.json Outdated
@Molier Molier marked this pull request as ready for review February 14, 2025 20:22
Copy link
Copy Markdown
Member

@zweckj zweckj left a comment

Choose a reason for hiding this comment

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

Hi, thanks for your contribution 👋

So

  • why would I want to sent something from my HA instance somewhere? Can you please explain a bit more about the use-case and what data/entities would be supported?
  • The library code is not properly linked in mypy and doesn't use tagged releases which are pushed using CI (which we required)
  • If we are building an integration that doesn't have any entities but only provides services we should implement, well, proper services (in services.py with a services.yaml, which are added in async_setup)

@home-assistant home-assistant Bot marked this pull request as draft February 15, 2025 19:40
@home-assistant
Copy link
Copy Markdown
Contributor

Please take a look at the requested changes, and use the Ready for review button when you are done, thanks 👍

Learn more about our pull request process.

@JrtPec
Copy link
Copy Markdown
Contributor

JrtPec commented Feb 17, 2025

@zweckj

  • Some reasons why you would want to upload data (specifically energy measurements) to EnergyID:
    • To store your data online, as a backup
    • To use the EnergyID web-app and/or mobile app. We have many analyses, dashboards, reports you might want to use.
    • To participate in energy communities via EnergyID (energy sharing, virtual power plants etc.)
    • Benchmarking of energy data with other users on EnergyID
    • Data portability (people want to get data into EnergyID that they can only get from within their local network, hence they want to leverage Home Assistant)
  • By library code, you mean energyid-webhooks? We can add type hinting, tagged releases, CI... shouldn't be any issue but please confirm this is what you mean.
  • Can you clarify about services? (are they now called Actions?). You would like this integration implemented as such?

Copy link
Copy Markdown
Contributor

@JrtPec JrtPec left a comment

Choose a reason for hiding this comment

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

I have tested the integration and could successfully upload sensor data to EnergyID!

@zweckj
Copy link
Copy Markdown
Member

zweckj commented Feb 17, 2025

@zweckj

  • Some reasons why you would want to upload data (specifically energy measurements) to EnergyID:

check ✅

  • By library code, you mean energyid-webhooks? We can add type hinting, tagged releases, CI... shouldn't be any issue but please confirm this is what you mean.

Yes exactly. Type hinting is nice to have and only a requirement for platinum quality. Tagged releases and CI is required for every new integration.

  • Can you clarify about services? (are they now called Actions?). You would like this integration implemented as such?

Exactly what I was thinking about, but now that I understand the use-case a bit better not fitting. So you'd basically select one or multiple entities and the integration would continuously push the updates to the cloud right? In that case a service (action) wouldn't be fitting as those are one time calls triggered by the user

@Molier Molier marked this pull request as ready for review February 20, 2025 13:38
@home-assistant home-assistant Bot requested a review from zweckj February 20, 2025 13:38
@home-assistant home-assistant Bot dismissed stale reviews from themself February 20, 2025 13:38

Stale

@Molier
Copy link
Copy Markdown
Contributor Author

Molier commented Feb 20, 2025

implemented tagged releases and typing in linked library

Comment thread homeassistant/components/energyid/config_flow.py Outdated
@home-assistant home-assistant Bot marked this pull request as draft February 21, 2025 19:10
@emontnemery
Copy link
Copy Markdown
Contributor

tests pass locally, i cant rerun CI i think?

Yeah, it's a github limitation to prevent bots opening PRs which use CI to do crypto mining 😬
Once your first PR has been merged, CI will be automatically started.

@emontnemery
Copy link
Copy Markdown
Contributor

There are some uncovered lines in homeassistant/components/energyid/config_flow.py and homeassistant/components/energyid/energyid_sensor_mapping_flow_py, please add tests covering them.
Considering the nature of this integration, I also think we should have full test coverage of homeassistant/components/energyid/__init__.py

To check test coverage locally, run pytest --cov=homeassistant.components.energyid --cov-report html tests/components/energyid

…dation

- Added tests for polling behavior on authentication errors and connection issues in `test_config_flow.py`.
- Implemented validation tests for entity mapping inputs in `test_energyid_sensor_mapping_flow.py`.
- Enhanced initialization tests in `test_init.py` to cover timeout scenarios, periodic sync errors, and entry unloading with subentries.
- Improved error handling in various test cases to ensure robustness against unexpected exceptions and state changes.
@Molier
Copy link
Copy Markdown
Contributor Author

Molier commented Oct 27, 2025

There are some uncovered lines in homeassistant/components/energyid/config_flow.py and homeassistant/components/energyid/energyid_sensor_mapping_flow_py, please add tests covering them. Considering the nature of this integration, I also think we should have full test coverage of homeassistant/components/energyid/__init__.py

To check test coverage locally, run pytest --cov=homeassistant.components.energyid --cov-report html tests/components/energyid

added tests for full coverage and added some more advanced test for init

Comment thread homeassistant/components/energyid/strings.json Outdated
Comment thread homeassistant/components/energyid/strings.json Outdated
@home-assistant home-assistant Bot marked this pull request as draft October 27, 2025 14:50
@Molier Molier marked this pull request as ready for review October 27, 2025 15:56
@home-assistant home-assistant Bot requested a review from emontnemery October 27, 2025 15:56
Comment thread tests/components/energyid/test_config_flow.py Outdated
Comment thread tests/components/energyid/test_config_flow.py Outdated
Comment thread tests/components/energyid/test_config_flow.py
Comment thread tests/components/energyid/test_config_flow.py
Comment thread tests/components/energyid/test_config_flow.py
Comment thread tests/components/energyid/test_energyid_sensor_mapping_flow.py Outdated
Comment thread tests/components/energyid/test_init.py
Comment thread tests/components/energyid/test_init.py
Comment thread homeassistant/components/energyid/__init__.py Outdated
Comment thread tests/components/energyid/test_init.py
@home-assistant home-assistant Bot marked this pull request as draft October 28, 2025 08:41
@Molier Molier marked this pull request as ready for review November 25, 2025 21:39
@home-assistant home-assistant Bot requested a review from emontnemery November 25, 2025 21:39
Copy link
Copy Markdown
Contributor

@emontnemery emontnemery left a comment

Choose a reason for hiding this comment

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

This looks good to me now, thanks @Molier 👍

@frenck frenck merged commit 6baf77d into home-assistant:dev Nov 26, 2025
67 checks passed
@Jaxom99
Copy link
Copy Markdown

Jaxom99 commented Nov 26, 2025

Woooohoooo, big up @Molier 😉 And thank you all for the careful overview of this integration!

@github-actions github-actions Bot locked and limited conversation to collaborators Nov 27, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants