Add-On Fenecon2Mqtt - Connect Fenecon Home (OpenEMS) energy storage systems to Homeassistant

Hi,

this Add-on connects to Fenecon’s interface using websocket protocol and uses HA’s MQTT broker to publish a device and sensor entities to Homeassistant.
You can configure all Fenecon(OpenEMS/FEMS) channels and a couple of more things using the container configuration.

Maybee someone find it usefull. Yes, it’s my first Add-On and I’m not a full metal jacked programmer :slight_smile: .

Repo: GitHub - Skeletitor/ha_addon_fenecon2mqtt: Homeassistant Add-on Fenecon2Mqtt

Changelog: ha_addon_fenecon2mqtt/CHANGELOG.md at main · Skeletitor/ha_addon_fenecon2mqtt · GitHub

The Add-On comes with a collection of default entities which are pushed to HA. You‘re able to customize those entities. This customization is persistent, it won’t be overwritten by an update.

Have fun


UPDATE Here is the new default configuration for requested channels (for versions > 0.2.14). Copy it by your own and merge it into your local config or reinstall the add-on from the scratch.

fems_request_channels:
      - _sum/ConsumptionActiveEnergy
      - _sum/ConsumptionActivePower
      - _sum/ConsumptionActivePowerL1
      - _sum/ConsumptionActivePowerL2
      - _sum/ConsumptionActivePowerL3
      - _sum/ConsumptionMaxActivePower
      - _sum/EssActivePower
      - _sum/EssActivePowerL1
      - _sum/EssActivePowerL2
      - _sum/EssActivePowerL3
      - _sum/EssDcChargeEnergy
      - _sum/EssDcDischargeEnergy
      - _sum/EssSoc
      - _sum/GridActivePower
      - _sum/GridActivePowerL1
      - _sum/GridActivePowerL2
      - _sum/GridActivePowerL3
      - _sum/GridBuyActiveEnergy
      - _sum/GridMaxActivePower
      - _sum/GridMinActivePower
      - _sum/GridMode
      - _sum/GridSellActiveEnergy
      - _sum/ProductionActiveEnergy
      - _sum/ProductionActivePower
      - _sum/ProductionDcActualPower
      - _sum/ProductionMaxActivePower
      - _sum/State
      - battery0/Soh
      - battery0/Tower0NoOfCycles
      - battery0/Tower0PackVoltage
      - batteryInverter0/AirTemperature
      - batteryInverter0/ArmFmVersion
      - batteryInverter0/BmsPackTemperature
      - batteryInverter0/DspFmVersionMaster
      - batteryInverter0/DspFmVersionSlave
      - batteryInverter0/RadiatorTemperature
      - charger0/ActualPower
      - charger0/ActualPower
      - charger0/Current
      - charger0/State
      - charger0/Voltage
      - charger1/ActualPower
      - charger1/ActualPower
      - charger1/Current
      - charger1/State
      - charger1/Voltage
      - charger1/Voltage
      - ess0/Capacity
      - ess0/DcDischargePower
4 Likes

This is funny … I have a Fenecon Home (Heckert Symphon-E) since yesterday. Perfect timing for this addon :slight_smile: Thank you! It’s working fine.

Thank you! I didn’t know that ‘Heckert Symphon-E’ is based on Fenecon Home.

It is not only based on it, it is also serviced by Fenecon :slight_smile:

Also it is delivered from fenecon. Don’t see any differences.

Oh, there is a problem with the reconnection during a Softwareupdate of FEMS.
You need to restart the add-on manually untiI fix that.

It would be great if someone updates the addon and do the FEMS update after the addon update. The reconnect should be fixed now.

Sorry guys,

I published an update regarding the generation of entity names comming from mqtt entities. This has to be done to be compliant to an ucomming HA update.
The naming of MQTT entities changes to correspond with HA guidelines | Home Assistant Developer Docs (home-assistant.io)

