rossandrews / mpp-solar-api

Sample of how to setup webservice to work with https://github.com/jblance/mpp-solar project
ISC License
3 stars 0 forks source link

Questions about mpp-solar configuration file #1

Open frederickjh opened 1 year ago

frederickjh commented 1 year ago

Hi Ross! In the configuration file documentation for mpp-solar it says:

# The section name needs to be unique # There can be multiple sections which are processed sequentially without pause

The documentation for this project says:

Setup mpp-solar to run in daemon mode with the config found in this project mpp-solar.config

So it is possible to use your web api and still have mpp-solar run other sections too?

If so then not the whole configuration is necessary but just the section:

#Runs no commands, it waits for requests on the commands_topic
[Schedule_requests]
port=/dev/hidraw0
protocol=PI30
command=
commands_topic=mpp-solar/api-client
outputs=json_mqtt
pause_loops=0

In this way the normal data could be collected at timed intervals and commands could be sent to the inverter as well.

I am guessing that it is also possible to use other output formaters as well? Are you using this with Home Assistant?

Thanks for your time and help! Frederick

rossandrews commented 1 year ago

Hi Frederick,

This sample code went along with my fork of mpp-solar https://github.com/rossandrews/mpp-solar but my pull request didn't make it into the main branch. I added my changes to the main mpp-solar command and not the newer power-monitor command. I haven't taken a look in about a year but I'll get caught up on the recent changes and see if I can get this working again.

I did have it running multiple blocks of scheduled commands, some to pull data and the above example to wait for commands.

I wasn't using home assistant, I was feeding the data into micro-services to expose them to a custom Vue frontend. Working with home assistant would be much nicer and I have been playing around with auto discovery with MQTT. Could be a future improvement.

I'll leave this open, you can ping me in a week or two for an update.

frederickjh commented 1 year ago

Hey @rossandrews

I am wondering if I understood you correctly that this mpp-solar-api will only work with your fork of mpp-solar. Also, wondering if you were able to get your fork updated with changes from the main repo. Thanks, Frederick

rossandrews commented 1 year ago

I have a new plan. I will work with jblance to add the same scheduling and adhoc command features to the powermon in mpp-solar. Then I will update this repo to use the main branch. After that I will use docker-compose to setup the three components required to make the api work. It will take me a few weeks to get it all done.

frederickjh commented 1 year ago

Thanks, @rossandrews that sounds likea plan. I would definitely like to be able to monitor and send other control commands. I am currently just using the Android app to manually send commands.

Let me know if you need help testing, writing documentation, etc. I use to do web development, but my javascript is a bit rusty and I relatively new python.

frederickjh commented 1 year ago

@rossandrews also can you link here any relate issues, and pull request from the jbalance project? Thanks!

frederickjh commented 1 year ago

@rossandrews Just wondering what progress you have made on this. Are there any related issues or pull requests that I could follow to see the progress and help?

rossandrews commented 1 year ago

@frederickjh I had an API using FastAPI working on the master branch of mpp-solar. Looks like some more changes have come in and it's broken. I'll get it working and keep my branch around for you to try out.

frederickjh commented 1 year ago

@rossandrews sounds good. Thanks again for your work on this.

frederickjh commented 1 year ago

@rossandrews Just wondering what the current state of this is? Are you still working on powermon or is it ready to use? I just opened an issue at jbalance/mpp-solar about the documentation or lack there of. What does exist does not always seem to agree with the files in mpp-solar/powermon/config.

rossandrews commented 1 year ago

I haven't been working on this as much as I would like so my progress has been slow. The code quality in powermon has improved quite a bit so it's easier to work on. I'll continue the conversation in the other repo.