Hi Tobi,
I finally found some time to check your implementation by recreating a bundle from your code. It turns out, that you should already get a Warning currently, that your component name is invalid:
It turns out, that OSGi does not allow spaces in the component name. Once you fix it, the ESS should show up in the UI - e.g. like this:
@Component(//
name = "Battery-Inverter.KACO.Bluestorage", //
immediate = true, //
configurationPolicy = ConfigurationPolicy.REQUIRE, //
property = { //
EventConstants.EVENT_TOPIC + "=" + EdgeEventConstants.TOPIC_CYCLE_BEFORE_WRITE, //
EventConstants.EVENT_TOPIC + "=" + EdgeEventConstants.TOPIC_CYCLE_BEFORE_PROCESS_IMAGE //
})
This is very unfortunate, because a pull-request against the official repository would give you the opportunity to get a proper review of the code by an experienced OpenEMS developer. There are some things, that are currently ‘fishy’ in your code, e.g.
- Are you really implementing a
SymmetricEss
or rather aManagedSymmetricBatteryInverter
? If it is really a BatteryInverter you will save yourself a lot of implementation, by using the existingGenericEss
. - You can leave out all the
ElementToChannelConverter.DIRECT_1_TO_1
in ModbusProtocol. This is the default anyway - Use
Priority
wisely in the ModbusProtocol to speed up control and avoid unnecessary reads - Your comment is “Check if power target from Controller is within the Limits and apply a damping factor if necessary”. This will always be guaranteed if you get your
MaxApparentPower
,MaxChargePower
,MaxDischargePower
and possibly thegetStaticConstraints()
correct. - Manual ‘damping’ should not be required, There is a proper PID filter in place by default, that can be configured in the
Power
component. - and much more…
Apart from that of course every contribution helps to achive wider compatibilty for OpenEMS. Thanks for reconsidering your decision!
Regards,
Stefan