Entity IDs chande from ‘sensor.fems*’ to ‘sensor.battery_inverter_fems*’

Hello Skeletitor,

i have a Problem with the Add on, can you help me ?

[21:20:26] INFO: Service restart after closing
[23:20:27] INFO: Starting Fenecon2Mqtt
2023-08-08 23:20:28,115 - MqttClient - MainThread - INFO - Connect to MQTT broker
2023-08-08 23:20:28,129 - on_connect-MqttClient - Thread-1 (_thread_main) - INFO - connected OK Returned code=Connection Accepted.
2023-08-08 23:20:29,129 - FeneconClient - MainThread - INFO - Init
2023-08-08 23:20:29,129 - FeneconClient - MainThread - INFO - Try to connect to Fenecons websocket
2023-08-08 23:20:29,142 - websocket - MainThread - INFO - Websocket connected
2023-08-08 23:20:29,142 - FeneconClient - MainThread - INFO - Fenecon opened connection → send authenticate
2023-08-08 23:20:29,644 - FeneconClient - MainThread - INFO - Fenecon opened connection → send getEdge
2023-08-08 23:20:30,146 - FeneconClient - MainThread - INFO - Fenecon opened connection → send getEdge configuration
2023-08-08 23:20:30,652 - FeneconClient - MainThread - INFO - Fenecon opened connection → send subscribe
2023-08-08 23:20:30,716 - websocket - MainThread - ERROR - error from callback <bound method FeneconClient.on_message of <FeneconClient.FeneconClient object at 0x7efedd5dd010>>: ‘result’
2023-08-08 23:20:30,717 - FeneconClient - MainThread - ERROR - Fenecon connection error: ‘result’
2023-08-08 23:20:30,717 - FeneconClient - MainThread - ERROR - Wait 5 seconds. Shut down. Let Watchdog restart this add-on.

FEMS password is wrong in configuration.

//edit Jep, i’ll take a look for a human readable error message :slight_smile:

Hello Skeletitor,

oh… it works fine :wink:
Is it possible to add a total energy consumption counter?

Dear all, may I missed something in the docs.
But I try to add another sensor in this case “ess0/GridMode .”
After adding “ess0/GridMode” to the configuration and restarted Fenecon2Mqtt it is appears in MQTT both under homeassistant/sensor/fenecon and fenecon .
But I can’t figure out howto get the sensor in HA ??
Can somebody point me into the right direction ??

Regards, Olaf

@Adrian01 - it was a mistake in entity device class mapping

0.2.11

  • Modified HA entity state class, entity device class, entity unit of measurement of FEMS entities without given units.
  • Use FEMS entity name to set HA entity unit to “V” if FEMS entity type is integer. No need to use manual mapping anymore!
  • Display user readable error message when FEMS password is wrong.

Hey all, I’m tottally new to HA and owner of a Fenecon PV System.

Thank you for the add on!

1 Like

I have also been using this add-on for months and it works perfectly :muscle: I came across this blog post about hidden/undocumented Rest API data-> Fenecon Home und das Rest-API – www.romal.de

I added the rest api calls for the temperatures as described in the blog and voila - there is some more data from the FEMS coming in :clap:

1 Like

You just need to add the identifier in the add-on config and you’ll get those entries without calling the REST-API.

e.g:



