wlcrs / huawei_solar

Home Assistant integration for Huawei Solar inverters via Modbus
GNU Affero General Public License v3.0
544 stars 88 forks source link

[Feature Request]: Add status sensor of "forcible Charge/Discharge" services #596

Closed heinemannj closed 9 months ago

heinemannj commented 9 months ago

Describe your feature request

Actually I'm implementing the "EMHASS: Energy Management Optimization for Home Assistant". https://github.com/davidusb-geek/emhass

This Add-On is performing more or less to predict the next 24h battery usage based on:

image

For HA Huawei Solar automations I'm actually using Node-RED:

image

Sheduled every minute!

=> leading to the situation that the inverter is penetrated with service calls every minute:

In FusioSolar portal Battery Forcible Charge changes are directly visible => meaning there must be inverter registers available.

Can you please provide a solution to have this status of Battery Forcible Charge within HA?

HA call service:

image

In FusionSolar above HA service call is directly visible as the following:

image

Stop Forcible Chare via HA service call:

image

Output in FusionSolar:

image

Proper usage

wlcrs commented 9 months ago

Making that value available would require a separate extra call to the inverter: it cannot be bundled with the existing requests being made to the inverter.

I must strike a careful balance between the number of requests I make to the inverter and their utility. I seem to have reached a point at which adding extra calls will make the integration unreliable for a considerable number of users (especially those connecting via an SDongle, even more so if they have multiple inverters connected in cascade).

As you can easily store this value yourself in a helper entity when you start/stop a forcible (dis)charge, I see little utility in adding this as an extra sensor. Meanwhile, the downside is pretty big for a considerable amount of users.

Feel free to add a custom sensor yourself if you really want to read it from the inverter instead.

MaartenDams commented 8 months ago

@wlcrs , I do love the integration , just playing around with it for the last 48h. How great it works, how stupid I feel for posting this but I can't get my head around (and can't find any decent documentation) on how to change the SOC to an entity value. soc

Can you please enlighten my spirit in what syntax should be used? It's the final piece of the charge_at_low_hours_puzzel :) Thanks, Maarten

heinemannj commented 8 months ago

What's about: {{ states('sensor.your_sensor_entity') }}

On Tue, 23 Jan 2024 at 22:02, MaartenDams @.***> wrote:

@wlcrs https://github.com/wlcrs , I do love the integration , just playing around with it for the last 48h. How great it works, how stupid I feel for posting this but I can't get my head around (and can't find any decent documentation) on how to change the SOC to an entity value. soc.jpg (view on web) https://github.com/wlcrs/huawei_solar/assets/50981812/8e8a739f-d363-4c38-a9d7-5f60eca5f9ae

Can you please enlighten my spirit in what syntax should be used? It's the final piece of the charge_at_low_hours_puzzel :) Thanks, Maarten

— Reply to this email directly, view it on GitHub https://github.com/wlcrs/huawei_solar/issues/596#issuecomment-1906913256, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAYZ3ORMYTK6XVCBI2K3RT3YQAQPRAVCNFSM6AAAAABCB4AZAWVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSMBWHEYTGMRVGY . You are receiving this because you authored the thread.Message ID: @.***>

MaartenDams commented 8 months ago

@heinemannj , I tried exactly that. It casts back that it needs a float. (value is for example 66)

Neither target_soc: {{ (states('sensor.oplaadniveau_batterij_eerste_uur')|float) }} nor {{ float(states('sensor.oplaadniveau_batterij_eerste_uur')) }} works.