Ha_openems: Fenecon FEMS and OpenEMS integration

Instead of using the gas option, I recommend to configure your heatpumps energy as an individual electrical device in the home assistant energy dashboard:

This way, its energy is included in the total energy. And the data distribution is visualized in the electricity tab:

Hi there,

I now got a heatpump and I want to be able to exclude it from the battery (prevent it from discharging it). The reason is, that the energy for the heatpump will be significantly cheaper for me than the “normal” one for the house - so I want to sepnd the battery on that of course.

Fenecon offers an App for that (Power-to-heat) which offers the option - but I don’t want to buy it.

Is here anybody who realised such a function?

I found this entitiy:

Image

However it is quite dynamic and I don’t know where the value comes from and if it has dependencies or if it is ok to change it?

I thought I could use it like when excess charging but in reverse: AllowedDischargePower = Total consumption - heatpump

Any thoughts?

You can also set the emergency reserve to whatever your SOC currently is, then the battery will also not discharge. I used this for a while for exactly that use case.

I found a likely bug in ha-openems regarding the documented REST Write service openems.update_value.

In my setup, openems.update_value did not work for the write-only sensor entity sensor.fems82773_ess0_setactivepowerequals (ess0/SetActivePowerEquals). Calls with timeout and update_cycle were rejected as extra keys, and calls with only value returned 200 OK but logged that the referenced sensor entity was missing or not currently available.

After code inspection, the likely cause is a service-name collision: both sensor.py and binary_sensor.py register an entity service named update_value, but with different schemas. Renaming the binary-sensor service locally to update_binary_value made the documented openems.update_value service work for the sensor entity. After that, a test call with value: -800, timeout: 75, update_cycle: 10 correctly resulted in about -795 W ESS active power on my FENECON/FEMS system.

I opened a detailed GitHub issue here:

1 Like

Bug(s) fixed in the new official release 1.5.1 of ha-openems.

Thanks to the author!

Had that idea. However i domt want to buy power from the network. The house should consume from the battery - just not the heat pump. Only way I see to realize this is to limit the battery to what I currently consume minus the heatpump.

Hi everone,

Primarily because FEMS sent zero (or even negative) values for the energy counters right after its runup, I am working on a behavior change to drop decreasing channel values for sensor which represent sum value (like _sum/productionactiveenergy and _sum/consumptionactiveenergy).

While testing this change, I see a weird behavior of the _sum/consumptionactiveenergy channel. This is how it looks to me:

Can somebody confirm this behavior?

With my current change, behavior would instead look like this:

I still think this change would make sense. :face_with_raised_eyebrow: and would aim at rolling it out with a potential v1.6 of the integration.


Very strange numbers.

That's even more unexplainable than my system.
First chart looks similar to my system, with a super large dip when fems restarts. This is the main reason for me to add the change I explained above.

Regarding the 2nd chart: never seen a long time negative energy counter before. Does not happen for my system.

Dear all,

FEMS is nice, as is HA, and I have been using this project/integration Fenecon FEMS & OpenEMS (1.5.1) for some time.

All my systems, apps and …. are updated to the latest versions – all the time.

