Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add get_energy_prices service call #147

Closed
TheFes opened this issue Mar 15, 2024 · 4 comments
Closed

Add get_energy_prices service call #147

TheFes opened this issue Mar 15, 2024 · 4 comments
Labels
enhancement New feature or request

Comments

@TheFes
Copy link

TheFes commented Mar 15, 2024

Is your feature request related to a problem? Please describe.
I am the author of the cheapest_energy_hours macro which can be used to determine eg the best time to turn on your dishwasher.
However, if you want to turn it on overnight, you loose today's data at midnight (as it will become yesterdays data then).

Some core integrations, like easyEnergy provide a service call in which you can get the data for the period you want, including historical data.

Describe the solution you'd like
Add support for the service call mentioned above

Describe alternatives you've considered
Add an additional attribute with the data of yesterday.

Additional context
NA

@Roeland54 Roeland54 added the enhancement New feature or request label Aug 31, 2024
@Roeland54
Copy link
Collaborator

The beta version of v0.5.0 does contain a "get_energy_prices" action. https://github.com/JaccoR/hass-entso-e/releases/tag/v0.5.0-beta1
Can you test and provide feedback?

@TheFes
Copy link
Author

TheFes commented Sep 12, 2024

Nice, I will test!

@TheFes
Copy link
Author

TheFes commented Sep 12, 2024

Works great. Tested it using this template sensor:

- trigger:
    - platform: time_pattern
      hours: "/1"
    - platform: homeassistant
      event: start
  action:
    - action: entsoe.get_energy_prices
      data:
        config_entry: 2100acc47af75f6227f0394476b6c322
        start: "{{ today_at() - timedelta(days=1) }}"
        end: "{{ today_at() + timedelta(days=2) }}"
      response_variable: prices
  sensor:
    - unique_id: 96147157-eca9-460c-b4cb-97165594e7a8
      name: ENTSOE prices
      state: "{{ prices.prices | selectattr('timestamp', '<=', now().strftime('%Y-%m-%dT%H:%M:%S+00:00')) | map(attribute='price') | list | last }}"
      attributes:
        prices: "{{ prices.prices }}"

This will give a sensor with a prices attribute with the prices of yesterday, today and tomorrow (if available).

@Roeland54
Copy link
Collaborator

v0.5.0 is released.

Repository owner locked and limited conversation to collaborators Sep 19, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants