My Solar PV Battery app

Hi @TrystanLea We have a hybrid inverter and data is being collected via ModBus. so we get lots of information about the solar including temps. I will have a look at creating a feed with a loss just need to have a look and workout the factor.


1 Like

Are you using the EmonHub ModBus interfacer @Pukka out of interest what is the inverter model that you are fetching the data from?

Hi Trystan,

That is very helpful thank you.

I used your process and it works (I had to flip the CT clamp)

So right now in my Dashboard I have it like this

Moixa do not currently publish API’s they are working on a number of improvements to the software / App etc.

So if you could make the Battery SOC optional that would help me out, and probably others.

Many thanks

Mark

1 Like

Hi @TrystanLea

I am using Solution: Reading Solax SK-SU5000(E) inverters & SDM630V2 Modbus Power Meters

Its a solax SU5000

1 Like

PeterF,
Running your script almost works, it gets the SOC as evidenced by the print soc , but fails on the last line -

import urllib2, json

1. Fetch data from API 1

response = urllib2.urlopen(‘powerwall ip address/api/system_status/soe’)
jsonstr = response.read()
data = json.loads(jsonstr)
soc = data[‘percentage’]
print soc

2. Post data onwards to API 2

response = urllib2.urlopen(‘http://192.168.2.22/input/post?node=powerwall&data=soc:’+str(soc)+’&apikey=cf146a3b6a83a71fd93a1f5daa598f88’)

PYTHONHTTPSVERIFY=0 python getsoc.py
5.91907514451
Traceback (most recent call last):
File “getsoc.py”, line 9, in
response = urllib2.urlopen(‘http://192.168.2.22/input/post?node=powerwall&data=soc:’+str(soc)+’&apikey=cf146a3b6a83a71fd93a1f5daa598f88’)
File “/usr/lib/python2.7/urllib2.py”, line 154, in urlopen
return opener.open(url, data, timeout)
File “/usr/lib/python2.7/urllib2.py”, line 435, in open
response = meth(req, response)
File “/usr/lib/python2.7/urllib2.py”, line 548, in http_response
‘http’, request, response, code, msg, hdrs)
File “/usr/lib/python2.7/urllib2.py”, line 473, in error
return self._call_chain(*args)
File “/usr/lib/python2.7/urllib2.py”, line 407, in _call_chain
result = func(*args)
File “/usr/lib/python2.7/urllib2.py”, line 556, in http_error_default
raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
urllib2.HTTPError: HTTP Error 404: Not Found
pi@emonpi:~ $

Emoncms is running on a Rpi on its own being fed by Iotawatt.

To get My Solar PV Battery app going I have substituted different feed that is usually zero.

We should have an alternative using EmonHub running very soon @Wirrunna, it would be great if you would be happy to help us test here Fetch Tesla Power Wall State of charge using EmonHub - #21 by TrystanLea

Hi Trystan

Did you look at limit by feed?
I think I will need this as well as I have solar coming in on 2 separate inputs as the PV installations are on 2 different outbuildings. I am also on 3 phase which really means all feeds have to be created using multiple inputs and can get complicated.

Hello John @Wirrunna. 404: Not Found means the url is incorrect. Maybe the IP address is wrong?
However, the new method that @TrystanLea mentioned above is working, I would recommend waiting a short while until it is formally released and using that, as it is much neater and will be supported by Open Energy Monitor :slight_smile:

Possibly I’ve missed it in this very popular thread (a sign of your excellent work), but how do I get the max_inp process?

Ta!

Hello @miker its currently in the master branch of emoncms, so not yet merged into stable. To get it sooner the steps are:

cd /var/www/emoncms
git checkout master
git pull origin master
1 Like

Trystan, works fine, thankyou.
Abridged setup -

  1. Update , saw updates in EmonHub.
  2. Then in emonhub.conf add the following interfacer configuration:
  3. In putty - If you run restart and then open the log immediately you should hopefully see that:
sudo service emonhub restart
tail -f /var/log/emonhub/emonhub.log

produced error free output.

  1. Opened Inputs , new Node powerw with soc. Added Log to feed soc
  2. Configured My Solar PV Battery app to use soc
  3. Restart app and soc percentage is there !

Thank you.

1 Like

PeterF, did exactly as you suggested, thank you.

1 Like

@TrystanLea I may have missed this somewhere, but is there any chance to get Divert into My Solar PV Battery?

@TrystanLea Small bug in app, selecting Show kW does not re-scale the Battery Charging field. My battery is currently charging at 54kW, help!

Battery SOC is now optional in the latest version.

Fixed, thanks.

1 Like

@ian @pepso I’ve added limit by feed max and min processes as well. Currently in the emoncms master branch for testing, these are the command line steps to test these processes.

cd /var/www/emoncms
git checkout master
git pull origin master

Again, sorry for the delay in getting back to you. Love the direction that this is going in, but (once again) I had tied myself up in knots / overcomplicated things, so have cleared out old Inputs & Feeds and would like to start again.

Based on the following screenshots, what processes should I add in order to include …

Use: Building Consumption in watts (not including battery charging):
would this be house:Meter_IN plus PV Generation ?

Solar_Direct_kWh: Cumulative solar generation used directly in kWh:
this will presumably be your three lines quoted above, but not sure where I should include them

Meter_nett means the power coming in from the road less any exported (so won’t actually agree with the physical meter as it doesn’t go backwards).
Meter_IN is imported power
Meter_OUT is exported power

I also need to review values produced to check if I need to x1 or x-1 etc to get them in the correct sense, but it will be easier to do that when I have the structure correct.

TIA

Julian

@TrystanLea - I made some progress yesterday with my Inputs & Feeds, but whilst the numbers in the top section of the App are correct (inasmuch as they agree with the Tesla Powerwall app), I can’t get some of the lower half to display what I would expect.

The 1.1 kWh flow from Battery to House is most likely correct, & the values circled in pink could be rounding errors.

But the values circled in green & orange are odd, and I can’t work out how changing positive / negative in flow directions would sot them out.

Do you have any ideas?

TIA

Really enjoying playing with this app/simulator interesting stuff

1 Like

Hmmm, not sure what has happened during the morning, but looking again the numbers look about right. Fingers crossed !

Not quite sure what the 3.5kWh for 30 minutes in the night was, as it is after the 04:30 cutoff for cheap power. Possibly the HW (as the P’wall would have taken 5.5kW), so must check the time clock - but I am 90% sure it is correct. Where does one check the time zone being used by emonCMS?