Now, today I have run into a problem: I can't do a automatic/manual backup anymore because the home-assistant_v2.db-file is too big. The system tried to write the backup-data, but couldn't verify the file for some reason (and, as I saw, wiped the even written data from the storage (512 GB SSD).

I had to purge the database, and then the backup worked again as before! (the file has only ~ one third of the size as before).

When i did some audits in my HA-system using H.A.C.A (also nice project!!) because of that, I got this information:

H.A.C.A Konfigurationsbericht :

...

Leistungs-Probleme (55)

--> noisy entity

[MEDIUM] sensor.fems123456789_sum_consumptionactivepower

Laute Entität: 81256 Statusänderungen in 24h

[MEDIUM] sensor.fems123456789_sum_essactivepower

Laute Entität: 71401 Statusänderungen in 24h

[MEDIUM] sensor.fems123456789_meter0_activepower

Laute Entität: 70542 Statusänderungen in 24h

[MEDIUM] sensor.fems123456789_sum_gridactivepower

Laute Entität: 70542 Statusänderungen in 24h

[MEDIUM] sensor.fems123456789_ctrlgridoptimizedcharge0_selltogridlimitminimumcharg

Laute Entität: 56952 Statusänderungen in 24h

[MEDIUM] sensor.fems123456789_sum_productionactivepower

Laute Entität: 51920 Statusänderungen in 24h

[MEDIUM] sensor.fems123456789_sum_productiondcactualpower

Laute Entität: 48123 Statusänderungen in 24h

[MEDIUM] sensor.fems123456789_charger0_actualpower

Laute Entität: 41868 Statusänderungen in 24h

[MEDIUM] sensor.fems123456789_charger1_actualpower

Laute Entität: 40894 Statusänderungen in 24h

[MEDIUM] sensor.fems123456789_sum_gridsellactiveenergy

Laute Entität: 38634 Statusänderungen in 24h

[MEDIUM] sensor.fems123456789_sum_gridsellactiveenergy_compensation

Laute Entität: 38634 Statusänderungen in 24h

[MEDIUM] sensor.fems123456789_sum_productionactiveenergy

Laute Entität: 38389 Statusänderungen in 24h

[MEDIUM] sensor.fems123456789_sum_productionacactivepower

Laute Entität: 38282 Statusänderungen in 24h

[MEDIUM] sensor.1_og_summe

Laute Entität: 37329 Statusänderungen in 24h

[MEDIUM] sensor.fems123456789_ess0_dcdischargepower

Laute Entität: 36747 Statusänderungen in 24h

[MEDIUM] sensor.fems123456789_sum_essdischargepower

Laute Entität: 36747 Statusänderungen in 24h

[MEDIUM] sensor.fems123456789_charger2_actualpower

Laute Entität: 35834 Statusänderungen in 24h

[MEDIUM] sensor.fems123456789_meter2_activepower

Laute Entität: 32387 Statusänderungen in 24h

[MEDIUM] sensor.fems123456789_charger0_- actualenergy

....... and so on.....

There is a verry big amount of data - each day - filling the database

!

It seems to me, that there are stored 1 "data-point" each second (may be at dayligth - ~ 10 h/d --> =~ 36.000) for each entity ??

-- ((sorry I am a beginner - in HA, in english and in IT-language.... ;-)) --

Is it only a problem of me with the database ?

What could/should I do?

Based on the information regarding my integration—which apparently comprises " 1 Gerät • 11 Dienste • 295 Entitäten” // 1 Device • 11 Services • 295 Entities—do I need to disable many of these entities or services?

And if so, which ones exactly?

I would be happy for any help!
:thinking:

1 Like

Yes, because of the very frequent updates of many FEMS Sensors if have excluded it form the database.. (Or rather I have a whitelist for recorded sensors.)
You can also lower the purge time.

I think it would be great if the was a way have for example configureable average intervals directly in the Integration, but this might be tricky to implement. Otherwise you can just blacklist the sensors an only allow the important ones, or add filter sensors.

Edit: On the others hand this would break the best thing of this integration, which are instant updates, just like in the Fems Portal. This Problem is really a generic issue with Home Assistant an it has been annoying me for years...

The amount of data stored due to live updates is static, as the recorder duration is fixed (default: 10 days). You can fine tune eg by setting purge_keep_days or auto_purge. See the recorder integration docu.

The long term statistics contain only 5(?) minute values. No matter how often the entity was updated initially.

1 Like

OK, THANKS—so I'm not alone in this! :slight_smile:
It's just that I hadn't read anything about this database issue in any previous posts.
That's why I went into a bit more detail in my explanation.

But which of the 11 services • 295 entities can I actually disable now without breaking something that I still need?

Could someone publish a proven/tested blacklist or whitelist for this?
I think starting with a heavily stripped-down version would be helpful for many people.

Thanks a lot - to the very, very helpful community,

Xaver

v1.6.0 allows to reduce the frequency of data updates.

There is now an option which allows you to define the interval in which the data shall be updated in HA.

2 Likes

Thank you so much for maintaining this great integration and updates!