Coder Social home page Coder Social logo

I like to contribute about mpp-solar HOT 14 CLOSED

jblance avatar jblance commented on July 24, 2024
I like to contribute

from mpp-solar.

Comments (14)

volkerjaenisch avatar volkerjaenisch commented on July 24, 2024 1

I agree fully. An since it is 4:00 local time i go to sleep now :-)

from mpp-solar.

jblance avatar jblance commented on July 24, 2024

Hi

I'm always interesting in interesting things!
Happy to incorporate any improvements

I to was/are intending to use Home Assistant to do orchestration (and display)
The grafana piece was to help someone who wanted to use grafana in their setup

If you look at the picture in the MQTT-Grafana doc, this code is only goes as far as posting to MQTT
I have had thoughts to monitor other devices (anything that can be Pi connected) and to possibly monitor MQTT queue(s) for 'instructions'

If you want to discuss specific additions / suggestions / improvements, feel free to create an issue for each one (to focus discssion) - it will encourage to create some useful labels :-)

Regards
John

from mpp-solar.

ceaza avatar ceaza commented on July 24, 2024

@jblance this is a great project. May I second @volkerjaenisch suggestions regarding allowing in other inputs. Would be great to control the inverter mode via SOC from a battery management system. I have some python code reading a BMS but is just there for info at the moment. Mode is controlled internally via voltage in the Axpert MKS II which is not ideal as mentioned by @volkerjaenisch.

from mpp-solar.

jblance avatar jblance commented on July 24, 2024

Hi
As mentioned above, I'm happy to add things to this. In fact the reason I havent got to incorporating @volkerjaenisch great fixes is that I have been working to get talking to a BMS via bluetooth.

Also i second Charles' thanks to @volkerjaenisch for your contribution, sorry I havent merged it yet - I'll get it done in the next few days!

Cheers
John

from mpp-solar.

volkerjaenisch avatar volkerjaenisch commented on July 24, 2024

@ceaza You are welcome!
I also have code for monitoring a BMS in work.

@ALL
May I propose an idea for the further development? I am tinkering for some months on a solution to integrate and control more components. Also I had begun writing a registry based plugin system for components.

I do not think that mpp-solar is the right platform for a more complicated solution involving more components. Not because mpp-solar is not good piece of software.

It's the general picture. In the end we all want quite similar (measure values and reacting on them ) stuff, but with probably very different algorithms, hardware, node number, node characteristic etc. Therefore I suggest to utilize existing frameworks in which we integrate our individual hardware ('plugins').

The current framework stack I am tinkering with is roughly:

Node red : High level management (not tried)
Homeassistant (HASS) : Management framework. Representation of the Components and Sensors as HASS objects. (first ecperiance)
MQTT : transport layer (running)
Ethernet/WLAN/(CAN-Bus) : physical transport layer (common knowledge)
Node : Node hardware z.B: Raspberry Pi
Registry/Plugins: for sensors/components (first prototype but nothing stable)
Sensors: GPIOs direct attached sensors, (I2C, serial, USB)- connected components.
Component(s) : Inverters, BMS, Current counters, High power Relays, ... (Inverter mpp-solar, BMS (own code) , Counter (own code))

CAN-Bus can be a great alternative to ethernet/WLAN. I work with CAN-Bus in heavy duty vehicles and there it is quite robust against EMP and other stress factors. Also CAN-Bus is only two wires has a wire limit of 1km.

For the sensors/components we need a common interface specification/transport protocol. This may be
quite simple but structured well. A good start could be a request/response scheme with python dictionaries serialized as JSON.

request:
{ request_id: 1213455,
time: timestamp,
node: node_id (e.g. raspberry2 ),
comp: comp_id (e.g. inverter3),
command : command (e.g. QID)
parameters : {
e.g. for setting something to a defined value
},
}

response:
{ request_id: 1213455,
time: timestamp,
node: node_id (e.g. raspberry2 ),
comp: comp_id (e.g. inverter3),
command : command (e.g. QID)
parameters : {
e.g. for setting something to a defined value
},
values: {
incoming_current: {
value : 1200,
unit: 'mA'
}
}
}

Cheers,

Volker

from mpp-solar.

jblance avatar jblance commented on July 24, 2024

I agree both with the above being a good idea and that mpp-solar is not the right platform to base it on.

Some random comments of your thoughts.

  1. I suggest a flexible approach, where the components could be interchanged reasonably easily.
  2. point 1 sounds easy, but changes some design choices
  3. this probably means we need some sort of message definition
  4. mpp-solar inverters have the 'fun' aspect that a query command provides multiple pieces of information...
  5. lets not forget the various cloud services that may be of use to some

It feels like we have a bunch of layers (again random thoughts)
aa. 'measurement type' device (inverter, bms, sensor, etc), this layer can provide a measurement
ab. 'action type' device (inverter, bms relay etc), this layer can do something (may be same device as previous)
b. communications layer (physical connectivity)
c. message queue / bus (like MQTT)
d. display (UI component of Home Assistant or Grafana etc)
e. orchestration / rules engine (Home Assistant rules, node red or others)
f. something that talks to a and puts messages into c via b??
g. persistence / storage
h. (maybe) management interface

Many of the above exist - point f. is probably where I see the lack (and for my scenario there will be multiple 'brains' (i.e the inverters are in a shed up the hill are connected to a Pi, but other devices wil be elsewhere and connected to different devices)

I guess in my 'ideal world' we'd be aiming at something that fixed the gap without re-inventing stuff that already exists. But also not force people to use a specific piece (you might use Node-Red, I might want to use python)

Of course, it is possible that you achieve most of the above simply by creating an integration to Home Assistant....

from mpp-solar.

DMIINC avatar DMIINC commented on July 24, 2024

I suggest a flexible approach, where the components could be interchanged reasonably easily.

This is the key......... IMO

from mpp-solar.

volkerjaenisch avatar volkerjaenisch commented on July 24, 2024

@jblance

I agree both with the above being a good idea and that mpp-solar is not the right platform to base it on.

Fine that you are not bothered.

Some random comments of your thoughts.

1. I suggest a flexible approach, where the components could be interchanged reasonably easily.

2. point 1 sounds easy, but changes some design choices

3. this probably means we need some sort of message definition

4. mpp-solar inverters have the 'fun' aspect that a query command provides multiple pieces of information...

5. lets not forget the various cloud services that may be of use to some

I agree fully. There are lots of open points. My proposal was only a first educated guess.

It feels like we have a bunch of layers (again random thoughts)
aa. 'measurement type' device (inverter, bms, sensor, etc), this layer can provide a measurement
ab. 'action type' device (inverter, bms relay etc), this layer can do something (may be same device as previous)
b. communications layer (physical connectivity)
c. message queue / bus (like MQTT)
d. display (UI component of Home Assistant or Grafana etc)
e. orchestration / rules engine (Home Assistant rules, node red or others)
f. something that talks to a and puts messages into c via b??
g. persistence / storage
h. (maybe) management interface

Also I agree.

Many of the above exist - point f. is probably where I see the lack (and for my scenario there will be multiple 'brains' (i.e the inverters are in a shed up the hill are connected to a Pi, but other devices wil be elsewhere and connected to different devices)

The correct routing of information will one of the many crucial tasks. My picture was only the 10000 feet view.
We will have to cover installations where we have to deal with many nodes (e.g. Raspbarries) dealing with many devices (Inverters, etc.).

I guess in my 'ideal world' we'd be aiming at something that fixed the gap without re-inventing stuff that already exists. But also not force people to use a specific piece (you might use Node-Red, I might want to use python)

I choose HASS since it is in python. I program since 40 years in several languages and with python I finally fell in love. Node red was just a wild guess.

Of course, it is possible that you achieve most of the above simply by creating an integration to Home Assistant....

Here I like to disagree.
HASS is not really designed for dealing with Devices that have several or complex internal states. So it would be not easy to model an Inverter that consists out of 3-4 sub-Inverters with HASS. I have not tried but the dev documentation on this topic is sparse. So we have to test if HASS supports this or we can make it to support it.

from mpp-solar.

jblance avatar jblance commented on July 24, 2024

Well, the integrations are python based, so 'can make it do whatever we want' to a certain extent
It is certainly easy to publish a value to MQTT then use HASS to see that as a sensor
I think the question would be 'is the rules engine in HASS sufficient'? followed by where is the effort 'modelling' the complex state best spent

(note I dont know the answers to these questions)

from mpp-solar.

volkerjaenisch avatar volkerjaenisch commented on July 24, 2024

Also we have to discuss use cases.
These are not well placed here but I start with them just to have them.

I will come up with my own solar facility in 2021 so I am no active use case.
My collegue has its own and score of customers with comparable solar facilities.

My collegue is located in south Germany:
50 qm cells. Large battery lithium ion based. Four inverters. Electric car.
Car is at work on 5 of 7 days. Car returns 16:00.
When at home a Button is pressed beside the wallbox indicating that the car has to be loaded.
The solar stripes then are reconfigured to put 2/3 of their power into one inverter phase to power the wallbox with 8 kW.

This is a good strategy if there is sun. But if there is no sun, the battery is the next best choice. And if the battery is low it may be a good choice to power the car from the grid.

So there has to be an authority to steer the flow of current.

In the current discussion we all agreed in giving HAAS the total control.

Do we really trust HASS to control the main power supply of our houses?

Or do we like to have some checks and balances beside HASS?

from mpp-solar.

jblance avatar jblance commented on July 24, 2024

Do we really trust HASS to control the main power supply of our houses?

Or do we like to have some checks and balances beside HASS?

Ah, well security is probably a good thing to consider early on...

from mpp-solar.

volkerjaenisch avatar volkerjaenisch commented on July 24, 2024

Not only security.
If we delegate our control to algorithms how can we prevent our homes to get stuck?
So we need fallback mechanisms. E.g. to deal with the HASS going down.

from mpp-solar.

jblance avatar jblance commented on July 24, 2024

Yes - I mean security in the wider sense, how to stop unauthorised access / actions is one aspect, fail-safes and stopping stupid requests are a few others

from mpp-solar.

jblance avatar jblance commented on July 24, 2024

Moved discussion to jblance/solarman https://github.com/jblance/solarman
Discussion doc in /docs/discussion.md

from mpp-solar.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.