These Entries are used from FEMS if you install the add-on the first time:

        "_meta/Version",
        "_sum/State",
        "_sum/EssSoc",
        "_sum/EssActivePower",
        "_sum/State",
        "_sum/EssSoc",
        "_sum/EssActivePower",
        "_sum/EssActivePowerL1",
        "_sum/EssActivePowerL2",
        "_sum/EssActivePowerL3",
        "_sum/EssMaxApparentPower",
        "_sum/GridMode",
        "_sum/GridMinActivePower",
        "_sum/GridMaxActivePower",
        "_sum/GridActivePower",
        "_sum/GridActivePowerL1",
        "_sum/GridActivePowerL2",
        "_sum/GridActivePowerL3",
        "_sum/ProductionActivePower",
        "_sum/ProductionDcActualPower",
        "_sum/ProductionAcActivePower",
        "_sum/ProductionMaxActivePower",
        "_sum/ConsumptionActivePower",
        "_sum/ConsumptionActivePowerL1",
        "_sum/ConsumptionActivePowerL2",
        "_sum/ConsumptionActivePowerL3",
        "_sum/ConsumptionMaxActivePower",
        "ctrlPrepareBatteryExtension0/CtrlIsBlockingEss",
        "ctrlPrepareBatteryExtension0/CtrlIsChargingEss",
        "ctrlPrepareBatteryExtension0/CtrlIsDischargingEss",
        "ctrlPrepareBatteryExtension0/_PropertyIsRunning",
        "charger0/ActualPower",
        "charger1/ActualPower",
        "ess0/Soc",
        "ess0/Capacity",
        "ess0/DcDischargePower",
        "battery0/Tower0PackVoltage",
        "charger0/ActualPower",
        "charger1/ActualPower",
        "_sum/ProductionActiveEnergy",
        "_sum/GridBuyActiveEnergy",
        "_sum/GridSellActiveEnergy",
        "_sum/EssDcDischargeEnergy",
        "_sum/EssDcChargeEnergy"

I can add more if there is something important missing. Just give me a hint…
But I’ll not update the config during an add-on update. I don’t want to overwrite custom configurations!

I’d add:

  - battery0/Tower0PackVoltage
  - battery0/Soh
  - batteryInverter0/DspFmVersionMaster
  - batteryInverter0/DspFmVersionSlave
  - batteryInverter0/ArmFmVersion
  - batteryInverter0/AirTemperature
  - batteryInverter0/BmsPackTemperature
  - batteryInverter0/RadiatorTemperature
  - battery0/Tower0NoOfCycles
1 Like

Wow! This reply was very fast and unexpected :+1:
Thanks for that information and your work on that add-on.

0.2.16

  • !!!update manually or reinstall the addon!!! added new default entities/channels to be requested in FEMS see → hassio forum.

  • added value template for state values of inverter and charger0 an charger1. States are human readable now. Thx @benniju

  • added value template for grid mode. Grid mode is human readable now.

  • cleaned up docker image files

Hi, super interesting project! I am trying to connect to PRIMUS Energiemonitoring/Manager which runs OpenEMS (Version 2023.1.0), but I am getting the following error message:

s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service legacy-services: starting
services-up: info: copying legacy longrun fenecon2mqtt (no readiness notification)
[19:26:15] INFO: Starting Fenecon2Mqtt
s6-rc: info: service legacy-services successfully started
2024-04-22 19:26:15,310 - MqttClient - MainThread - INFO - Connect to MQTT broker
2024-04-22 19:26:15,314 - connect_callback-MqttClient - paho-mqtt-client-Fenecon2Hassio_mqttClient_0 - INFO - connected OK Returned code=Success
2024-04-22 19:26:16,314 - FeneconClient - MainThread - INFO - Init
2024-04-22 19:26:16,315 - FeneconClient - MainThread - INFO - Connect to Fenecons websocket
2024-04-22 19:26:16,323 - websocket - MainThread - INFO - Websocket connected
2024-04-22 19:26:17,857 - FeneconClient - MainThread - INFO - FEMS Authentication successfull
2024-04-22 19:26:17,888 - websocket - MainThread - ERROR - error from callback <bound method FeneconClient.on_message of <FeneconClient.FeneconClient object at 0x7f20647ba210>>: ‘result’
2024-04-22 19:26:17,889 - FeneconClient - MainThread - ERROR - Fenecon connection error: ‘result’
2024-04-22 19:26:17,889 - FeneconClient - MainThread - ERROR - Wait 5 seconds. Shut down. Let Watchdog restart this add-on.

Is there a possible way to resolve this with a simple fix?