My Solar PV Battery app

Hi Neil,

I’m able to reproduce the issue by disabling the SOC feed too. The issue seems to be due to
if (config.app.battery_soc.value)
still evaluating to true when it has been disabled. For me this then disabled access to the settings view due to the javascript object error.

I raised a ticket on github for you and managed to get access back to the settings view by modifying line 381 in mysolarpvbattery.php to set the optional property to false instead of true.
“battery_soc”:{“optional”:false, “type”:“feed”, “autoname”:“battery_soc”, “engine”:“5”, “description”:“Battery state of charge %”},

I hope this helps.

Keith

Thanks Keith - i’m really not familiar with Pi or Linux - how do i go about editing that php?

Hi Trystan - how could this be promoted to the iOS EmonCMS app? Currently the only apps available on there are MyElectric, MySolar, MySolarDivert.

Also, I have the API details (attached) for Alpha ESS to retrieve the SOC. Is the something you could help with? It’s all foreign to me.

AlphaESS Web API V2.120210512004203.pdf (353.4 KB)

Hello @neiloakley adding an app to the iOS app requires essentially writing it from scratch on the iOS platform I believe, so a fair bit of work. @mattjgalloway is the developer of the iOS app (and has kindly contributed it all voluntarily).

It might be worth asking if the battery supplier has any python scripts or other code examples for pulling data in from their API that we could work with as a starting point.

As the time remaining has been added to emoncms, would it be possible for it to be extended to charging too?

Eg time until fully charged?

Hi Graeme - Having been responsible for adding the discharge logic my concern with calculating time until fully charged, is that charging from 90% to 100% is not linear and can vary a lot from one system to another depending on how charge controllers / rectifiers are set up. I’m happy to look at it, but what rules do you think we should have ? Displaying time until charged to 90% is an option?

Im all for keeping it simple, Its an estimate after all.
Maybe at a start just use the same rules as discharge. Then if its not too much hassle an option to 90% can be added?

On the subject of limits, My battery runs from 100-20%. Am I correct in thinking battery time left assumes 0%?
If i set the battery to 8kwh, as its what I actually use would the time calculation be correct, or would the SoC % be confusing it?

I like the feature. At a glance I can see will i make it to the night rate on battery.

I can see this is brilliant but I can’t see a clear statement of how to set up the various inputs, some of which are different to my current ones for Solar only and some of which are new.
Do I have to use the latest postings from this thread or am I just not seeing it in emoncms.org?

Hi,

I am trying to create this simulator and it’s not working for me. I try to create the simulator post processor and it does not give me the create button. Please see screenshot. Any idea why this is happening?

Regards,
Amol

Hi, I’m currently trying to set this app up.

I’m using the type 2 setup as detailed here:

And I have a 3rd CT clamp that measures the current going to and from the Battery.

I’ve currently set up these feeds:

  • solar
  • battery_charge
  • battery_discharge

But I can’t figure out a way to calculate the use feed.

Is anyone else running a type 2 type setup with this app? If so can I ask how you set up the use feed?

I seem to have blundered my way to something that mostly works.

I add the three power sources (solar, battery discharge & import) and subtract battery charge and export; the house must be using the rest.

If you are recording any of the above as negative then you may need to reverse the add or subtract function to do the right thing.

The reason I said mostly works above is that I don’t trap negatives on some so sometimes I end up with a small negative amount which can’t be right.

Our convention is power/energy imported, generated and used is positive, but exported is negative. So what you’re doing - provided that you separate the battery charge and discharge accurately, looks to be more-or-less correct. I’m not sure that I’d regard battery charge as “use” and battery discharge as “generated” - they are more like “stored”, but the difference, i.e. the losses, is definitely “use” as it ultimately comes out of the system as heat. I think it’s a matter of preference as to how you regard the energy that is stored and subsequently recovered.

Don’t forget that PV has an overnight “keep-alive” consumption that might be confusing the issue.

@HypnoToad
Welcome to the OEM forum.

I think @christian’s comments should help you - or was your question really about where you put and what are the maths to combine the various inputs?

Thanks Robert, the overnight solar is definitely one of the factors!

Thanks, I think I’ve figured it out now, I had to mess around with the feeds a bit to create a use value in the end but it seems to work, and if giving what seems like the correct values.

In my case, I needed to add the grid + solar + battery discharge feeds together, then subtract the battery_charge feed.

1 Like

That sounds about right.

Using “Feeds” is the recommended way. Due to timing considerations, it’s preferable use Feeds rather than the corresponding Inputs.

Hi @TrystanLea I hope you are still monitoring this thread! I’ve just followed you guide to create my Solar Battery App. All working perfectly, except a couple of things!

  1. I’m trying to get my SOC via an API from my Battery supplier (PureDrive Energy) at the moment it is showing as blank on the app and I haven’t attempted to map the feed. Is that the best approach?
  2. For the Solar_Direct feeed, I can’t find the process called Max_Inp. Am I missing something? I’m using emoncms.org rather than a local version.
    Thanks for your help! :slight_smile:

Hello @BenWarwIck,

  1. Yes I’d say that using the SOC from the PureDrive Energy API is probably the best way to do this, though I dont have any experience with that API to be able to comment about how that can be done.

  2. Emoncms.org supports only a reduced set of input processes at the moment. So Im not sure about the equivalent best way to do that. If you are scripting the SOC can you preprocess that input in your script I wonder?

Thanks for the swift response. I haven’t contacted them yet about getting the API details to bring in SOC so that is a longer term thing.
For the solar_direct, is there a way to script that in? I’m a complete newbie with emoncms, managed to do the feed side and the app but that is about it.
From what I understand, I need solar_direct_kwh for the history to work. Can you tell me how is do that without max_imp?
Many thanks again!

I compute my solar direct usage by subtracting export and battery charge from the overall generation, then “Allow positive” process to discarding anything negative. Works for both watts and kWh, unless you’re charging the battery from the grid, in which case you’ll need to use “Power to kWh” process.

solar_direct = solar - export - charge >0 log
solar_direct_kwh = solar_kwh - export_kwh - charge_kwh >0 log

Could maybe be done with a virtual feed too, if that’s available to you.

Thanks Tim. That looks good. Only got CTs on Solar, External Supply and Battery so working out how to calculate all the others is a challenge. Fortunately the My Solar Battery app does a lot of the heavy lifting! :blush: