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

Ability to reverse logic of this integration #319

Open
KrzysztofHajdamowicz opened this issue Aug 23, 2024 · 2 comments
Open

Ability to reverse logic of this integration #319

KrzysztofHajdamowicz opened this issue Aug 23, 2024 · 2 comments
Labels
feature request Request of a new feature

Comments

@KrzysztofHajdamowicz
Copy link

Is your feature request related to a problem? Please describe.
I want to use two instances of this integration to perform two tasks:

  1. Find X cheapest hours to charge battery pack
  2. Find X most expensive hours to discharge battery pack

Describe the solution you'd like

Add a binary switch or select entity to determine expected result from algorithm

Describe alternatives you've considered
It's already available in Jinja2 macro: https://github.com/TheFes/cheapest-energy-hours/

Additional context
Actually, I will run 3 instances of this integration:
To control (dis)charge of household battery pack and to charge EV.

@jonasbkarlsson
Copy link
Owner

Thanks for the suggestion. I have actually been thinking a bit about this.

For testing I have 3 instances of this integration. The instance that is used for discharging of the household battery pack uses template helpers that inverted the SOC entities {{ 100.0 - states('entity.providing_soc') | float(0) }} and then I use an instance of the Nordpool integration which is configured to invert the price {{ (current_price * -1.0 ) | float }}. This works fine, but is of course quite ugly. A switch would be a proper implementation.

However, I felt that this would be too simple. To make sense, I thought you need to add knowledge of the high and low price levels. If the purpose of this is to do price arbitrage, then it only make sense of the high price is a certain amount above the low price. This felt a bit complicated to implemented, so I didn't do anything more...

What is your comments on this? Is just a switch enough?

@jonasbkarlsson jonasbkarlsson added the feature request Request of a new feature label Aug 23, 2024
@KrzysztofHajdamowicz
Copy link
Author

Let's start with a switch, if someone wants to further expand logic, another layer of template sensors can be used.

I don't know if switch is sufficient in terms of UX design. Maybe with custom translations you can translate off/on to discharge/charge, but select seems more natural for most users.

select.Mode:
 - charge
 - discharge

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request Request of a new feature
Projects
None yet
Development

No branches or pull requests

2 participants