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

Feature request for actions #74

Closed
johanschelin opened this issue Jan 5, 2025 · 9 comments · Fixed by #75
Closed

Feature request for actions #74

johanschelin opened this issue Jan 5, 2025 · 9 comments · Fixed by #75

Comments

@johanschelin
Copy link
Contributor

Awesome that we got actions in this version - 👏👏 - now I can remove some of my shell commands and tidy up my conf.

This is just suggestions for more improvements.

Would be nice if we could use input.number helpers as values for charge and discharge as alternative to manually input. (I use this today in my automations based on the amount of time that is cheap).

Also we could create a “Operating mode” as a Select option directly in the integration?

Again - thanks for an awesome integration

@RustyDust
Copy link
Collaborator

Can you please be a bit more specific or give a more detailed example of what you want? I'm not sure I understand correctly what you want to do, especially with charge and discharge.
As for the operating mode, I assume what you want is the integration to provide a switch?

@johanschelin
Copy link
Contributor Author

Of course!

Regarding speed - today I use input.number helpers to be able to preset the charge speed like below. With these I can also calculate remaining charge time and thus manually choosing appropriate speed for those times I want to manually control charging or discharging.

IMG_2793

At the moment, when using the new actions, it is not possible to use input numbers as value.

Regarding the Operating Mode there are three modes, so I believe a select is better than a switch (even though I today have created a switch template for Auto/Manual as I never use the Time-of-Use mode).

@RustyDust
Copy link
Collaborator

Ok, understood. And what's your usage scenario here? In other words: when and why do you "pre-set" charge and discharge values and when do you actually charge/discharge the battery?

@johanschelin
Copy link
Contributor Author

johanschelin commented Jan 6, 2025 via email

@RustyDust
Copy link
Collaborator

@johanschelin Thanks, I got a clearer picture now and also that's a very interesting usage scenario. I'll see what I can do there. That said:

In lack of a perfect automation that controls car charging and battery charging in cold winter nights when heating also puts a stress on the fuses, I sometimes want to manually choose the max targets for charging power.

This sounds like a good usage scenario for the ToU-Mode of the Sonnenbatterie since it allows you to not only define a charging window but with the threshold_p_max settings also gives you the option to limit the power drawn from the network. This should take into account charging of the car as well since the Sonnenbatterie measures the whole grid consumption. So if you set threshold_p_max to say 25kW and your car is charging with 11kW and heating consumes 9kW that would leave you with 5kW for charging the battery and other consumers. I have to say that I haven't tested this but would be really interested in some real world results.

Also that doesn't solve these other points:

I then want to see for how long the charging will last - that’s the reason for my my helpers that show how long it will take at the chosen speed.

I'd be interested in your helper functions there ;)

I also sometimes want to use arbitrage when price can differ in Sweden from 0.01€ at night and up to 0.80€ at daytime. Those days I want to manually choose the discharge speed as well - as it can be more effective to do a higher discharge then only Self Consumption.

Ok, this will need some more helpers but I can see how this is attractive for you. Where dou you get the daily prices from? I assume you have some kind of flex tarrif that you can query and store in Home Assistant?

Otherwise I normally always charge batteries full every night and switch to Self Consumption (Automatic Mode) at around 8 AM as my 40kWh battery the lasts all day. (The charge f from the grid for transport of every kWh is just below 0.1€ where I live).

On a side note: maybe you want to have a look at evcc for chaging your car.

@johanschelin
Copy link
Contributor Author

Sorry for slow response - am on vacation :)

I will test ToU and see if that solves that specific need - thanks.

To live calculate the remaining time of charge or discharge I use this template:

{% set charging_power = states('input_number.chargepower_10p') | float %}
{% set total_capacity = states('sensor.sonnenbatterie_231864_state_total_capacity_usable') | float %}
{% set current_level = states('sensor.sonnenbatterie_231864_state_remaining_capacity_usable') | float %}

{% if charging_power > 0 %}
{{ ((total_capacity - current_level) / charging_power) | round(2) }}
{% else %}
0
{% endif %}

For prices during the day I use Nordpool that gives me tomorrows prices at around 1PM.

Tibber manages my car charging at the moment but I'm thinking of changing to EMHASS (will also check EVCC) to be able to control the scheduling more exactly in HA.

RustyDust added a commit to RustyDust/ha_sonnenbatterie that referenced this issue Jan 10, 2025
@RustyDust RustyDust linked a pull request Jan 11, 2025 that will close this issue
@RustyDust
Copy link
Collaborator

If/when you're going to test the PR version I just submitted, I'd be very interested in learning whether I git the limits for the sliders right. You seem to have two instances of a SonnenBatterie and the integration should automatically determine the inverter limits for charging/discharging for the sliders. Let me know how this works for you.

@johanschelin
Copy link
Contributor Author

If/when you're going to test the PR version I just submitted, I'd be very interested in learning whether I git the limits for the sliders right. You seem to have two instances of a SonnenBatterie and the integration should automatically determine the inverter limits for charging/discharging for the sliders. Let me know how this works for you.

Excellent Stefan! Will test as soon it is published and come back with results 👍

@doncuco
Copy link

doncuco commented Feb 2, 2025

@johanschelin: I have a question regarding your installation. You seem to have two batteries. How much capacity do they have?
Are they in any form communicating with each other? Or are they simply installed next to each other?
Do both have solar inverters? Or can they use one?
Is there a way to priorize one of them regarding the solar input? So that the normal Sonnenbatteriy gets its 4,6kW peak loading ant the performance the surplus.
Can you still use the default app?

Thanks for your help!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants