enbility / eebus-go

EEBUS protocol implementation in go
https://enbility.net
MIT License
52 stars 14 forks source link

Implement the MPC use case for Monitored Units #108

Open sthelen-enqs opened 2 weeks ago

sthelen-enqs commented 2 weeks ago

This adds an implementation of the MPC use case for Monitored Units.

The current implementation has 2 major restrictions so far:

  1. it automatically configures itself as a 3-phase meter (ABC) and there's no way to specify a different configuration right now
  2. it only supports the required phase-to-neutral and not the phase-to-phase voltages

I'm opening this as a Draft PR because while this UC works, it can still be improved and I'm looking for feedback and potential improvements. Some of the areas I'm explicitly looking for feedback in are:

DerAndereAndi commented 2 weeks ago

Thanks a lot for the PR!

Some first thoughts, more will surely come:

Having individual public functions for each scenario is what surely is expected and needed. But using those individually will result in a notify update message for each call, which I think is not nice.

I do see 2 options here:

DerAndereAndi commented 2 weeks ago

Regarding initialization: how about the possibility to define the supported scenarios, and for each scenario define a configuration item where items like amount of phases, measurement type, reference to etc. needs to be set.

Scenario 1 is required, all other scenarios are option/recommended. And even within the scenarios there are optional items, e.g. phase specfiic power.

Also I am wondering you only added setters, but maybe it is also helpful to have getters to e.g. validate the current storage?